Skip to content

--generate-notes uses the commit graph, not semver ordering#61

Open
derekmisler wants to merge 1 commit intodocker:mainfrom
derekmisler:release-notes-were-using-the-commit-graph-not-sem
Open

--generate-notes uses the commit graph, not semver ordering#61
derekmisler wants to merge 1 commit intodocker:mainfrom
derekmisler:release-notes-were-using-the-commit-graph-not-sem

Conversation

@derekmisler
Copy link
Contributor

@derekmisler derekmisler commented Feb 27, 2026

Summary

GitHub's --generate-notes flag determines the range of commits to include in release notes by walking the commit graph from the new tag back to the previous reachable tag — it does not use semver ordering. This means if tags exist out of semver order in the graph, the generated notes can be incorrect or empty. This PR explicitly passes --notes-start-tag with the previously detected tag so the release note range is always correct and predictable.

Changes

  • .github/workflows/release.yml: Captures the previously detected tag (LATEST_TAG) as a step output (previous), then conditionally passes --notes-start-tag "$PREVIOUS" to gh release create when a previous tag exists, ensuring release notes always cover exactly the commits since the last release.

How to Test

  • Trigger the release workflow and verify the generated GitHub Release notes contain only commits made since the previous tag, not a broader or empty set.
  • Check the workflow logs for the updated New version: X.Y.Z (previous: vA.B.C) line to confirm the previous tag is being detected and passed through correctly.
  • For a first-ever release (no previous tag), confirm the workflow still succeeds — the --notes-start-tag argument is omitted when PREVIOUS is empty.

@derekmisler
Copy link
Contributor Author

/describe

@derekmisler derekmisler marked this pull request as ready for review February 27, 2026 16:11
@derekmisler derekmisler requested a review from a team as a code owner February 27, 2026 16:11
@docker-agent
Copy link

docker-agent bot commented Feb 27, 2026

✅ PR description has been generated and updated!

Copy link

@docker-agent docker-agent bot left a comment

Choose a reason for hiding this comment

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

Review Summary

This PR improves the release notes generation by explicitly specifying the previous tag using --notes-start-tag. The implementation is well-structured and follows bash best practices:

Correct array handling: ARGS=() declaration and "${ARGS[@]}" expansion are proper
Safe conditional logic: [ -n "$PREVIOUS" ] correctly checks for non-empty values
Proper quoting: Variables are quoted to prevent word splitting
Fallback handling: The conditional ensures the flag is only added when a previous tag exists

No issues found. This change looks good!

@derekmisler derekmisler self-assigned this Feb 27, 2026
Signed-off-by: Derek Misler <derek.misler@docker.com>
@derekmisler derekmisler force-pushed the release-notes-were-using-the-commit-graph-not-sem branch from 358962b to 745671b Compare February 27, 2026 21:33
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