Skip to content

DOC: State the release-branch merge-forward rules for agents - #7233

Merged
hjmjohnson merged 1 commit into
InsightSoftwareConsortium:mainfrom
hjmjohnson:doc-release-branches
Nov 25, 2026
Merged

hjmjohnson merged 1 commit into
InsightSoftwareConsortium:mainfrom
hjmjohnson:doc-release-branches

Conversation

@hjmjohnson

Copy link
Copy Markdown
Member

Write down the release-branch merge-forward rules (release-X.X → release → main, each by --no-ff merge) in one place agents load, with git checks that print nothing when the branches conform. Adds Documentation/AI/release-branches.md, an AGENTS.md route, the cherry-pick path Release.md already allows to the contributing guide, and a post-release check step in Release.md.
Merge danger: two-way door; documentation only.

Not yet conformant: three release-5.4 commits have not been merged forward. Two follow-up merge PRs, one at a time, are listed below; this PR does not perform them.

Shape of the change
AGENTS.md                                  + route: backports / release branches -> release-branches.md
Documentation/AI/release-branches.md       + new: branch table, where a fix starts, merge-forward rules,
                                               conformance checks, Agent defaults
Documentation/docs/contributing/index.md   + cherry-pick path for fixes already on main;
                                               when steps 3-4 happen; conflict rule; link
Documentation/Maintenance/Release.md       + after an older-series patch release: merge forward, run checks

The rules come from the existing docs and from the #5339 review threads (dzenanz: resolve conflicts "soon after the commits which cause them have been integrated"; thewtex: keep "master, release, release-X.X branches connected"). The "conflicts resolve to main's newer form" rule is the one #7155 applied to all ten of its conflicts.

Current state, from the checks in release-branches.md

Run 2026-11-24 against upstream:

Check Result
upstream/release..upstream/release-5.4 3 commits
upstream/main..upstream/release empty
upstream/main..upstream/release-5.4 the same 3 commits
upstream v5.4* and v6* tags not ancestors of main (18 checked) none

The three commits:

Follow-up PRs to restore conformance (one at a time)
  1. Merge release-5.4 into release. A git merge-tree dry run conflicts in 7 files: Wrapping/Generators/CastXML/CMakeLists.txt and the CMakeLists.txt of GPUCommon (plus its wrapping/), GPUFiniteDifference, GPUAnisotropicSmoothing, GPUImageFilterBase, and GPUSmoothing. These are the 5.4 forms of COMP: Bump validated CMake policies version to 4.5.0 #7219's policy fixes and the 5.4 CastXML pin; release (6.0b02 line) already has its own forms, so each should resolve to release's version unless it lacks the change. The PR lists each conflict and resolution.
  2. Merge release into main, after step 1 merges. A dry run of release-5.4 straight into main conflicts in 4 files (CastXML, GPUCommon and its wrapping/, and Modules/Numerics/FEM/CMakeLists.txt, deleted on main), all expected to resolve to main. Then git diff upstream/main HEAD should show nothing beyond what release adds.
  3. Re-run the checks. All four print nothing once both merges land.

Each follow-up is opened only when a release manager asks for it, per the page's Agent defaults.

Evidence
  • The four conformance commands were run as written in the new page; output is the table above.
  • Dry runs: git merge-tree --write-tree --name-only --messages upstream/release upstream/release-5.4 and the same against upstream/main.
  • pre-commit run --all-files passes, including the prose-budget hook with ITK_AI_AGENT=1.

Not checked: the docs site build (the contributing page links the new file by its GitHub URL, as it already does for migration-records.md).

AI assistance

Maintenance branches reach main by merge, release-X.X into release into
main, so release tags stay ancestors of main and conflicts are resolved
while small. The rules were split between contributing/index.md and
Release.md, and agents had no entry point, so a backport could stop at
the cherry-pick.

Add Documentation/AI/release-branches.md with the branch-start table,
the merge-forward rules, and git checks that print nothing when the
branches conform, and route to it from AGENTS.md. In contributing, add
the cherry-pick path Release.md already allows and when to merge forward.
@github-actions github-actions Bot added type:Documentation Documentation improvement or change area:Documentation Issues affecting the Documentation module labels Nov 24, 2026

@dzenanz dzenanz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good.

@dzenanz
dzenanz requested a review from thewtex November 24, 2026 17:09
@hjmjohnson
hjmjohnson marked this pull request as ready for review November 24, 2026 18:37
@greptile-apps

greptile-apps Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The guidance reaches contributors, agents, and release managers working on maintenance branches.

This documentation-only PR appears safe to merge, with non-blocking corrections recommended for the checks and conflict instructions.

Findings

  1. P2 Checks hide missing merges ▶
  2. P2 First merge targets wrong branch ▶
  3. P2 Tag check uses local targets ▶

Summary

Documents the merge path from older maintenance branches through release to main.

  • Release guidance now shows how maintenance fixes reach main.

hjmjohnson explicitly acknowledges the three outstanding commits from release-5.4 and defers their merges to separate, maintainer-requested PRs.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A["release-X.X"] -->|"Separate PR; git merge --no-ff"| B["release"]
  B -->|"Separate PR; git merge --no-ff"| C["main"]
Loading

Reviews (1) · Last reviewed commit: "DOC: State the release-branch merge-forw..." · Reviewed by Greptile

Comment on lines +58 to +60
git log --oneline --no-merges upstream/release..upstream/release-5.4
git log --oneline --no-merges upstream/main..upstream/release
git log --oneline --no-merges upstream/main..upstream/release-5.4

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Checks hide missing merges

--no-merges hides commits these checks need to catch. If a topic reaches both branches through separate merges, the maintenance branch can still have an unmerged merge commit while these commands print nothing. A fix made while resolving that merge can also be missed.

Remove --no-merges, or check each maintenance branch tip with git merge-base --is-ancestor and print failures.

Suggested change
git log --oneline --no-merges upstream/release..upstream/release-5.4
git log --oneline --no-merges upstream/main..upstream/release
git log --oneline --no-merges upstream/main..upstream/release-5.4
git log --oneline upstream/release..upstream/release-5.4
git log --oneline upstream/main..upstream/release
git log --oneline upstream/main..upstream/release-5.4

Comment on lines +41 to +44
- A conflict where `main` already holds the fix in a newer form resolves to
`main`'s version. After resolving, `git diff upstream/main HEAD` shows only
what the maintenance branch adds (release notes, a version-specific
change); anything else is a resolution error.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 First merge targets wrong branch

During release-X.X → release, main is not the destination and can contain newer development that must stay out of release. Comparing that result with upstream/main also shows legitimate development differences, not just resolution errors. The contributing guide repeats this guidance.

Use release's form and compare against upstream/release for the first step. Reserve the current guidance for release → main.

Comment on lines +61 to +66
for t in $(git ls-remote --tags --refs upstream 'v5.4*' 'v6*' | sed 's#.*refs/tags/##'); do
git merge-base --is-ancestor "$t" upstream/main || echo "$t"
done
```

Use upstream's tags, as above; a stale local tag gives a false report.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Tag check uses local targets

The loop checks local tags despite the warning below it. git ls-remote supplies upstream names, but the command discards their object IDs and resolves "$t" locally. If a local tag differs, git fetch --tags refuses to replace it. The block then continues and checks the stale tag, which can report the wrong ancestry result.

Fetch upstream tags into a separate namespace and check those refs, or stop on fetch failure and explain how to resolve a tag mismatch.

@hjmjohnson
hjmjohnson merged commit 80e547a into InsightSoftwareConsortium:main Nov 25, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Documentation Issues affecting the Documentation module type:Documentation Documentation improvement or change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants