-
Notifications
You must be signed in to change notification settings - Fork 3k
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
mergify: fix needs work labels if CI fails #15141
Conversation
We have clash with needs work and needs CI labels. If CI fails, we need to be in CI stage. Check for needs: CI label and apply work only if it was CI. Otherwise we would be in the loop.
@0xc0170, thank you for your changes. |
- -closed | ||
actions: | ||
label: | ||
add: ['needs: work'] | ||
remove: ['needs: review','needs: CI'] | ||
remove: ['needs: CI'] |
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 has the remove bit changed? If there is a needs:review doesn't that also need removing ?
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.
This stage is from CI to needs work, we should not touch review label as it was already removed in a stage before (review -> CI).
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.
Line 62 should be more important for this fix. I removed review part of this fix as it does not make sense to be removed, or does it.
- "label!=mergify skip" | ||
actions: | ||
label: | ||
add: ['needs: work'] | ||
remove: ['needs: review', 'needs: CI'] | ||
remove: ['needs: CI'] |
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.
Same here ?
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.
Same is above, these 2 stages here are for CI failures, nothing related to review.
i also added needs: CI needs to be already part of the PR.
Ci started |
Summary of changes
We have a clash with needs work and needs CI labels. If CI fails, we need to be in CI stage. Check for needs: CI label and apply work only if it was CI.
Otherwise we would be in the loop (we had couple of PRs with 400 messages from mergify). Because we did not check for previous stage (like this fix is doing), we had PRs where both states were true (apply needs work and apply needs CI labels - remove any other label). If we are more strict, and apply needs work only if CI fails and it is in CI stage, we should avoid having this infinite loops.
Impact of changes
Migration actions required
Documentation
Pull request type
Test results
Reviewers