Skip to content

feat(close): auto-close PRs targeting EOL release branches (sagitta, crux, circinus) - #13

Merged
andamasov merged 1 commit into
productionfrom
feature/auto-close-eol-branches
May 28, 2026
Merged

andamasov merged 1 commit into
productionfrom
feature/auto-close-eol-branches

Conversation

@andamasov

Copy link
Copy Markdown
Member

Summary

Adds a Mergify pull_request_rules entry that closes every PR (including Mergify-created backports) opened against the EOL release branches sagitta, crux, and circinus in any vyos/* repo extending this config, with two excluded repos.

Replaces vyos/vyos-1x:.github/workflows/pr-auto-close.yml (sagitta-only, per-repo GHA) with a central Mergify rule covering all three EOL branches across the fleet.

What changes

  • New rule Auto-close PRs targeting EOL release branches under pull_request_rules:.
  • Action: close with a single explanatory message.
  • Conditions: base in (sagitta, crux, circinus) AND repository-name != vyos-documentation AND repository-name != vyos.vyos, with -closed / -merged guards.

Exclusion rationale

Repo Why excluded
vyos-documentation Still actively backports per-branch docs maintenance to sagitta and circinus.
vyos.vyos Ansible Galaxy collection on main; listed defensively so a future branch named sagitta / crux / circinus would not be silently auto-closed.

Mergify mechanics verified

Backport interaction

defaults.actions.backport (unchanged) still creates backport PRs targeting whatever branch a Maintainer requests. If a Maintainer issues @Mergifyio backport sagitta on a non-excluded vyos/* repo, the backport PR is created and then immediately closed by this rule — the intended behavior, since backports to EOL branches are not accepted.

vyos-documentation continues to honor @Mergifyio backport sagitta circinus exactly as before.

Follow-up

After this lands, the original vyos/vyos-1x:.github/workflows/pr-auto-close.yml on the sagitta branch becomes redundant and should be removed in a separate PR against vyos/vyos-1x:sagitta.

Test plan

  • Mergify Configuration-changed check passes on this PR.
  • After merge, open a test PR against vyos/<any-repo>:sagitta (e.g. on vyos-1x) and confirm it is closed automatically with the expected message.
  • Open a test PR against vyos/vyos-documentation:sagitta and confirm it is NOT closed (exclusion holds).
  • Repeat for circinus and crux where branches exist.

🤖 Generated by robots

Add a `pull_request_rules` entry that closes every PR (and Mergify-
created backport) opened against the EOL release branches `sagitta`,
`crux`, or `circinus` in any vyos/* repo extending this config.

Excludes vyos-documentation (still accepts per-branch docs backports
to sagitta and circinus) and vyos.vyos (Ansible Galaxy collection
on `main`; listed defensively).

Replaces vyos/vyos-1x:.github/workflows/pr-auto-close.yml, which only
covered sagitta. Centralizing in Mergify removes per-repo workflow
drift and extends coverage to crux and circinus.

Uses Mergify's `repository-name` condition attribute (bare repo name,
no org prefix) — unambiguous because this central config is consumed
only by vyos/* repos via `extends: mergify`.
@coderabbitai

coderabbitai Bot commented May 28, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 13079a53-c55c-4672-9395-5cf03e3cdb63

📥 Commits

Reviewing files that changed from the base of the PR and between 4ad9a97 and 761be4f.

📒 Files selected for processing (1)
  • .mergify.yml
📜 Recent review details
🧰 Additional context used
🔍 Remote MCP Context7

Verified Technical Details for PR Review

Based on Mergify documentation, the PR's implementation is technically sound:

Pull Request Rules & Close Action

The PR correctly uses the pull_request_rules section structure. The close action allows Mergify to automatically close pull requests when specified conditions are met, and the pull_request_rules section allows for workflow automation by defining rules that execute actions, where each rule must include a name and can have conditions and actions.

Guards (-closed / -merged)

The PR uses guards to avoid re-evaluating rules on already-closed/merged PRs. The -closed guard checks if the PR is not closed (i.e., open), using a leading '-' to negate the condition. This is standard practice for preventing duplicate rule executions.

Base Condition Syntax

The base condition uses the syntax base = main to target specific branches, which aligns with the PR's use of base in (sagitta, crux, circinus) to target EOL branches.

Repository-Name Attribute

The PR's exclusion mechanism is valid. The repository-name attribute is a string representing the short name of the current repository, without the organization name, and this attribute is available for use in conditions as the PR specifies with repository-name != vyos-documentation and repository-name != vyos.vyos.

Backport Interaction

The backport action automatically creates a backport of a merged pull request by creating a new pull request to merge changes into a specified base branch. The PR's statement that existing backport actions will create backport PRs which this rule will then close is technically accurate—the close rule will evaluate on these auto-created PRs.

🔇 Additional comments (1)
.mergify.yml (1)

176-221: AI summary incorrectly claims draft PRs are excluded.

The AI summary states the rule "applies to Mergify-created backports and non-draft pull requests", but the code has no -draft condition. The rule will close ALL PRs (including drafts) targeting sagitta, crux, or circinus in non-excluded repos.


The rule implementation itself is correct:

  • Guards (-closed, -merged) prevent re-evaluation ✓
  • or: block syntax matches existing pattern at line 124 ✓
  • repository-name exclusions validated by external tools context ✓
  • Backport interaction (lines 195-200) is intentional and documented ✓

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Added automatic closure of pull requests targeting end-of-life release branches upon merge or closure.

Walkthrough

This PR adds a single Mergify rule that automatically closes PRs targeting three end-of-life release branches (sagitta, crux, circinus) while excluding two specific repositories. The rule applies to Mergify-created backports and non-draft pull requests.

Changes

EOL Release Branch Auto-Close Rule

Layer / File(s) Summary
Auto-close rule for EOL release branches
.mergify.yml
Lines 176–221 introduce a new pull_request_rules entry named Auto-close PRs targeting EOL release branches. The rule targets PRs with base branches sagitta, crux, or circinus, applies to Mergify-created backport PRs, excludes vyos-documentation and vyos.vyos repositories, and automatically closes matching PRs with a fixed message.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Title directly describes the main change: adding auto-close functionality for PRs targeting three specific EOL branches.
Description check ✅ Passed Description is comprehensive and directly related to the changeset, covering the rule implementation, exclusion rationale, mechanics verification, and test plan.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feature/auto-close-eol-branches

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@andamasov
andamasov marked this pull request as ready for review May 28, 2026 10:17
@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

Actionable comments posted: 0

@andamasov
andamasov merged commit 51553b6 into production May 28, 2026
2 checks passed
natali-rs1985 pushed a commit to natali-rs1985/vyos-1x that referenced this pull request May 28, 2026
This workflow was a newer copy of the per-branch pr-auto-close.yml
files, with a branch filter targeting both sagitta and circinus.

It never actually fired: pull_request_target evaluates the workflow
from the PR's TARGET branch, not the default branch. PRs targeting
sagitta used .github/workflows/pr-auto-close.yml from the sagitta
branch; PRs targeting circinus used circinus's copy. The file on
current matched no events.

Functionality is now centralized in the Mergify config at vyos/mergify
(see PR vyos/mergify#13, merged). vyos/vyos-1x extends that baseline
via .github/mergify.yml on this branch.

Sibling cleanup of vyos#5228 (sagitta) and the parallel
PR removing circinus's copy.
@vyos-bot
vyos-bot Bot deleted the feature/auto-close-eol-branches branch July 9, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant