Skip to content

feat: add semvertag tag --dry-run flag#15

Merged
lesnik512 merged 6 commits into
mainfrom
feat/dry-run-flag
Jun 9, 2026
Merged

feat: add semvertag tag --dry-run flag#15
lesnik512 merged 6 commits into
mainfrom
feat/dry-run-flag

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Summary

  • Adds --dry-run to semvertag tag. When set, the use case computes the bump and emits an informative result (status="dry_run" with bump and tag populated) but never calls provider.create_tag.
  • New status dry_run joins the existing well-known RunResult.status values (created, no_tags, already_tagged, strategy-specific no_*_commit). RunResult.status is already plain str; no type widening.
  • Human-readable output renders dry-run as: 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 with contents: write against the real main, 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-run is the first half of the fix; the follow-up PR (PR B) will land an action.yml dry-run input, update action-smoke to use it, and bump the version floor.

Test plan

  • Unit tests for the dry-run use-case path (status, output, no create_tag call)
  • Unit tests that dry-run does NOT affect the other early-return paths (already_tagged, no_tags, strategy no_*_commit)
  • Integration test for semvertag tag --dry-run --json against a fake GitLab transport — asserts no POST to /repository/tags
  • Unit test for the new _format_result dry_run branch
  • 100% branch coverage (fail_under = 100 in pyproject.toml)
  • just lint-ci passes

Post-merge follow-ups (NOT in this PR)

  1. Cut release 0.5.0 (this is a minor — new CLI feature) via the dogfood workflow. tag-major.yml will float v0. publish.yml will push to PyPI on the GitHub release.
  2. Open PR B: action.yml adds a dry-run input; ci.yml's action-smoke job sets with: { dry-run: true }, drops permissions: contents: write, and switches its assertion to "outputs are well-formed AND status != created". Bumps semvertag floor in action.yml from >=0.3.1,<1 to >=0.5.0,<1.

🤖 Generated with Claude Code

@lesnik512 lesnik512 self-assigned this Jun 9, 2026
lesnik512 and others added 6 commits June 9, 2026 16:10
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>
@lesnik512 lesnik512 force-pushed the feat/dry-run-flag branch from b332d4c to 9a2f5da Compare June 9, 2026 13:10
@lesnik512 lesnik512 merged commit ffbf4d7 into main Jun 9, 2026
5 of 6 checks passed
@lesnik512 lesnik512 deleted the feat/dry-run-flag branch June 9, 2026 13:18
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