feat: add semvertag tag --dry-run flag#15
Merged
Merged
Conversation
Adds a --dry-run option to `semvertag tag` that computes the bump and emits an informative result without calling provider.create_tag. PR-A scope: CLI change + tests + 0.5.0 release. PR-B (action.yml + action-smoke side-effect fix) blocked on the 0.5.0 release. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…pattern Plan: 4 tasks under TDD discipline. Tasks 1-3 add the use-case kwarg, CLI flag, and human-readable rendering; Task 4 lints, pushes, opens PR. Also nudges the spec's _format_result example to hoist `short` above the if-chain, avoiding a duplicate-typing.Final issue ty would have flagged. No semantic change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
b332d4c to
9a2f5da
Compare
This was referenced Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--dry-runtosemvertag tag. When set, the use case computes the bump and emits an informative result (status="dry_run"withbumpandtagpopulated) but never callsprovider.create_tag.dry_runjoins the existing well-knownRunResult.statusvalues (created,no_tags,already_tagged, strategy-specificno_*_commit).RunResult.statusis already plainstr; no type widening.Dry run: would create tag {tag} on commit {short} (strategy: {strategy}, bump: {bump}).Spec:
planning/specs/2026-06-09-dry-run-flag-design.md.Motivation
PR #14 surfaced a structural issue with
action-smoke: it ran semvertag withcontents: writeagainst the realmain, and when main's HEAD wasn't already tagged, semvertag pushed a real release tag (0.4.1) from a PR's CI run.--dry-runis the first half of the fix; the follow-up PR (PR B) will land anaction.ymldry-runinput, updateaction-smoketo use it, and bump the version floor.Test plan
create_tagcall)already_tagged,no_tags, strategyno_*_commit)semvertag tag --dry-run --jsonagainst a fake GitLab transport — asserts no POST to/repository/tags_format_resultdry_runbranchfail_under = 100inpyproject.toml)just lint-cipassesPost-merge follow-ups (NOT in this PR)
0.5.0(this is a minor — new CLI feature) via the dogfood workflow.tag-major.ymlwill floatv0.publish.ymlwill push to PyPI on the GitHub release.action.ymladds adry-runinput;ci.yml'saction-smokejob setswith: { dry-run: true }, dropspermissions: contents: write, and switches its assertion to "outputs are well-formed AND status != created". Bumps semvertag floor inaction.ymlfrom>=0.3.1,<1to>=0.5.0,<1.🤖 Generated with Claude Code