Repository navigation
Conversation
Add 'volcano git production-branch <branch>' and '--reset'. Naming a branch pins it, so a later change to the repository's default branch leaves it alone; --reset makes the project follow the default branch again and says which branch that is. Like root-directory, it works with a project access token and reports what a push to the production branch deploys. Vendors the production-branch spec from Kong/volcano-hosting#2184.
The connection now says whether its production branch follows the repository's default or was pinned for the project. connect treats a branch other than the default as stale only when it follows the default, and binding the same repository again sends a pinned branch back, since leaving it out follows the default. status and every git command mark the branch as pinned or following the default. Vendors production_branch_follows_default from Kong/volcano-hosting#2184.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
volcano git production-branch <branch>andvolcano git production-branch --resetchange only the branch a push has to land on to deploy. The repository binding is left as it is.--resetsends{"production_branch": ""}. The server reads the default branch from GitHub and returns it in the connection withproduction_branch_follows_default: true.root-directory, so CI or an agent can run the command.--reseton a repository with no default branch yet.root-directoryalready uses:guideBindingEditnow holds that check for both commands.Keeping a pinned branch
Hosting#2184 adds
production_branch_follows_defaulttoProjectGitConnection. Without it, re-runningvolcano git connectwould silently drop a pin. This PR uses the field as follows:connecttreats a branch other than GitHub's default as stale only when the branch follows the default. A pinned branch, including one that equals today's default, reports "already connected" and writes nothing.production_branchout would make the project follow the default again.connect --root-directoryon a pinned project uses the root-directory route, which leaves the branch alone.statusand everygitcommand show the branch with its state, for exampleProduction branch: release (pinned)orProduction branch: main (follows the default).production-branchreads the state from the response, not from whether--resetwas passed.Spec
Every hunk of hosting#2184's
api/openapi.bundled.yamlat 9cc0518e is applied unchanged:production_branch_follows_defaultonProjectGitConnection;PUT.The client is regenerated. I'll copy the spec again verbatim once #2184 is on main.
Tests
internal/cmd/git/production_branch_test.gocovers:connect_test.gocovers:release, andmainequal to the default) left alone;--root-directoryon a pinned project;status_test.gocovers both states.helpers_test.goserves the production-branch route and models the flag the way the platform does.tests/e2e/localmode/git_test.gonow runsvolcano git production-branch releaseagainst the local stack as well asroot-directory, in CI'slocalmode-e2ejob.Docs
docs/git.mdgains:It also stops saying that only a push to the default branch deploys.
🤖 Generated with Claude Code