Skip to content
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

Restrict aggregate mode to a single active branch #367

Merged
merged 21 commits into from
Jun 28, 2023

Conversation

EyalDelarea
Copy link
Contributor

@EyalDelarea EyalDelarea commented Jun 21, 2023

  • 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.

This pull request introduce new logic the the aggregate pull request flow.
The main goal is to ensure that ONLY one pull request & branch is active when the aggregate_fixes flag is set to true.

The new logic will set the branch name to a fixed branch name, that could be updated on every run.

The flow goes as follows:

Check if there is an open pull request which the source branch is the fixed aggregated branch name.
Doesn't exists ? -> open new pull request.
Exists already ?
Check the scan results of the existing branch against to new scan we are running
Same results? -> Do nothing.
Different results? -> Force update the branch.

Depends on jfrog/froggit-go#95

@EyalDelarea EyalDelarea added the improvement Automatically generated release notes label Jun 21, 2023
commands/utils/consts.go Outdated Show resolved Hide resolved
@EyalDelarea EyalDelarea marked this pull request as ready for review June 21, 2023 12:05
@EyalDelarea EyalDelarea requested a review from eyalbe4 June 21, 2023 12:05
@EyalDelarea EyalDelarea added the safe to test Approve running integration tests on a pull request label Jun 21, 2023
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Jun 21, 2023
@github-actions
Copy link
Contributor

What is Frogbot?

@EyalDelarea EyalDelarea temporarily deployed to frogbot June 21, 2023 14:44 — with GitHub Actions Inactive
@EyalDelarea EyalDelarea added the safe to test Approve running integration tests on a pull request label Jun 21, 2023
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Jun 21, 2023
@github-actions
Copy link
Contributor

What is Frogbot?

@jfrog jfrog deleted a comment from github-actions bot Jun 22, 2023
commands/utils/git.go Outdated Show resolved Hide resolved
commands/utils/git.go Outdated Show resolved Hide resolved
commands/utils/git.go Outdated Show resolved Hide resolved
commands/utils/params.go Outdated Show resolved Hide resolved
// In case of existing aggregated fix, check for different scan results
// if scan results are the same, do nothing.
// Else, force push to the same branch to update
// Only one aggregated pull request should be open at all times.
func (cfp *CreateFixPullRequestsCmd) fixIssuesSinglePR(fixVersionsMap map[string]*utils.FixDetails) (err error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should design a test that simulate and verifies all of the possible scenarios -

  1. Identical results to an existing PR
  2. Different results from an existing PR
  3. No existing open PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll implement those tests in #345
As all of the testings infrastructure exists there.

commands/createfixpullrequests.go Outdated Show resolved Hide resolved
commands/createfixpullrequests.go Show resolved Hide resolved
commands/createfixpullrequests.go Outdated Show resolved Hide resolved
commands/createfixpullrequests.go Outdated Show resolved Hide resolved
@EyalDelarea EyalDelarea added the safe to test Approve running integration tests on a pull request label Jun 27, 2023
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Jun 27, 2023
@github-actions
Copy link
Contributor


  • Frogbot also supports the Contextual Analysis, Infrastructure as Code Scanning and Secrets Detection. These features are included as part of the JFrog Advanced Security package, which isn't enabled on your system.

@EyalDelarea EyalDelarea added the safe to test Approve running integration tests on a pull request label Jun 27, 2023
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Jun 27, 2023
@github-actions
Copy link
Contributor


  • Frogbot also supports Contextual Analysis, Infrastructure as Code Scanning and Secrets Detection. These features are included as part of the JFrog Advanced Security package, which isn't enabled on your system.

commands/utils/params.go Outdated Show resolved Hide resolved
commands/utils/params.go Outdated Show resolved Hide resolved
commands/createfixpullrequests.go Outdated Show resolved Hide resolved
@EyalDelarea EyalDelarea added the safe to test Approve running integration tests on a pull request label Jun 28, 2023
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Jun 28, 2023
@EyalDelarea EyalDelarea temporarily deployed to frogbot June 28, 2023 13:06 — with GitHub Actions Inactive
@EyalDelarea EyalDelarea added the safe to test Approve running integration tests on a pull request label Jun 28, 2023
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Jun 28, 2023
@EyalDelarea EyalDelarea changed the title Aggregate fixes verifies only one active branch Restrict aggregate mode to a single active branch Jun 28, 2023
@github-actions
Copy link
Contributor


  • Frogbot also supports Contextual Analysis, Infrastructure as Code Scanning and Secrets Detection. These features are included as part of the JFrog Advanced Security package, which isn't enabled on your system.

1 similar comment
@github-actions
Copy link
Contributor


  • Frogbot also supports Contextual Analysis, Infrastructure as Code Scanning and Secrets Detection. These features are included as part of the JFrog Advanced Security package, which isn't enabled on your system.

@EyalDelarea EyalDelarea merged commit 6a3e3c5 into jfrog:dev Jun 28, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Automatically generated release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants