Repository navigation
fix(release): publish notes in the agreed format - #198
Conversation
Put the notes in the agreed format: an intro linking the upgrade steps, then the sections Breaking changes, Features, Security, Documentation and Maintenance, with flat bullets that end with their issue and pull request numbers. The upgrade steps move to the Upgrading page; the compare link of our own is dropped, as the release workflow adds GitHub's generated notes. The TODO(#179) markers stay. Co-Authored-By: Claude Opus 5.5 <[email protected]>
scripts/release_notes.py checks the structure of curated notes (intro, allowed sections in order, bullets ending with issue and pull request numbers, no parts the workflow adds) and builds the release body from them and GitHub's generated notes, without their What's Changed header. release_version.py gets a previous command for the tag the generated notes start after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
With curated notes, the release body is now the curated notes, then GitHub's generated notes (generate-notes API, from the previous release in the history of the release commit; all changes for the first release), ending with the Full Changelog line. The release workflow, the Check release readiness job and the documented pre-tag steps check the notes' format besides the TODO check. Prerelease flags are unchanged. Closes #195 Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Fences close only on the same marker, at least as long; HTML comment lines count as blank; a byte order mark is ignored. - The checker is split into a state class with one method per kind of line. - Unexpected generated notes are kept with a warning instead of failing after the image is published; the What's Changed header is also dropped after a configuration comment. - A stable release without a stable predecessor starts its generated notes after the previous pre-release. - The previous release is a step output of its own (with pipefail). - Unreadable files give an error annotation. Co-Authored-By: Claude Opus 5.5 <[email protected]>
HTML comment lines inside or between bullets no longer count as the end of the bullet, and a comment pattern no longer spans text between two comments on one line. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideThis PR standardizes curated release-note structure, validates it across local and CI/release gates, assembles it with GitHub-generated notes using release-aware history, and updates the 0.3.0 documentation to match the new publishing format. Sequence diagram for assembling and publishing release notessequenceDiagram
participant Workflow as Release workflow
participant Version as release_version.py
participant GitHub as GitHub generate-notes API
participant Notes as release_notes.py
participant Release as GitHub release
Workflow->>Version: previous_tag
Version-->>Workflow: previous_tag
alt Curated notes exist
Workflow->>GitHub: generate-notes(tag_name, previous_tag_name)
GitHub-->>Workflow: generated body
Workflow->>Notes: body(curated, generated)
Notes->>Notes: check(curated)
Notes-->>Workflow: assembled release body
Workflow->>Release: create or edit with notes file
else No curated notes
Workflow->>Release: create with --generate-notes
Workflow->>Release: pass --notes-start-tag when available
end
Flow diagram for curated release-note validationflowchart TD
A[Curated release notes] --> B[release_notes.py check]
B --> C{Valid intro and ordered sections?}
C -- No --> D[Report validation errors]
C -- Yes --> E{Bullets have references and no generated sections?}
E -- No --> D
E -- Yes --> F[Allow CI and release workflow to continue]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #198 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 14 15 +1
Lines 959 1136 +177
==========================================
+ Hits 959 1136 +177 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
CodeQL flags the HTML comment pattern as a bad HTML filter. Lines are checked one by one, so a plain string check does the same and says so. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Hey - I've found 6 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="scripts/release_version.py" line_range="158-164" />
<code_context>
+ """
+ release = parse_tag(tag)
+ below = []
+ for other in tags:
+ try:
+ other_release = parse_tag(other)
+ except ValueError:
+ continue
+ if other_release.order < release.order:
+ below.append((other_release.stable, other_release.order, other))
+ if not below:
+ return None
</code_context>
<issue_to_address>
**Unpublished tags truncate release notes**
When a lower canonical version tag is in the release commit’s history, but its workflow did not create a GitHub release, `previous_tag` treats that tag as the preceding release and passes it as the start tag for generated notes. Changes merged since the last published release but before this tag are therefore omitted from the next release’s changelog.
Select the previous start tag from published releases, or otherwise ensure an unpublished prior tag cannot be treated as the previous release.
</issue_to_address>
### Comment 2
<location path="scripts/release_notes.py" line_range="224" />
<code_context>
+ " sections, and no rules",
+ )
+ )
+ elif self.heading_line == 0:
+ self.intro = self.intro or not blank
+ elif blank:
</code_context>
<issue_to_address>
**Non-prose preambles pass**
When the curated notes begin with a list or fenced code block and contain no prose before the first section, `_Checker._line` treats nonblank lines as an intro and `_Checker._code` marks an opening fence as one, so `check` accepts the notes and the release gates allow them through to publication without the required introductory paragraph.
Require a prose paragraph before the first section, and do not count list items or fenced code as the intro.
Also at `scripts/release_notes.py:225`, `scripts/release_notes.py:255-256`.
</issue_to_address>
### Comment 3
<location path="scripts/release_notes.py" line_range="225" />
<code_context>
+ )
+ )
+ elif self.heading_line == 0:
+ self.intro = self.intro or not blank
+ elif blank:
+ if self.item:
</code_context>
<issue_to_address>
**Upgrade links pass unchecked**
When curated notes have upgrade steps but their intro has no link to them, `_Checker._line` marks any nonblank intro text as present, without checking for a link. Release notes with upgrade steps but no link therefore pass the format gate and can be published without the required route to those steps.
Validate the required upgrade link in the intro, or otherwise ensure the format gate checks it when upgrade steps exist.
</issue_to_address>
### Comment 4
<location path="scripts/release_notes.py" line_range="200" />
<code_context>
+ number: Number of the line.
+ line: Text of the line.
+ """
+ if line.lstrip().startswith(FULL_CHANGELOG):
+ self.findings.append(
+ Finding(
</code_context>
<issue_to_address>
**Valid examples are rejected**
When a fenced example contains a line beginning with `**Full Changelog**`, `_Checker._line` records the `Full Changelog` finding before checking whether the line is inside a fenced code block, so the release-note gate rejects otherwise valid notes and blocks the release.
Check whether a line is inside a fenced code block before flagging the `Full Changelog` heading.
</issue_to_address>
### Comment 5
<location path="docs/development.md" line_range="124" />
<code_context>
python scripts/citation.py check X.Y.Z
python scripts/check_release_pins.py
! grep -n TODO docs/releases/X.Y.Z.md # curated notes, if any
+python scripts/release_notes.py check docs/releases/X.Y.Z.md # their format, if any
readme="$(mktemp -d)/README.md" && cp deployment/README.md "${readme}"
python scripts/chart_readme.py "${readme}" vX.Y.Z # links of the chart
</code_context>
<issue_to_address>
**Optional notes block tagging**
When a release has no curated-notes file, the documented pre-tag command runs `release_notes.py check` unconditionally, and it returns an error for the absent file, stopping the checklist before the tag can be created.
Run the format check only when the optional curated-notes file exists.
</issue_to_address>
### Comment 6
<location path="scripts/release_notes.py" line_range="69" />
<code_context>
+ITEM = re.compile(r"(?:[-*+]|[0-9]+[.)])(?:[ \t]|$)")
+# The end of a bullet: its issue and pull request numbers, e.g., `(#12, #34)`
+# (only the pull request's if it closes no issue)
+REFERENCES = re.compile(r".*\(#[0-9]+(?:[,;][ \t]*#[0-9]+)*\)", re.ASCII)
+
+BULLETS_ONLY = "Sections hold bullets only, e.g., - <change> (#12, #34)"
</code_context>
<issue_to_address>
**Malformed reference groups pass**
When a bullet ends with references separated or grouped contrary to the agreed pair format, `REFERENCES` accepts an arbitrary sequence of issue numbers separated by commas or semicolons, so endings such as `(#12; #34)` pass even though semicolons are meant to separate issue-and-PR pairs. The checker can therefore approve bullets that do not follow the agreed reference format.
Validate each ending as an allowed single PR reference or as one or more issue/PR pairs separated by semicolons.
</issue_to_address>Sourcery assessment
Needs a human reviewer. 6 findings to address first, and if the previous-tag selection or notes assembly is wrong, a release could publish an inaccurate notes body. That change is bounded and can be corrected by rerunning the workflow or editing the release; reverting the code alone would not undo notes already published.
Blocking findings: scripts/release_version.py:164, scripts/release_notes.py:224, scripts/release_notes.py:225, scripts/release_notes.py:200, docs/development.md:124, and 1 more
- The previous release for the generated notes is the previous published release, so changes of a tag whose release failed are listed in the next release. - Lists and code blocks alone are no intro paragraph. - Full Changelog lines in code blocks are not findings. - The documented pre-tag check runs only if curated notes exist. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
Release notes now follow the agreed format: intro (with a link to the upgrade steps), the grouped sections (
Breaking changes,Features,Security,Fixes,Documentation,Maintenance, empty ones left out, bullets ending with issue and PR numbers), then## Commitswith GitHub's generated notes (without## What's Changed), and last GitHub's**Full Changelog**line.scripts/release_notes.py(stdlib only):check <notes>checks the curated file's structure: an intro, only the allowed##sections, in order, each once and not empty, holding bullets only, each ending with(#issue, #PR)(several pairs separated by;), and no## Commitsor**Full Changelog**of its own.body <notes> <generated>builds the release body from the curated file and thebodyof GitHub'sgenerate-notesAPI. Generated notes in an unexpected format are kept as they are, with a warning, so that the publish job can't fail after the image is signed.scripts/release_version.py previous <tag>gives the tag the generated notes start after:generate-notesand assembles the body when there are curated notes. Without curated notes, it uses--generate-notesas before, now with--notes-start-tag.docs/development.md, which now also describe the format.docs/releases/0.3.0.mdis restructured with no content lost:TODO(#179)markers stay.Verification
pytestwith coverage (mongomock): 950 passed, 210 skipped (helm-dependent);scripts/at 100%. After the review fixes,tests/test_release_notes.pyandtests/test_release_version.py: 135 passed, 100%.pre-commit run --all-filespassed (ruff, ruff format, mypy, semgrep, ast-grep, gitleaks, actionlint; actionlint ran without shellcheck locally).mkdocs build --strictpassed. The 0.3.0 page gets its<h1>0.3.0</h1>from Material, since the notes have no title.python scripts/release_notes.py check docs/releases/0.3.0.mdpasses.v0.3.0(gh api repos/elixir-cloud-aai/cloud-registry/releases/generate-notes -f tag_name=v0.3.0 -f target_commitish=dev; this creates no release). I then ran the previous-tag pipeline (no tags, so empty) andrelease_notes.py bodyon them. The result has the curated sections,## Commitswith the PR list and "New Contributors", and ends with**Full Changelog**: https://github.com/elixir-cloud-aai/cloud-registry/commits/v0.3.0.Declined review findings
TODOgrep intorelease_notes.py check: the task was to keep the existing gates as they are.Release.numberin favour oforder[:3]: these are style choices, with no change in behaviour./en/v0.3.0/: the Read the Docs version of the tag may not be active, and the other links of the notes point to the latest docs (or name the pages).(#12; #34)(valid: two PR-only groups).Open questions
None blocking. Note: CR has no tags yet, so the first release's
## Commitslists every merged PR since the repository started, including the legacy ones from before the last deployed version (19f664f). The generate-notes API can't start at a commit, only at a tag.Closes #195
🤖 Generated with Claude Code