-
Notifications
You must be signed in to change notification settings - Fork 36
respect branchNamePrefix config in all branch creation paths #653
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
base: master
Are you sure you want to change the base?
respect branchNamePrefix config in all branch creation paths #653
Conversation
The branchNamePrefix config setting was only being used when auto-generating branch names via `av commit -b`, but not when using `av branch` directly or `av branch --split` to split commits. Now the prefix is applied consistently across all branch creation commands by centralizing the logic in a single `applyBranchNamePrefix` helper function. When branches are created (whether explicitly named or auto-generated), the configured prefix gets prepended. To ensure tests aren't affected by developers' global av config, test repos now explicitly set an empty branchNamePrefix in their local config. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Current Aviator status
This pull request is currently open (not queued). How to mergeTo merge this PR, comment
See the real-time status of this PR on the
Aviator webapp.
Use the Aviator Chrome Extension
to see the status of your PR within GitHub.
|
🔃 FlexReview StatusCommon Owner:
Review SLO: |
Summary of ChangesHello @willschnicke-silkline, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves an inconsistency where the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
| pullRequest: | ||
| branchNamePrefix: "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my global av setting was conflicting, causing tests to fail. let me know if there is a more correct way to do this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request effectively centralizes the branchNamePrefix logic to ensure consistent application across all branch creation commands. The new applyBranchNamePrefix helper is a clean solution, and the removal of duplicated code improves maintainability. The added end-to-end tests are comprehensive and cover the intended changes well. I have a couple of suggestions to further improve the new test code for robustness and maintainability.
| name = strings.ToLower(name) | ||
| if config.Av.PullRequest.BranchNamePrefix != "" { | ||
| name = fmt.Sprintf("%s%s", config.Av.PullRequest.BranchNamePrefix, name) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now handled in branch.go
- Extract common test setup logic into setupRepoWithPrefix helper function - Use exact branch name assertions instead of Contains for more robust tests - Reduces code duplication across all test functions Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request does a great job of refactoring the branch name prefix logic to be consistent across all branch creation paths. The introduction of the applyBranchNamePrefix helper function is a clean way to centralize this functionality. The removal of the old, duplicated logic and the addition of comprehensive E2E tests significantly improve the codebase's maintainability and correctness. The update to test configurations to ensure isolation is also a welcome improvement. I have one suggestion to further enhance consistency in branch name generation.
The branchNamePrefix config setting was only being used when auto-generating
branch names via
av commit -b, but not when usingav branchdirectly orav branch --splitto split commits.Now the prefix is applied consistently across all branch creation commands by
centralizing the logic in a single
applyBranchNamePrefixhelper function.When branches are created (whether explicitly named or auto-generated), the
configured prefix gets prepended.
Changes
applyBranchNamePrefix()helper function to centralize prefix logiccreateBranch()forav branch <name>branchSplit()forav branch --splitbranchNameFromMessage()in commit.goTesting