-
Notifications
You must be signed in to change notification settings - Fork 85
Refactor Scan Pull Request to accept PR ID as input #398
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
Refactor Scan Pull Request to accept PR ID as input #398
Conversation
sverdlov93
left a comment
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.
not finished the review yet
| if g.PullRequestID, err = strconv.Atoi(pullRequestIDString); err != nil { | ||
| return err | ||
| if g.PullRequestID == UndefinedPrID { | ||
| if idStr := getTrimmedEnv(GitPullRequestIDEnv); idStr != "" { |
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.
why PullRequestID can't be string?
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.
The API accepts ID as an int ( froggit-go )
| var vulnerabilitiesRows []formats.VulnerabilityOrViolationRow | ||
| var iacRows []formats.IacSecretsRow | ||
| targetBranch := repoConfig.Branches[0] | ||
| targetBranch := pullRequestDetails.Target.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.
pullRequestDetails.Target can't be nil?
pullRequestDetails.Source cant be nil?
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.
They can be empty with default values, but they cannot be nil.
Refactor
scan-pull-requestcommand to accept PR ID as input instead of relying on context.scan-pull-requests commandto use the singularscan-pull-requestThis will allow to use scan pull requests command with Jenkins webhook trigger, providing the pull request ID.
Jenkins Webhook Docs Update PR:
#399
Update:
When pull request origin from a forked repository, we need to know the owner in order to access the source code.
jfrog/froggit-go#102