Skip to content

Enforce source-atomic release backports#142

Closed
justin808 wants to merge 1 commit into
mainfrom
codex/release-backport-policy
Closed

Enforce source-atomic release backports#142
justin808 wants to merge 1 commit into
mainfrom
codex/release-backport-policy

Conversation

@justin808

@justin808 justin808 commented Jul 12, 2026

Copy link
Copy Markdown
Member

Why

An aggregate release PR in shakacode/react_on_rails#4590 combined two independently merged source PRs. That erased the review, validation, rollback, and failure-attribution boundary that each backport should retain.

What changed

  • define one merged source PR per release-targeted backport PR as the default
  • require serial merges and branching each next backport from the refreshed release tip
  • make shared changelog edits a serialization reason, not a bundling reason
  • require dependency proof and a maintainer-approved exception for inseparable bundles
  • require explicit write authority to close an aggregate PR and separate authority to delete its branch
  • add contract assertions for source atomicity, refreshed-tip sequencing, exception approval, and close authority

Validation

  • bin/validate
  • ruby skills/pr-batch/bin/single_target_entrypoint_test.rb
  • rubocop skills/pr-batch/bin/single_target_entrypoint_test.rb
  • independent review and simplify passes: clean

The configured Codex review model was unavailable in the installed Codex version, so the required independent review fallback used Claude Opus 4.8 and every finding was resolved before this final clean pass.

Summary by CodeRabbit

  • Documentation

    • Added guidance for handling release backports as one source change per release pull request.
    • Documented serial backporting, release-branch tip refreshes, provenance tracking, and rollback boundaries.
    • Clarified when combining backports is prohibited or requires explicit approval and dependency justification.
    • Added procedures for replacing existing aggregate backport pull requests and closing them with authorization.
  • Tests

    • Added checks to validate source-atomic backports, serialized merges, shared-changelog handling, and approval requirements.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 06685b1a-f9f0-4734-b5a0-01239314ad57

📥 Commits

Reviewing files that changed from the base of the PR and between bf01346 and 2966a1d.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • docs/pr-batch-skills.md
  • skills/pr-batch/SKILL.md
  • skills/pr-batch/bin/single_target_entrypoint_test.rb
  • workflows/pr-processing.md

Walkthrough

Release backport guidance now requires source-atomic release PRs, serial processing, explicit exceptions for inseparable changes, preserved provenance, and authorization for aggregate PR closure. Contract tests verify the required wording across the batch skill, workflow, and guide.

Changes

Release backport policy

Layer / File(s) Summary
Release backport policy guidance
skills/pr-batch/SKILL.md, workflows/pr-processing.md, docs/pr-batch-skills.md, CHANGELOG.md
Documents one-source-per-release-PR backports, serialized release-line processing, bundling exceptions, provenance requirements, and aggregate PR handling.
Release backport contract checks
skills/pr-batch/bin/single_target_entrypoint_test.rb
Adds whitespace-normalized phrase matching and assertions for source-atomic backports, release-tip refreshes, shared-changelog serialization, and authorization requirements.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: enforcing source-atomic release backports.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/release-backport-policy

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2966a1d47b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

release-only divergence instead of replacing files with base-branch
post-images, and document every conflict resolution.

Before creating a release branch, search open release-targeted PRs for an

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Move the aggregate search before each backport branch

When backporting to an existing release line, agents normally create a short-lived backport branch/PR, not a new release branch; elsewhere in this section “release branch” means the target release line. Gating the aggregate-PR search on “creating a release branch” lets the intended duplicate/aggregate detection be skipped for normal backports, so please make the search happen before creating each backport branch/PR.

Useful? React with 👍 / 👎.

Comment thread skills/pr-batch/SKILL.md
Comment on lines +63 to +81
## Release Backport Granularity

When consumer policy selects merged base-branch work for a release branch,
default to **one merged source PR per release backport PR**. Give each source its
own target, lane, branch, validation, and release PR. Serialize work to the same
release line: merge one, refresh the release tip, then branch the next. Do not
combine independent sources because they share a destination, component,
milestone, or changelog. A shared changelog is a serialization reason, not a
bundling reason.

Combine only behaviorally inseparable sources that cannot be reviewed, tested,
or reverted safely alone; record the exact refs, dependency proof, and
maintainer-approved exception rationale first.
Use the consumer's cherry-pick/provenance method, preserve release-only
divergence, and stamp release notes after accepted backports.

If an aggregate backport PR already exists, do not keep extending it by default.
Recommend separate replacements; close the aggregate only with explicit write
authorization, and retain its branch unless branch deletion was also authorized.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section fully restates the "Release Backport Granularity" policy from workflows/pr-processing.md instead of cross-referencing it, which breaks the pattern this file already uses two sections below for the analogous "Release Phase Gate" policy (skills/pr-batch/SKILL.md:98-99: "follow the Release Phase Gate in the resolved pr-processing.md").

The restatement has already drifted from the canonical version in workflows/pr-processing.md:234-262:

  • It omits the source-eligibility checks from workflow.md step 1 (merged, belongs on the selected release line, not already present/superseded, independently validatable).
  • It omits the proactive "search open release-targeted PRs for an existing aggregate ... before creating a release branch" instruction — this version only reacts "if an aggregate backport PR already exists."
  • It says "close the aggregate only with explicit write authorization" without specifying who can grant it, whereas workflow.md and the guide both say "explicit user or maintainer authorization."

Since this is a safety policy meant to stop agents from re-creating the exact bundling mistake described in the PR description, an agent that only loads this SKILL.md (per the "entry point" note above) could miss the eligibility/search steps or misjudge who can authorize a close. Consider replacing this section with a short pointer to workflows/pr-processing.md#release-backport-granularity, matching the existing convention.

Comment thread docs/pr-batch-skills.md
Comment on lines +132 to +144
### Release backports

Use **one source PR -> one release PR** as the default backport shape. Process
multiple backports to the same release branch serially: merge one, refresh the
release tip, then branch the next. Do not bundle independent source PRs because
they share a release target or changelog file. Bundling requires an explicit
maintainer-approved exception with dependency proof showing the changes are
inseparable for review, testing, and rollback.

If a pending aggregate backport already combines independent sources, replace it
with separate lanes. Closing the aggregate is a GitHub write and still requires
explicit user or maintainer authorization; branch deletion is a separate action.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: unlike neighboring sections in this guide (e.g. the pause/cancellation links a few lines up), this new "Release backports" section doesn't link to the canonical detail in workflows/pr-processing.md (### Release Backport Granularity). Adding [Release Backport Granularity](../workflows/pr-processing.md#release-backport-granularity) would keep this guide consistent with its own established cross-linking convention and reduce the chance of the three copies of this policy (guide, SKILL.md, workflow.md) drifting apart — see the related comment on skills/pr-batch/SKILL.md.

Comment on lines +13 to +15
def includes_words?(text, phrase)
text.gsub(/\s+/, " ").include?(phrase)
end

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: includes_words? doesn't check "words" — it does whitespace-normalized substring containment (so it also matches phrases that only appear contiguous after collapsing newlines/indentation across unrelated list items or paragraphs). A name like includes_normalized? or includes_phrase? would better describe the behavior. Not a functional issue given the current assertions, just a readability nit for future additions to this file.

@claude

claude Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review Summary

What this PR does: Codifies a "source-atomic" release backport policy across skills/pr-batch/SKILL.md, workflows/pr-processing.md, and docs/pr-batch-skills.md — one merged source PR per release backport PR by default, serial merges from a refreshed release tip, a maintainer-approved-exception path for inseparable bundles, and explicit authority requirements before closing an aggregate backport PR or deleting its branch. Adds contract assertions in single_target_entrypoint_test.rb verifying the required phrases exist in each doc.

Verification: I manually traced every new assertion in single_target_entrypoint_test.rb against the corresponding text in SKILL.md, pr-processing.md, and the guide — all pass by inspection (couldn't execute ruby/rubocop directly in this sandbox, but the substring/phrase matches line up exactly with the diff).

Findings (posted inline)

  1. skills/pr-batch/SKILL.md — duplicated policy has already drifted from the canonical version. The new "Release Backport Granularity" section fully restates the policy instead of pointing to workflows/pr-processing.md (as this same file already does for the analogous "Release Phase Gate" two sections later). The restatement is missing the source-eligibility checks and the proactive "search for an existing aggregate before creating a release branch" step from the canonical version, and it drops the "user or maintainer" qualifier on close-authorization language. Since this policy exists specifically to stop the exact bundling mistake described in the PR body, an agent loading only SKILL.md could act on the incomplete copy.
  2. docs/pr-batch-skills.md — missing cross-link. The new "Release backports" section doesn't link to the canonical workflows/pr-processing.md#release-backport-granularity detail, unlike neighboring sections in the same guide that consistently cross-link out.
  3. Minor nit on the new includes_words? test helper name (does whitespace-normalized substring match, not word matching).

Other notes

  • No code/logic changes, no security or performance implications — this is a documentation/policy PR for AI agent instructions plus a text-contract test.
  • CHANGELOG entry is well-formed and consistent with the existing #### Changed conventions.
  • Test additions correctly cover each new policy phrase per file; the main gap is that the test only checks each file's text independently, so it wouldn't catch the cross-file drift noted in finding 1.

@justin808

Copy link
Copy Markdown
Member Author

Closing after a seam-placement review. Release-train backport granularity is currently React on Rails-specific policy and now lives in shakacode/react_on_rails#4592. Keeping the portable workflow pack consumer-neutral; this branch is intentionally retained.

@justin808 justin808 closed this Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant