-
Notifications
You must be signed in to change notification settings - Fork 64
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
Introduce an option to overwrite GitHub contexts of pending presubmit ProwJobs when merging batches in tide
#135
base: main
Are you sure you want to change the base?
Introduce an option to overwrite GitHub contexts of pending presubmit ProwJobs when merging batches in tide
#135
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: oliver-goetz The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Welcome @oliver-goetz! |
Hi @oliver-goetz. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
✅ Deploy Preview for k8s-prow ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
pkg/tide/github.go
Outdated
|
||
for _, pj := range pjs { | ||
for _, pull := range pj.Spec.Refs.Pulls { | ||
if pr, found := prNums[pull.Number]; found && pr.HeadRefOID == pull.SHA { |
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.
Do we need to also consider the ref for the target branch? Could we have some race like:
- trigger presubmits on target ref A
- trigger batch for same
- push to PR
- trigger presubmits for target ref B
- presubmits publish pending statuses
- batch finishes
- this code runs, overwriting presubmits
- batch would have been cancelled by the new push
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.
Okay, I see.
I restructured this function that it checks if all PRs of a batch job are valid before collecting it. The logic is similar to how batch PRs are accumulated (ref).
Now, the context of a batch job which contain invalid or missing PRs are not collected anymore.
/ok-to-test |
7a15b1f
to
8d7d484
Compare
@stevekuznetsov could you check this PR again please? 🙂 |
Fixes kubernetes/test-infra#32097
With this PR
tide
overwrites the context ofpending
ProwJobs when it merges a batch of PRs. It uses the status of the succeeded batch job with the same context. The feature is disabled by default and can be enabled viaoverwrite-pending-contexts
context option.Before, Github branch-protection rules could prevent merging PRs from a batch (see kubernetes/test-infra#32097 for details).
When a PR is merged the ProwJobs which are still running are canceled automatically by trigger plugin of
hook
, so there is no need to cancel them intide
.This PR replaces kubernetes/test-infra#32416.