feat: added branch flag to deploy command - #306
Open
DriesDelanghe wants to merge 1 commit into
Open
Conversation
Comment on lines
+151
to
+153
| --branch BRANCH Specify the branch where the changes should be | ||
| committed to. If omitted with --create-pr, a random | ||
| branch is created. |
Member
There was a problem hiding this comment.
Suggested change
| --branch BRANCH Specify the branch where the changes should be | |
| committed to. If omitted with --create-pr, a random | |
| branch is created. | |
| --branch BRANCH Specify the branch where the changes should be | |
| committed to. Creates a new branch if it doesn't exist yet. |
nit: Mentioning the PR creation here is a bit confusing. I'd mention the branch flag in the PR flag instead.
| --git-provider-url GIT_PROVIDER_URL | ||
| Git provider base API URL (e.g. https://bitbucket.example.tld) | ||
| --create-pr [CREATE_PR] | ||
| Creates a Pull Request |
Member
There was a problem hiding this comment.
Suggested change
| Creates a Pull Request from a random new branch. Use --branch to use a specific branch name instead. |
see comment above
| except GitError as ex: | ||
| raise GitOpsException(f"Error creating new branch '{branch}'.") from ex | ||
|
|
||
| def checkout(self, branch: str) -> None: |
Member
There was a problem hiding this comment.
nit: Instead of cloning main and then calling checkout/new_branch depending on __remote_branch_exists, couldn't we clone the branch directly when it already exists?
For example, call __remote_branch_exists first (using the clone URL rather than origin), then either clone(existing_branch) if it exists, or clone + new_branch if it doesn't.
This would avoid cloning main only to immediately switch to the requested branch, and should also avoid the additional fetch in the existing-branch case.
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.
Added a --branch flag to the deploy command
PR for issue #305