From 618d166af02511f391750b774014ce361cf49467 Mon Sep 17 00:00:00 2001 From: Yuriy Andamasov Date: Tue, 12 May 2026 15:51:18 +0300 Subject: Use single `invalid-title` label for both title and commit-message rules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The two PR-message-format rules check the same `T: ` headline regex against two surfaces — the PR title and each commit's first line. Splitting that into two labels (`invalid-title` + `invalid-commit-title`) creates near-identical labels on the same PR and adds no information for the author: the fix in both cases is "rewrite the headline to match the format." Collapse onto `invalid-title`. The two rules stay separate so an operator scanning rule logs can still see which surface tripped, but the user-facing surface gets one label. 🤖 Generated by [robots](https://vyos.io) --- .mergify.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.mergify.yml b/.mergify.yml index c92ed52..af2f0b7 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -84,7 +84,11 @@ pull_request_rules: description: > Each commit's first line must match `T: `, optionally prefixed with `scope: `. Replaces the commit-message half of - vyos/.github:check-pr-message.yml. + vyos/.github:check-pr-message.yml. Shares the `invalid-title` label + with the title rule — both surfaces fail the same headline regex, so + splitting into two labels (`invalid-title` + `invalid-commit-title`) + was noise; the rule name still tells the operator which surface + tripped. conditions: - '-closed' - '-merged' @@ -92,7 +96,7 @@ pull_request_rules: actions: label: toggle: - - invalid-commit-title + - invalid-title commands_restrictions: backport: &allowed -- cgit v1.2.3 From 890a3692374d590c69823f685569987b40e3aab6 Mon Sep 17 00:00:00 2001 From: Yuriy Andamasov Date: Tue, 12 May 2026 16:02:48 +0300 Subject: Collapse title and commit-message checks into one toggle rule MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous revision of this PR moved both rules' `toggle` action to the same `invalid-title` label but kept them as two separate rules. That has a structural conflict: each `toggle` rule fires in both directions on every evaluation (add when condition true, remove when false). When the title conforms but a commit doesn't (or vice versa), the two rules issue conflicting add/remove operations on the same label — order-dependent and likely to flap. Mergify's `toggle` docs frame the action as a single-rule pattern that subsumes the earlier two-rule "add on match / remove on inverse" idiom (mergify changelog 2022-11-15). Using `toggle` on two rules pointing at the same label is outside the documented use case. Collapse the title-check condition and the commit-message-check condition into one rule with an `or`-combined condition. One rule, one label, one toggle — no conflict. The diagnostic separation between "title failed" vs "commits failed" was already given up when the label was unified; the rule description still lists both surfaces so an operator reading the rule log knows what to look at. 🤖 Generated by [robots](https://vyos.io) --- .mergify.yml | 42 +++++++++++++++++------------------------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/.mergify.yml b/.mergify.yml index af2f0b7..0fe7ac1 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -46,9 +46,9 @@ pull_request_rules: - conflicts # ------------------------------------------------------------------ - # PR-message format rules — replaces vyos/.github:check-pr-message.yml + # PR-message format rule — replaces vyos/.github:check-pr-message.yml # - # Title and every commit's first line must follow: + # PR title AND every commit's first line must follow: # [optional `scope: ` prefix] T: # Examples: # T99999: make IPsec secure @@ -63,36 +63,28 @@ pull_request_rules: # — equivalent to the original GHA's `messageHeadline` check. # # Because `commits[*]` returns true if ANY commit matches, and there is no - # `!~=` operator, the commit-message rule uses a negative-lookahead regex + # `!~=` operator, the commit-message half uses a negative-lookahead regex # that matches when at least one commit's first line does NOT conform. + # + # Title and commit-message checks live in a single rule with an `or` + # condition so a single `toggle: invalid-title` action manages the label + # in both directions. Two separate `toggle` rules pointing at the same + # label would issue conflicting add/remove operations when one surface + # conforms and the other does not (mergify#4 review): Mergify's `toggle` + # docs frame the action as a single-rule pattern that subsumes the + # earlier two-rule add/remove-with-inverse-conditions idiom. # ------------------------------------------------------------------ - - name: Flag PR title not matching T-ID format + - name: Flag T-ID format violation in PR title or commit messages description: > - PR title must be `T: `, optionally prefixed with `scope: `. - Replaces the title half of vyos/.github:check-pr-message.yml. + PR title and every commit's first line must match `T: `, + optionally prefixed with `scope: `. Replaces vyos/.github:check-pr-message.yml. conditions: - '-closed' - '-merged' - - '-title~=^(([a-zA-Z0-9\-_.]+:\s)?)T\d+:\s+[^\s]+.*' - actions: - label: - toggle: - - invalid-title - - - name: Flag commit message not matching T-ID format - description: > - Each commit's first line must match `T: `, optionally - prefixed with `scope: `. Replaces the commit-message half of - vyos/.github:check-pr-message.yml. Shares the `invalid-title` label - with the title rule — both surfaces fail the same headline regex, so - splitting into two labels (`invalid-title` + `invalid-commit-title`) - was noise; the rule name still tells the operator which surface - tripped. - conditions: - - '-closed' - - '-merged' - - 'commits[*].commit_message~=^(?!(([a-zA-Z0-9\-_.]+:\s)?)T\d+:\s+[^\s]+).*' + - or: + - '-title~=^(([a-zA-Z0-9\-_.]+:\s)?)T\d+:\s+[^\s]+.*' + - 'commits[*].commit_message~=^(?!(([a-zA-Z0-9\-_.]+:\s)?)T\d+:\s+[^\s]+).*' actions: label: toggle: -- cgit v1.2.3