-
Notifications
You must be signed in to change notification settings - Fork 29
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
feat(webhook)!: support build approval based on repository settings #1016
Merged
Conversation
This file contains 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
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1016 +/- ##
==========================================
- Coverage 68.36% 67.89% -0.48%
==========================================
Files 317 318 +1
Lines 13641 13738 +97
==========================================
+ Hits 9326 9327 +1
- Misses 3848 3944 +96
Partials 467 467
|
KellyMerrick
previously approved these changes
Nov 29, 2023
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.
lgtm
KellyMerrick
approved these changes
Dec 6, 2023
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.
lgtm
timhuynh94
approved these changes
Dec 8, 2023
This was referenced Dec 20, 2023
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.
This is the server-side implementation for approving builds, specifically from fork repos during PR builds.
A couple small refactors that made this possible:
PublishToQueue
now takes the route as a parameter rather than determining it. This was done in order to avoid unmarshaling the pipeline object when approved. We're able to do this by preemptively setting thebuild.Host
to the specified route rather than waiting for a worker to pick it up.RepoAccess
accepts a user name rather than an entire user object since that's all we need + adds ability to check for access ofsender
without creating a fake user object and populating the nameexecutors.Establish()
has an additional check on build status since host is now being set as the route while the build is pending / pending approval.The main idea of the implementation is to separate the publishing of the build executable from the publishing to the queue. If the build is clear to run, the
PostWebhook
handler will take care of both. However, if it is not clear to run, then the newApproveBuild
handler will handle queue publishing while thePostWebhook
handler just generates and publishes the executable.Lastly, the status report to the SCM for builds pending approval has been adjusted to describe the situation, making the experience more understandable for users having their builds gated.