Skip to content

[backport] ci(Mergify): configuration update (#588) #592

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

Merged
merged 1 commit into from
Dec 30, 2024
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
187 changes: 67 additions & 120 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -1,133 +1,80 @@
pull_request_rules:
# All conditions must be true before an action will be done
# For automerge and automerge-squash, if the PR is in conflict with the base branch, even if all conditions are true, the PR will not be merged
# Automerge and automerge-squash will also autorebase

- name: Automatic merge to main branch
- name: Ping PR author when conflicting
description: Warn the pull request author when their PR are conflicting
conditions:
# True if the base branch is main
- base=main
# check-success are true if the check ran successfully
- "check-success=Shellcheck"
- "check-success=Lint"
- "check-success=Codegen"
- "check-success=Mocks"
- "check-success=Chart checks"
- "check-success=Go build"
- "check-success=Go test"
- "check-success=Test various Sidecar + SMI configuration scenarios"
- "check-success=Integration Test with Tresor, SMI traffic policies, and egress disabled"
- "check-success=Go test e2e (1)"
- "check-success=Go test e2e (2)"
- "check-success=Go test e2e (3)"
- "check-success=Go test e2e (4)"
- "check-success=Go test e2e (5)"
- "check-success=Go test e2e (6)"
- "check-success=Go test e2e (7)"
- "check-success=Go test e2e (8)"
- "check-success=Go test e2e (9)"
- "check-success=Go test e2e (10)"
- "check-success=DCO"
# True if the PR has at least 2 approving reviews
- "#approved-reviews-by>=2"
# True if the PR has the automerge label
- label=automerge
# True if the PR does not have the wip label
- -label=wip
# True if the PR does not have the do-not-merge/hold label
- -label=do-not-merge/hold
- conflict
- -closed
actions:
merge:
# Currently we merge PRs by creating a merge commit
method: merge

- name: Automatic squash to main branch
comment:
message: >
👋 {{author}} your PR is conflicting and needs to be updated to be
merged
- name: Automatic squash and merge when CI passes and reviews approve
conditions:
# True if the base branch is main
- base=main
# check-success are true if the check ran successfully
- "check-success=Shellcheck"
- "check-success=Lint"
- "check-success=Codegen"
- "check-success=Mocks"
- "check-success=Chart checks"
- "check-success=Go build"
- "check-success=Go test"
- "check-success=Test various Sidecar + SMI configuration scenarios"
- "check-success=Go test e2e (1)"
- "check-success=Go test e2e (2)"
- "check-success=Go test e2e (3)"
- "check-success=Go test e2e (4)"
- "check-success=Go test e2e (5)"
- "check-success=Go test e2e (6)"
- "check-success=Go test e2e (7)"
- "check-success=Go test e2e (8)"
- "check-success=Go test e2e (9)"
- "check-success=Go test e2e (10)"
- "check-success=Integration Test with Tresor, SMI traffic policies, and egress disabled"
- "check-success=DCO"
# True if the PR has at least 2 approving reviews
- "#approved-reviews-by>=2"
# True if the PR has the automerge label
- label=automerge-squash
# True if the PR does not have the wip label
- or:
- base=main
- base~=^release\/v
- check-success=DCO
- check-success=Shellcheck
- check-success=Lint
- check-success=Codegen
- check-success=Go build
- check-success=Mocks
- check-success=Chart checks
- check-success=Go test
- check-success=Scan images for security vulnerabilities
- check-success=Integration Test with Tresor, SMI traffic policies, and egress disabled
- check-success=Go mesh test e2e (1)
- check-success=Go mesh test e2e (2)
- check-success=Go mesh test e2e (3)
- check-success=Go mesh test e2e (4)
- check-success=Go mesh test e2e (5)
- "check-success=Go mesh test e2e (v1.19.16, Test traffic flowing from client to server with a Kubernetes Service for the Source: HTTP)"
- "check-success=Go mesh test e2e (v1.27.11, Test traffic flowing from client to server with a Kubernetes Service for the Source: HTTP)"
- check-success=Go gateway test e2e (6)
- check-success=Go gateway test e2e (v1.19.16, Test traffic from client to backend service routing by FSM Gateway)
- check-success=Go gateway test e2e (v1.21.14, Test traffic from client to backend service routing by FSM Gateway)
- check-success=Go gateway test e2e (v1.23.17, Test traffic from client to backend service routing by FSM Gateway)
- check-success=Go ingress test e2e (7)
- check-success=Go statefulset test e2e (8)
- check-success=Go retry test e2e (9)
- "#approved-reviews-by >= 1"
- label=auto-squash
- -label=wip
# True if the PR does not have the do-not-merge/hold label
- -label=do-not-merge/hold
actions:
merge:
# Squashes commits then merges PR
method: squash

- name: Automatic merge to release branch
- name: Rebase pull request when it's more than 3 commits behind main
conditions:
# True if the base branch has release-
- base~=^release-
# check-success are true if the check ran successfully
- "check-success=Shellcheck"
- "check-success=Lint"
- "check-success=Codegen"
- "check-success=Mocks"
- "check-success=Chart checks"
- "check-success=Go build"
- "check-success=Go test"
- "check-success=Test various Sidecar + SMI configuration scenarios"
- "check-success=Go test e2e (1)"
- "check-success=Go test e2e (2)"
- "check-success=Go test e2e (3)"
- "check-success=Go test e2e (4)"
- "check-success=Go test e2e (5)"
- "check-success=Go test e2e (6)"
- "check-success=Go test e2e (7)"
- "check-success=Go test e2e (8)"
- "check-success=Go test e2e (9)"
- "check-success=Go test e2e (10)"
- "check-success=Integration Test with Tresor, SMI traffic policies, and egress disabled"
- "check-success=DCO"
# True if the PR has at least 2 approving reviews
- "#approved-reviews-by>=2"
# True if the PR has the automerge label
- label=automerge
# True if the PR does not have the wip label
- -label=wip
# True if the PR does not have the do-not-merge/hold label
- -label=do-not-merge/hold
- base = main
- "#commits-behind >= 3"
actions:
merge:
# Currently we merge PRs by creating a merge commit
method: merge

- name: Automatic rebase
rebase:
- name: Add a label auto-squash to the PR automatically
conditions: []
actions:
label:
add:
- auto-squash
- name: Label conflicting pull requests
description: Add a label to a pull request with conflict to spot it easily
conditions:
# True if the PR has any of the following labels
- or:
- label=automerge
- label=autorebase
- label=automerge-squash
# True when the PR is not conflicting with the base branch
- -conflict
# True if the PR is not in draft state
- -draft
- conflict
- -closed
actions:
rebase:
# Mergify will use any FSM user that's logged into the Mergify dashboard for the rebasing
label:
toggle:
- conflict
merge_protections:
- name: Enforce conventional commit
description: Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
if:
- or:
- base=main
- base~=^release\/v
success_conditions:
- "title ~= ^(\\[wip\\]|\\[backport\\]|\\[cherry-pick\\])?(
)?(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\\(.+\
\\))?:"

Loading