Repository navigation
WIP: FOR REVIEW: Generate the migration guides from per-change migration records - #7133
hjmjohnson wants to merge 5 commits into
Conversation
0571025 to
0e3c9a0
Compare
|
Force-push |
0e3c9a0 to
752d930
Compare
|
Force-push |
|
Force-push |
752d930 to
ad304e9
Compare
ad304e9 to
4ff2902
Compare
|
Force-push
|
4ff2902 to
14dbe40
Compare
|
Force-push |
14dbe40 to
18016e7
Compare
|
Force-push |
|
@greptile review |
This comment has been minimized.
This comment has been minimized.
5d5405e to
4d00fe1
Compare
|
Force-push |
|
Force-push |
4d00fe1 to
583f099
Compare
|
Force-push |
583f099 to
d459af4
Compare
Each downstream-visible change gets one YAML record, so no PR edits a shared guide file (issue InsightSoftwareConsortium#7131). Documentation/AI/migration-records.md says when a record is needed and how to write one, for contributors and agents alike. The JSON Schema is the single definition of every field and of the impact rubric; _template.yaml is generated from it.
MigrationRecords.py validates records, generates the guide pages, writes _template.yaml from the schema, and assigns records to a release. Sphinx loads it as an extension; SetupForDevelopment and a pre-commit hook write the same pages to the git-ignored migration_guides/generated/. Validation is advisory: findings print, and only ITK_MIGRATION_RECORDS_STRICT=1 makes errors fail. Fixture tests run in the pre-commit workflow.
The guides are now generated from records into migration_guides/generated/, which the index points to. The hand-written guides keep their content, gain a frozen note, and leave the docs build. Open PRs that append to them still rebase cleanly; a cleanup PR converts late additions and deletes the files.
Each section of the frozen ITK 6 and ITK 5 guides and the two ITK 6 topic guides becomes one or more records: 51 in itk6/ and 41 in itk5/. The words are the originals, moved into fields without rewriting; a record split from a catch-all section starts with that section's heading in bold. Each record keeps the original PR and commits, and releases.yaml lists the first tag containing them; 42 ITK 6 records are not yet in a tag.
Snapshots of the guides generated from the records, so reviewers can read the result on GitHub without building the docs. Not kept up to date and excluded from the docs build; drop this commit before merge. The ITK 6 draft exceeds the 100 kB file limit, so .gitattributes raises it for *_DRAFT.md only.
|
Force-push |
d459af4 to
dc6c7e9
Compare
WIP: FOR REVIEW. This is a full working implementation of #7131, so the design can be judged by its real output. Each change adds one small YAML migration record, and the docs build generates the migration guides from them. No PR edits a shared guide file again.
The generated guides are in this PR's Read the Docs preview, and as raw snapshots for review on GitHub:
itk_6_migration_guide_DRAFT.mdanditk_5_migration_guide_DRAFT.md. Criticism of the records' content, and of the layout and ranking, is the point of this draft.Commits
DOC:Document migration records.Documentation/AI/migration-records.mdis the one guide, for contributors and agents. It covers when a change needs a record and how to write one._template.yamlis generated from it.AGENTS.md, a checklist line inpull-requests.md, and a link from the contributing docs.ENH:Generate the migration guides from records.Utilities/Maintenance/MigrationRecords.pyhas four subcommands:validate,generate,template, andrelease. It is also the Sphinx extension that builds the guide pages.migration_guides/generated/.SetupForDevelopment.shgenerates the pages once, and its version is bumped to 13 so existing clones rerun it. The release checklist gains a step that assigns records to the new release.DOC:Freeze the hand-written guides. Their old URLs redirect to the generated pages. They keep their content, gain a "frozen" note, and leave the docs build. Open PRs that append to them still rebase cleanly (11 of 33 open PRs touchmigration_guides/). A later cleanup PR converts late additions and deletes the files.DOC:Convert the existing entries into records.itk6/and 41 initk5/. Catch-all sections are split into one record per change, and each split record starts with its section's heading in bold.releases.yamlmanifests come fromgit tag --containson each record's commit. 42 ITK 6 records are in no tag yet and show as Unreleased.WIP:Snapshots of the generated guides (*_DRAFT.md), for review on GitHub only. They are excluded from the docs build and not kept up to date. Drop this commit before merge.Record format
The file is
records/itk<N>/YYYYMMDD_<Descriptor>.yaml, and the descriptor is the record's ID and anchor. Every field is optional, so{}is valid. The fields are:title,summary,details,actions;categories(what changed) andenvironment(where to act);impact:high,medium, orlow, rated with the rubric in the schema;pr, andcommits: the commit that introduced the change first, then follow-up fixes appended over time;deprecated_in,removed_in,legacy_guard;renamesand before/afterexamples.hints: freeform pointers for people and agentic tools doing the migration, such as scripts inUtilities/Maintenance/orsed/grepcommands. They are not shown in the guide.Markdown fields are limited to the subset that renders the same on GitHub and in MyST. Releases live in
releases.yaml, written only byMigrationRecords.py release, and unlisted records appear under "Unreleased".Validation is advisory
The hook prints suggestions and never blocks.
ITK_MIGRATION_RECORDS_STRICT=1makes errors fail, for anyone who opts in. Schema checks use thejsonschemalibrary (the engine behindcheck-jsonschema) and style checks useyamllint, both inside one local hook. That keeps both advisory; a standalonecheck-jsonschemaoryamllinthook would block commits.Open questions for review
main, because the old guide's heading warnings are gone. The generated pages add only two inherited CMake highlighting warnings, from...placeholders in example code.migration_guides/index.mdbecause it describes a mechanism, not a migration.🤖 Generated with Claude Code