fix(renovate): stop behind-base rebases resetting the pr-cooldown clock - #287
Merged
Merged
Conversation
The pr-cooldown gate measures the soak from the PR branch head commit date. With automerge enabled, Renovate's default rebaseWhen (auto -> behind-base-branch) rebases gated PRs every time main advances, rewriting the head commit and resetting the 14-day cooldown forever on an active repo — defeating the soak introduced in #286 / ADR 0005. Set rebaseWhen: "conflicted" on the ghcr.io/lscr.io/quay.io rule so Renovate only rebases on real conflicts. Branch protection is non-strict (strict_required_status_checks_policy=false), so a behind-base gated PR still auto-merges once soaked without needing a rebase. Version bumps and conflict rebases still (correctly) restart the clock. Refs DevSecNinja/truenas-apps#115 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
pr-cooldowngate (#286 / ADR 0005) measures the 14-day soak from the PR branch head commit date. But with automerge enabled, Renovate's effectiverebaseWhenisbehind-base-branch(theautodefault resolves to this once automerge is on). So every timemainadvances, Renovate rebases each gated PR, rewrites the head commit with a fresh timestamp, and resets the cooldown clock. On an active repo the gated PRs would soak-reset forever and never merge — the exact perpetual-reset failure we set out to fix, moved from release-age to PR-age.Confirmed by the repo owner: "Rebasing: Whenever PR is behind base branch."
Fix
Add
rebaseWhen: "conflicted"to the ghcr.io/lscr.io/quay.io packageRule so Renovate only rebases on genuine merge conflicts. The head commit is then stable while the PR soaks, so the cooldown completes.This is safe because branch protection is non-strict (
strict_required_status_checks_policy: false): a behind-base gated PR still auto-merges oncepr-cooldownpasses — no rebase needed. Version bumps and conflict rebases still (correctly) restart the clock, since the merged content changed.ADR 0005 updated to document the requirement so it isn't reverted.
Validation
packageRules.json5parses as JSON5; ADR passesdprint check.Refs DevSecNinja/truenas-apps#115