Skip to content

Fix release-drafter auto-tag to use normalized semver version instead of hash - #250

Merged
Eli Pinkerton (wallstop) merged 4 commits into
mainfrom
copilot/fix-version-releaser-auto-tag
Apr 29, 2026
Merged

Fix release-drafter auto-tag to use normalized semver version instead of hash#250
Eli Pinkerton (wallstop) merged 4 commits into
mainfrom
copilot/fix-version-releaser-auto-tag

Conversation

Copilot AI commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Description

Version Auto-Draft could publish draft releases with a hash-like tag instead of the intended semver version. This update hardens version resolution so release metadata (tag_name/name) is always set from a valid semver source and never from an invalid fallback.

  • Workflow version resolution

    • Derive release version from CHANGELOG.md header when it is semver.
    • If top header is Unreleased, prefer semver-like release-drafter output; otherwise fallback to next semver changelog header.
    • Normalize semver-like release-drafter tags by stripping leading v/V before assigning VERSION, so release tags remain consistent with repository conventions.
    • Fail fast when no valid semver source exists.
    • Explicitly block literal Unreleased from being used as release tag/name.
  • Release metadata synchronization

    • Always PATCH release tag_name and name to the resolved version.
    • Remove early-exit path that previously skipped metadata sync when ## Changelog already existed in body.
    • Preserve existing body when changelog section is already present (avoid duplicate prepend).
  • Regression contract coverage

    • Extend test-sync-script-contracts.ps1 with release-drafter contract assertions for:
      • version-source precedence,
      • semver validation,
      • Unreleased guardrails,
      • no direct trust of raw tag_name,
      • guaranteed tag/name PATCH path,
      • v/V normalization behavior for semver-like drafter tags.

Related Issue

Resolves the Version Auto-Draft behavior where release tags could be hash-like or v-prefixed instead of the expected unprefixed semver format.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactor (code change that neither fixes a bug nor adds a feature)

Checklist

  • I have added tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have updated the CHANGELOG
  • My changes do not introduce breaking changes, or breaking changes are documented

Copilot AI changed the title [WIP] Fix version releaser to auto-tag with latest unreleased version Fix release-drafter auto-tag to use semver version instead of hash Apr 29, 2026
@wallstop
Eli Pinkerton (wallstop) marked this pull request as ready for review April 29, 2026 21:24
Copilot AI review requested due to automatic review settings April 29, 2026 21:24

Copilot AI left a comment

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.

Pull request overview

Hardens the Release Drafter workflow’s version resolution so draft release metadata (tag_name/name) is always derived from a valid semver source (primarily CHANGELOG headers) and never from an invalid fallback such as a hash-like tag.

Changes:

  • Update .github/workflows/release-drafter.yml to resolve VERSION from CHANGELOG.md headers with explicit Unreleased guardrails and always PATCH tag_name/name.
  • Remove the “early exit” that previously skipped metadata sync when a changelog section already existed, while still avoiding duplicate changelog insertion.
  • Extend scripts/tests/test-sync-script-contracts.ps1 with contract tests covering the new version-source precedence and PATCH behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/release-drafter.yml Reworks version selection to use changelog-derived semver and ensures release metadata is always synchronized via PATCH.
scripts/tests/test-sync-script-contracts.ps1 Adds regression contract checks asserting the workflow’s version resolution and metadata sync behavior.

Comment thread .github/workflows/release-drafter.yml Outdated
@wallstop

Copy link
Copy Markdown
Collaborator

Copilot apply changes based on the comments in this thread

Can you parse through the feedback, determine if any of it is relevant, and if it is, provide a comprehensive implementation to address the identified issues and any similar issues? Consider automation and additional diagnostics such as tests, logs, or githooks to help prevent this category of issue.

If the feedback is relevant, when addressing it, consider the code base as a whole. Are there other files or code areas that this could apply to? If so, do a sweep of those to see if they exhibit similar issues, and if they do, apply similar, appropriate fixes. The idea is to prevent the entire concept and class of issue from happening in the future. I'm only interested in general, complete fixes. I want to avoid fragility and make these checks extremely robust and reliable. Please simplify wherever possible to achieve this.

Feel free to do web searches to understand modern techniques, approaches, and best practices to this and any similar issues.

When changing files, make sure we abide by repo guidelines and rules. If there is any new knowledge learned, be sure to update llm info appropriately.

Please use sub-agents to accomplish these goals. Once a sub-agent is done, have another sub-agent review its work in an adversarial fashion. If there are any recommendations, have another sub-agent consider them and implement them. Repeat this process in a loop until all sub-agents achieve consensus that the result is incredibly high quality (110/100, exceptional work, absolutely zero issues, minor or otherwise) and does not require any revisions. I want 110% here, give it all you've got!

Copilot AI commented Apr 29, 2026

Copy link
Copy Markdown
Contributor Author

Copilot apply changes based on the comments in this thread

Can you parse through the feedback, dete...

Implemented and pushed the requested fixes in 68b3d94.

I applied the review-thread feedback by normalizing semver-like release-drafter tags to repo tag format (stripping leading v/V) before setting VERSION, tag_name, and name in the release workflow. I also swept adjacent version/tag parsing paths and only this workflow needed changes for this issue class. Regression coverage was expanded in test-sync-script-contracts to enforce normalization and related contract behavior, and targeted tests pass.

Copilot AI changed the title Fix release-drafter auto-tag to use semver version instead of hash Fix release-drafter auto-tag to use normalized semver version instead of hash Apr 29, 2026

Copilot AI left a comment

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.

Pull request overview

Hardens the release-drafter GitHub Actions workflow so release tags/names are always derived from a valid semver source (primarily CHANGELOG.md), preventing hash-like or v-prefixed tags from being used as release metadata.

Changes:

  • Update .github/workflows/release-drafter.yml to resolve VERSION from changelog headers (with guarded fallbacks) and normalize v/V-prefixed semver-like drafter tags.
  • Ensure release metadata (tag_name and name) is always PATCHed to the resolved VERSION, even when the release body already contains a changelog section.
  • Add/extend contract tests in scripts/tests/test-sync-script-contracts.ps1 to enforce the workflow’s version-selection and guardrail behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
scripts/tests/test-sync-script-contracts.ps1 Adds contract tests validating release-drafter workflow version sourcing, normalization, and PATCH behavior.
.github/workflows/release-drafter.yml Changes version resolution to be changelog-driven with semver validation/normalization, and always syncs release tag/name metadata.

@wallstop
Eli Pinkerton (wallstop) merged commit de22dcd into main Apr 29, 2026
19 checks passed
@wallstop
Eli Pinkerton (wallstop) deleted the copilot/fix-version-releaser-auto-tag branch April 29, 2026 22:16
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.

[Bug]: Version Releaser Doesn't Auto-Tag

3 participants