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

ci(Mergify): enforce linear history #598

Merged
merged 2 commits into from
Dec 31, 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
75 changes: 40 additions & 35 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
pull_request_rules:
- name: Ping PR author when conflicting
description: Warn the pull request author when their PR are conflicting
conditions:
- conflict
- -closed
actions:
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:
- or:
Expand Down Expand Up @@ -39,7 +29,11 @@ pull_request_rules:
- check-success=Go statefulset test e2e (8)
- check-success=Go retry test e2e (9)
- "#approved-reviews-by >= 1"
- label=auto-squash
- or:
- and:
- label=ok-to-merge
- label=squash
- label=ok-to-squash
- -label=wip
- -label=do-not-merge/hold
actions:
Expand All @@ -51,33 +45,12 @@ pull_request_rules:
- "#commits-behind >= 3"
actions:
rebase:
- name: Add a label auto-squash to the PR automatically
conditions:
- -closed
- -label=wip
- -label=do-not-merge/hold
- -label=auto-merge
- -label=auto-rebase
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:
- conflict
- -closed
actions:
label:
toggle:
- conflict
- name: Backport features/patches to the release/v1.4 branch
conditions:
- base=main
- label = backport/v1.4
actions:
backport:
bot_account: reaver-flomesh
branches:
- "release/v1.4"
title: "[backport] {{ title }} (#{{ number }})"
Expand All @@ -89,7 +62,6 @@ pull_request_rules:
- label = backport/v1.3
actions:
backport:
bot_account: reaver-flomesh
branches:
- "release/v1.3"
title: "[backport] {{ title }} (#{{ number }})"
Expand All @@ -101,7 +73,6 @@ pull_request_rules:
- label = backport/v1.2
actions:
backport:
bot_account: reaver-flomesh
branches:
- "release/v1.2"
title: "[backport] {{ title }} (#{{ number }})"
Expand All @@ -113,12 +84,38 @@ pull_request_rules:
- label = cherry-pick/main
actions:
backport:
bot_account: reaver-flomesh
branches:
- main
title: "[cherry-pick] {{ title }} (#{{ number }})"
assignees:
- "{{ author }}"
- name: Ping PR author when conflicting and Label conflicting pull requests
description: Warn the pull request author when their PR are conflicting, and add a label to a pull request with conflict to spot it easily
conditions:
- conflict
- -closed
actions:
comment:
message: >
👋 {{author}} your PR is conflicting and needs to be updated to be merged
label:
toggle:
- conflicts
- name: Comment when a pull request has unverified commits
conditions:
- -closed
- "#commits-unverified > 0"
actions:
comment:
message: |
❗❗❗
All commits in this PR must be signed off.
Please sign all commits by:
```shell
git rebase HEAD~{{ commits | length }} --signoff
git push --force-with-lease origin {{ head }}
```
merge_protections:
- name: Enforce conventional commit
description: Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
Expand All @@ -138,4 +135,12 @@ merge_protections:
- base~=^release\/v
success_conditions:
- "#commits-unverified = 0"
- name: Enforce linear history
description: Make sure that we have a linear history, no merge commits are allowed
if:
- or:
- base=main
- base~=^release\/v
success_conditions:
- "linear-history"

Loading