Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update branches RFC #1025 #107

Merged
merged 1 commit into from
Feb 5, 2025
Merged

Update branches RFC #1025 #107

merged 1 commit into from
Feb 5, 2025

Conversation

vpetrovykh
Copy link
Member

Set up instance-specific and project-specific way to specify the current branch. Both of them de facto exist, but they were not coordinated resulting in bugs.

@vpetrovykh vpetrovykh requested review from a team January 30, 2025 11:16
@vpetrovykh
Copy link
Member Author

We have 2 ways of specifying branches:

  1. As part of the instance credentials
  2. As part of project configuration

Our branch CLI tools all work with the instance credentials to keep track of the current branch. However, linking a cloud instance to a project allows to override the branch associated with the cloud instance via a different mechanism. In addition to the instance config we have a project config that allows to override instance-name, cloud_profile, project-path, and database. This mechanism predates our branches concept.

The database setting was introduced by edgedb/edgedb-cli#1086 in order to allow multiple projects to be linked to the same cloud instance, but using different databases.

Unfortunately this way of setting the current branch is buggy in our CLI tools. Which leads to a situation where CLI branch tools work fine for local instances, but adding and the removing a cloud instance may cause database to be overridden. The CLI tools then read this database setting as the current branch, but they don't update it when switching branches, so the branch is stuck.

@vpetrovykh
Copy link
Member Author

There is no reason why projects with local and cloud instances should treat branches differently. So we need to make them use the settings consistently.

It seem that we have 2 scenarios:

  1. branch commands targetting an instance

    If a branch command has an explcit -I option, it should refer to and modify the instance credentials (ignoring project database setting).

  2. project branch commands

    If a branch command omits -I and relies on the project settings, it must never modify the instance credentials, instead updating the branch (or database when already present) in the project settings (regardless of whether this is a local or cloud instance).

Copy link
Contributor

@aljazerzen aljazerzen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, we are on the same page.

text/1025-branches.rst Outdated Show resolved Hide resolved
Set up instance-specific and project-specific way to specify the current
branch. Both of them de facto exist, but they were not coordinated
resulting in bugs.
@vpetrovykh vpetrovykh merged commit a26c76e into master Feb 5, 2025
@vpetrovykh vpetrovykh deleted the branch branch February 5, 2025 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants