Added full project path to the branch name#1051
Merged
Conversation
attiasas
reviewed
Feb 15, 2026
Contributor
attiasas
left a comment
There was a problem hiding this comment.
Nice! check out my comments
scanrepository/scanrepository.go
Outdated
| // Fix every vulnerability in a separate pull request and branch | ||
| for _, vulnerability := range vulnerabilities { | ||
| if e := cfp.fixSinglePackageAndCreatePR(repository, vulnerability); e != nil { | ||
| if e := cfp.fixSinglePackageAndCreatePR(repository, fullProjectPath, vulnerability); e != nil { |
Contributor
There was a problem hiding this comment.
Suggested change
| if e := cfp.fixSinglePackageAndCreatePR(repository, fullProjectPath, vulnerability); e != nil { | |
| if e := cfp.fixSinglePackageAndCreatePR(repository, projectWorkingDir, vulnerability); e != nil { |
I would use relative path from root
| } | ||
| } | ||
|
|
||
| func TestGenerateFixBranchName_UniquePerProject(t *testing.T) { |
Contributor
There was a problem hiding this comment.
I would just add a new test cases to TestGenerateFixBranchName and adjust the test
attiasas
approved these changes
Feb 15, 2026
| func (gm *GitManager) GenerateFixBranchName(branch string, impactedPackage string, fixVersion string, projectPath string) (string, error) { | ||
| hashInputs := []string{"frogbot", branch, impactedPackage, fixVersion} | ||
| if projectPath != "" { | ||
| hashInputs = append(hashInputs, projectPath) |
Contributor
There was a problem hiding this comment.
Suggested change
| hashInputs = append(hashInputs, projectPath) | |
| hashInputs = append(hashInputs, filepath.ToSlash(projectPath)) |
make sure to add this so runs from windows and diff os will show the same results.
Contributor
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.

When a repository contains multiple projects that share the same package fix, Frogbot attempts to create separate remediation branches for each project. However, it currently uses the same branch name for both, leading to a naming conflict.
This PR is adding the full project path to the branch name, making it unique per project.