ceph-csi/.mergify.yml
Niels de Vos 90fd12629f ci: use mergify to add labels to PRs
Adding labels to Pull-Requests can be done by Mergify. It is very useful
to filter PRs on their labels so that experts in certain areas can
identify PRs to review.

Adding labels is currently a complete manual process, this adds some
automation for it. There is no intention of it being complete, this is
mostly for getting started and trying things out.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
2021-05-05 17:53:13 +05:30

367 lines
10 KiB
YAML

---
defaults:
actions:
comment:
bot_account: ceph-csi-bot
merge:
bot_account: ceph-csi-bot
method: rebase
rebase_fallback: merge
strict: smart
strict_method: rebase
rebase:
bot_account: ceph-csi-bot
pull_request_rules:
- name: remove outdated approvals
conditions:
- base~=^(devel)|(release-.+)$
actions:
dismiss_reviews:
approved: true
changes_requested: false
- name: ask to resolve conflict
conditions:
- conflict
actions:
comment:
# yamllint disable-line rule:truthy
message: "This pull request now has conflicts with the target branch.
Could you please resolve conflicts and force push the corrected
changes? 🙏"
- name: automatic merge
conditions:
- label!=DNM
- base~=^(devel)|(release-.+)$
- "#approved-reviews-by>=2"
- "#changes-requested-reviews-by=0"
- "status-success=codespell"
- "status-success=multi-arch-build"
- "status-success=go-test"
- "status-success=golangci-lint"
- "status-success=gosec"
- "status-success=commitlint"
- "status-success=mod-check"
- "status-success=lint-extras"
- "status-success=ci/centos/mini-e2e-helm/k8s-1.19"
- "status-success=ci/centos/mini-e2e-helm/k8s-1.20"
- "status-success=ci/centos/mini-e2e/k8s-1.19"
- "status-success=ci/centos/mini-e2e/k8s-1.20"
- "status-success=ci/centos/upgrade-tests-cephfs"
- "status-success=ci/centos/upgrade-tests-rbd"
- "status-success=DCO"
actions:
merge: {}
dismiss_reviews: {}
delete_head_branch: {}
- name: automatic merge PR having ready-to-merge label
conditions:
- label!=DNM
- label=ready-to-merge
- base~=^(devel)|(release-.+)$
- "#approved-reviews-by>=1"
- "status-success=codespell"
- "status-success=multi-arch-build"
- "status-success=go-test"
- "status-success=golangci-lint"
- "status-success=gosec"
- "status-success=commitlint"
- "status-success=mod-check"
- "status-success=lint-extras"
- "#changes-requested-reviews-by=0"
- "status-success=ci/centos/mini-e2e-helm/k8s-1.19"
- "status-success=ci/centos/mini-e2e-helm/k8s-1.20"
- "status-success=ci/centos/mini-e2e/k8s-1.19"
- "status-success=ci/centos/mini-e2e/k8s-1.20"
- "status-success=ci/centos/upgrade-tests-cephfs"
- "status-success=ci/centos/upgrade-tests-rbd"
- "status-success=DCO"
actions:
merge: {}
dismiss_reviews: {}
delete_head_branch: {}
- name: backport patches to release v1.2.0 branch
conditions:
- base=devel
- label=backport-to-release-v1.2.0
actions:
backport:
branches:
- release-v1.2.0
# automerge backports if CI successfully ran
- name: automerge backport release-v1.2.0
conditions:
- author=mergify[bot]
- base=release-v1.2.0
- label!=DNM
- "#changes-requested-reviews-by=0"
- "#approved-reviews-by>=1"
- "status-success=continuous-integration/travis-ci/pr"
actions:
merge: {}
dismiss_reviews: {}
delete_head_branch: {}
- name: backport patches to release-v2.0 branch
conditions:
- base=devel
- label=backport-to-release-v2.0
actions:
backport:
branches:
- release-v2.0
# automerge backports if CI successfully ran
- name: automerge backport release-v2.0
conditions:
- author=mergify[bot]
- base=release-v2.0
- label!=DNM
- "#changes-requested-reviews-by=0"
- "#approved-reviews-by>=1"
- "status-success=continuous-integration/travis-ci/pr"
actions:
merge: {}
dismiss_reviews: {}
delete_head_branch: {}
- name: backport patches to release-v2.1 branch
conditions:
- base=devel
- label=backport-to-release-v2.1
actions:
backport:
branches:
- release-v2.1
# automerge backports if CI successfully ran
- name: automerge backport release-v2.1
conditions:
- author=mergify[bot]
- base=release-v2.1
- label!=DNM
- "#changes-requested-reviews-by=0"
- "#approved-reviews-by>=1"
- "status-success=continuous-integration/travis-ci/pr"
actions:
merge: {}
dismiss_reviews: {}
delete_head_branch: {}
- name: backport patches to release-v3.0 branch
conditions:
- base=devel
- label=backport-to-release-v3.0
actions:
backport:
branches:
- release-v3.0
# automerge backports if CI successfully ran
- name: automerge backport release-v3.0
conditions:
- author=mergify[bot]
- base=release-v3.0
- label!=DNM
- "#changes-requested-reviews-by=0"
- "#approved-reviews-by>=1"
- "status-success=continuous-integration/travis-ci/pr"
actions:
merge: {}
dismiss_reviews: {}
delete_head_branch: {}
- name: backport patches to release-v3.1 branch
conditions:
- base=devel
- label=backport-to-release-v3.1
actions:
backport:
branches:
- release-v3.1
# automerge backports if CI successfully ran
- name: automerge backport release-v3.1
conditions:
- author=mergify[bot]
- base=release-v3.1
- label!=DNM
- "#changes-requested-reviews-by=0"
- "#approved-reviews-by>=1"
- "status-success=multi-arch-build"
- "status-success=continuous-integration/travis-ci/pr"
- "status-success=ci/centos/mini-e2e-helm/k8s-1.19"
- "status-success=ci/centos/mini-e2e-helm/k8s-1.20"
- "status-success=ci/centos/mini-e2e/k8s-1.19"
- "status-success=ci/centos/mini-e2e/k8s-1.20"
- "status-success=ci/centos/upgrade-tests-cephfs"
- "status-success=ci/centos/upgrade-tests-rbd"
- "status-success=DCO"
actions:
merge: {}
dismiss_reviews: {}
delete_head_branch: {}
- name: backport patches to release-v3.2 branch
conditions:
- base=devel
- label=backport-to-release-v3.2
actions:
backport:
branches:
- release-v3.2
# automerge backports if CI successfully ran
- name: automerge backport release-v3.2
conditions:
- author=mergify[bot]
- base=release-v3.2
- label!=DNM
- "#approved-reviews-by>=1"
- "status-success=codespell"
- "status-success=multi-arch-build"
- "status-success=go-test"
- "status-success=golangci-lint"
- "status-success=gosec"
- "status-success=commitlint"
- "status-success=mod-check"
- "status-success=lint-extras"
- "#changes-requested-reviews-by=0"
- "status-success=ci/centos/mini-e2e-helm/k8s-1.19"
- "status-success=ci/centos/mini-e2e-helm/k8s-1.20"
- "status-success=ci/centos/mini-e2e/k8s-1.19"
- "status-success=ci/centos/mini-e2e/k8s-1.20"
- "status-success=ci/centos/upgrade-tests-cephfs"
- "status-success=ci/centos/upgrade-tests-rbd"
- "status-success=DCO"
actions:
merge: {}
dismiss_reviews: {}
delete_head_branch: {}
- name: backport patches to release-v3.3 branch
conditions:
- base=devel
- label=backport-to-release-v3.3
actions:
backport:
branches:
- release-v3.3
# automerge backports if CI successfully ran
- name: automerge backport release-v3.3
conditions:
- author=mergify[bot]
- base=release-v3.3
- label!=DNM
- "#approved-reviews-by>=1"
- "status-success=codespell"
- "status-success=multi-arch-build"
- "status-success=go-test"
- "status-success=golangci-lint"
- "status-success=gosec"
- "status-success=commitlint"
- "status-success=mod-check"
- "status-success=lint-extras"
- "#changes-requested-reviews-by=0"
- "status-success=ci/centos/mini-e2e-helm/k8s-1.19"
- "status-success=ci/centos/mini-e2e-helm/k8s-1.20"
- "status-success=ci/centos/mini-e2e/k8s-1.19"
- "status-success=ci/centos/mini-e2e/k8s-1.20"
- "status-success=ci/centos/upgrade-tests-cephfs"
- "status-success=ci/centos/upgrade-tests-rbd"
- "status-success=DCO"
actions:
merge: {}
dismiss_reviews: {}
delete_head_branch: {}
- name: remove outdated approvals on ci/centos
conditions:
- base=ci/centos
actions:
dismiss_reviews:
approved: true
changes_requested: false
- name: automatic merge on ci/centos
conditions:
- label!=DNM
- base=ci/centos
- "#approved-reviews-by>=2"
- "#changes-requested-reviews-by=0"
- "status-success=ci/centos/job-validation"
- "status-success=ci/centos/jjb-validate"
- "status-success=DCO"
actions:
merge: {}
dismiss_reviews: {}
delete_head_branch: {}
- name: automatic merge PR having ready-to-merge label on ci/centos
conditions:
- label!=DNM
- label=ready-to-merge
- base=ci/centos
- "#approved-reviews-by>=1"
- "#changes-requested-reviews-by=0"
- "status-success=ci/centos/job-validation"
- "status-success=ci/centos/jjb-validate"
- "status-success=DCO"
actions:
merge: {}
dismiss_reviews: {}
delete_head_branch: {}
##
## Automatically set/remove labels
##
- name: title contains DNM
conditions:
- title~=DNM
actions:
label:
add:
- DNM
- name: title contains CephFS
conditions:
- "title~=cephfs: "
actions:
label:
add:
- component/cephfs
- name: title contains RBD
conditions:
- "title~=rbd: "
actions:
label:
add:
- component/rbd
- name: title contains CI or testing
conditions:
- "title~=(ci)|(testing): "
actions:
label:
add:
- component/testing
- name: title contains Helm
conditions:
- title~=helm
actions:
label:
add:
- component/deployment
- name: title contains rebase
conditions:
- "title~=rebase: "
actions:
label:
add:
- rebase
- name: title indicates a bug fix
conditions:
- title~=(bug)|(fix)
actions:
label:
add:
- bug
- name: title contains cleanup
conditions:
- "title~=cleanup: "
actions:
label:
add:
- cleanup
- name: title contains doc
conditions:
- "title~=doc: "
actions:
label:
add:
- component/docs
- ci/skip/e2e