Skip to content

Added full project path to the branch name#1051

Merged
orto17 merged 4 commits intojfrog:devfrom
orto17:fix-naming-conflict
Feb 16, 2026
Merged

Added full project path to the branch name#1051
orto17 merged 4 commits intojfrog:devfrom
orto17:fix-naming-conflict

Conversation

@orto17
Copy link
Contributor

@orto17 orto17 commented Feb 10, 2026

  • All tests passed. If this feature is not already covered by the tests, I added new tests.
  • This pull request is on the dev branch.
  • I used gofmt for formatting the code before submitting the pull request.
  • Update documentation about new features / new supported technologies

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.

@orto17 orto17 added the safe to test Approve running integration tests on a pull request label Feb 10, 2026
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Feb 10, 2026
Copy link
Contributor

@attiasas attiasas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! check out my comments

// 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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just add a new test cases to TestGenerateFixBranchName and adjust the test

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@orto17 orto17 added safe to test Approve running integration tests on a pull request labels Feb 16, 2026
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Feb 16, 2026
@orto17 orto17 added safe to test Approve running integration tests on a pull request labels Feb 16, 2026
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Feb 16, 2026
@github-actions
Copy link
Contributor

👍 Frogbot scanned this pull request and did not find any new security issues.


@orto17 orto17 merged commit 7ed1de4 into jfrog:dev Feb 16, 2026
36 of 45 checks passed
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.

2 participants