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

mergify: fix needs work labels if CI fails #15141

Merged
merged 1 commit into from
Oct 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,33 +47,36 @@ pull_request_rules:
- check-failure=cmake-checks
- check-failure=frozen-tools-check
- "label!=mergify skip"
- "label!='needs: work'"
actions:
label:
add: ['needs: work']
remove: ['needs: review', 'needs: CI']

# From needs: review to needs: work - CI failure
# From needs: CI to needs: work - CI failure in jenkins pipeline
- name: "label needs: work when Jenkins CI failed - pr head"
conditions:
# Jenkins CI failing
# Jenkins CI failing, only pr head
- check-failure~=continuous-integration/jenkins/pr-head
- "label!=mergify skip"
- "label=needs: CI"
- -closed
actions:
label:
add: ['needs: work']
remove: ['needs: review','needs: CI']
remove: ['needs: CI']
Copy link
Contributor

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 ?

Copy link
Contributor Author

@0xc0170 0xc0170 Oct 18, 2021

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

Copy link
Contributor Author

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.


# From needs: review to needs: work - CI failure
# From needs: CI to needs: work - CI failure
- name: "label needs: work when Jenkins CI failed - any of the pipeline"
conditions:
# Jenkins CI failing - any of the pipeline
- check-failure~=^jenkins-ci
- "label=needs: CI"
- "label!=mergify skip"
actions:
label:
add: ['needs: work']
remove: ['needs: review', 'needs: CI']
remove: ['needs: CI']
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here ?

Copy link
Contributor Author

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.


# From needs: review or needs: work to needs: CI. One approval means we should be good to start CI
- name: "label needs: CI when at least one reviewers approval"
Expand Down