Skip to content

Conversation

@willschnicke-silkline
Copy link

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.

Changes

  • Added applyBranchNamePrefix() helper function to centralize prefix logic
  • Applied prefix in createBranch() for av branch <name>
  • Applied prefix in branchSplit() for av branch --split
  • Removed duplicate prefix logic from branchNameFromMessage() in commit.go
  • Updated test repos to explicitly set empty branchNamePrefix to avoid interference from global config

Testing

  • All existing tests pass
  • Added comprehensive test coverage for branch name prefix behavior across all creation paths

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>
@willschnicke-silkline willschnicke-silkline requested a review from a team as a code owner January 22, 2026 19:46
@aviator-app
Copy link
Contributor

aviator-app bot commented Jan 22, 2026

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This pull request is currently open (not queued).

How to merge

To merge this PR, comment /aviator merge or add the mergequeue label.


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.

@aviator-app
Copy link
Contributor

aviator-app bot commented Jan 22, 2026

🔃 FlexReview Status

Common Owner: aviator-co/engineering (expert-load-balance assignment)
Owner and Assignment:

  • 🔒 aviator-co/engineering (expert-load-balance assignment)
    Owned Files
    • 🔒 e2e_tests/branch_name_prefix_test.go
    • 🔒 cmd/av/branch.go
    • 🔒 cmd/av/commit.go
    • 🔒 internal/git/gittest/repo.go

Review SLO: 7 business hours if PR size is <= 200 LOC for the first response.

@aviator-app aviator-app bot requested a review from davi-maciel January 22, 2026 19:46
@gemini-code-assist
Copy link

Summary of Changes

Hello @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 branchNamePrefix configuration was not uniformly applied across all branch creation methods. By centralizing the prefix application logic into a single function, the system now ensures that all new branches, whether explicitly named or auto-generated through commands like av branch, av branch --split, or av commit -b, correctly adhere to the configured naming convention. This change improves the predictability and reliability of branch naming within the av CLI tool.

Highlights

  • Centralized Branch Naming Logic: Introduced a new helper function, applyBranchNamePrefix(), to centralize the logic for applying configured branch name prefixes.
  • Consistent Prefix Application: Ensured the branchNamePrefix configuration is consistently applied across all branch creation commands, including av branch <name>, av branch --split, and av commit -b.
  • Code Simplification: Removed redundant and duplicate branch name prefix application logic from cmd/av/commit.go, leading to cleaner and more maintainable code.
  • Enhanced Test Coverage: Added comprehensive end-to-end tests to verify the correct and consistent behavior of branch name prefixes in various creation scenarios.
  • Improved Test Environment Isolation: Updated test repository setup to explicitly set an empty branchNamePrefix in test configurations, preventing interference from global settings during tests.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Comment on lines +108 to +109
pullRequest:
branchNamePrefix: ""

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!

Copy link

@gemini-code-assist gemini-code-assist bot left a 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)
}

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>
@willschnicke-silkline
Copy link
Author

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a 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.

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.

1 participant