Skip to content

feat: add GitHub release link to changelog finalize headings#497

Merged
c-vigo merged 5 commits intorelease/0.3.2from
feature/496-changelog-release-tag-link
Apr 7, 2026
Merged

feat: add GitHub release link to changelog finalize headings#497
c-vigo merged 5 commits intorelease/0.3.2from
feature/496-changelog-release-tag-link

Conversation

@c-vigo
Copy link
Copy Markdown
Contributor

@c-vigo c-vigo commented Apr 7, 2026

Description

prepare-changelog finalize now writes version headings with a markdown link to the GitHub release tag (https://github.com/owner/repo/releases/tag/X.Y.Z). The repository slug is taken from GITHUB_REPOSITORY (as in GitHub Actions) or from a new --github-repository CLI flag. unprepare accepts linked ## [semver](url) - … headings so release rollback still works.

Type of Change

  • feat -- New feature
  • fix -- Bug fix
  • docs -- Documentation only
  • chore -- Maintenance task (deps, config, etc.)
  • refactor -- Code restructuring (no behavior change)
  • test -- Adding or updating tests
  • ci -- CI/CD pipeline changes
  • build -- Build system or dependency changes
  • revert -- Reverts a previous commit
  • style -- Code style (formatting, whitespace)

Modifiers

  • Breaking change (!) -- This change breaks backward compatibility

Changes Made

  • packages/vig-utils/src/vig_utils/prepare_changelog.py
    • Add _validate_github_repository_slug and _resolve_github_repository; finalize_release_date accepts optional github_repository and emits linked headings; unprepare_changelog regex allows optional (url) after the version; finalize subcommand adds --github-repository; help text updated.
  • packages/vig-utils/tests/test_prepare_changelog.py
    • Coverage for linked headings, env vs flag slug, validation errors, and subprocess/CLI behavior.
  • docs/RELEASE_CYCLE.md, packages/vig-utils/README.md
    • Document finalize signature, GITHUB_REPOSITORY, and --github-repository example.
  • CHANGELOG.md, assets/workspace/.devcontainer/CHANGELOG.md

Commits (vs release/0.3.2): test: …, feat(vigutils): …, docs: … (Refs: #496).

Changelog Entry

Changed

  • prepare-changelog finalize adds GitHub release link to version headings (#496)
    • finalize_release_date writes ## [X.Y.Z](https://github.com/owner/repo/releases/tag/X.Y.Z) - date; repository slug comes from GITHUB_REPOSITORY (set in Actions) or from prepare-changelog finalize ... --github-repository owner/repo
    • unprepare recognizes linked ## [semver](url) - … headings

Testing

  • Tests pass locally (just test)
  • Manual testing performed (describe below)

Full just test was not run. vig-utils only: uv run pytest packages/vig-utils/tests/test_prepare_changelog.py — 121 passed.

Manual Testing Details

N/A (CLI and library behavior covered by unit and subprocess tests in packages/vig-utils/tests/test_prepare_changelog.py).

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly (edit docs/templates/, then run just docs)
  • I have updated CHANGELOG.md in the [Unreleased] section (and pasted the entry above)
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

N/A

Refs: #496

@c-vigo c-vigo self-assigned this Apr 7, 2026
@c-vigo c-vigo requested a review from Copilot April 7, 2026 14:12
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds GitHub Release tag links to finalized CHANGELOG version headings in vig-utilsprepare-changelog tooling, making the generated release notes headings directly clickable and reducing post-release manual edits.

Changes:

  • Update finalize_release_date() to emit ## [X.Y.Z](https://github.com/OWNER/REPO/releases/tag/X.Y.Z) - YYYY-MM-DD, resolving OWNER/REPO from GITHUB_REPOSITORY or --github-repository.
  • Extend unprepare to accept linked version headings (## [semver](url) - …) for rollback workflows.
  • Add unit + subprocess CLI tests and update docs/CHANGELOG entries to reflect the new behavior and flag.

Reviewed changes

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

Show a summary per file
File Description
packages/vig-utils/src/vig_utils/prepare_changelog.py Implements repo resolution/validation, linked finalize headings, and CLI flag plumbing; updates unprepare regex.
packages/vig-utils/tests/test_prepare_changelog.py Adds coverage for linked headings, env vs flag behavior, validation failures, and subprocess CLI flows.
packages/vig-utils/README.md Documents finalize’s new --github-repository option and the GITHUB_REPOSITORY fallback.
docs/RELEASE_CYCLE.md Updates release-cycle documentation to describe linked headings and repository slug sourcing.
CHANGELOG.md Adds an Unreleased entry describing the new linked-heading behavior.
assets/workspace/.devcontainer/CHANGELOG.md Mirrors the root changelog entry for the workspace template.
Comments suppressed due to low confidence (1)

packages/vig-utils/src/vig_utils/prepare_changelog.py:216

  • The ValueError message still says it expects ## [semver] - …, but the matcher now also accepts ## [semver](url) - …. Updating the message will make failures easier to understand when a linked heading is present.
        r"^## \[(\d+\.\d+\.\d+)\](?:\([^)]+\))? - .+$",
    )
    if not version_heading.match(line):
        raise ValueError(
            f"Unexpected first CHANGELOG section heading: {line!r} "

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/vig-utils/src/vig_utils/prepare_changelog.py
@c-vigo c-vigo enabled auto-merge April 7, 2026 14:39
@c-vigo c-vigo merged commit 86c075e into release/0.3.2 Apr 7, 2026
11 checks passed
@c-vigo c-vigo deleted the feature/496-changelog-release-tag-link branch April 7, 2026 14:46
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.

2 participants