docs: drop the fetch-depth requirement, semvertag never reads the working tree - #75
Merged
Merged
Conversation
…king tree semvertag/ contains no subprocess call, no git library and no filesystem access. The head commit and the tag list come from the forge REST API, and the bump is decided from that single head commit. No git clone depth can affect the result, so the documented fetch-depth: 0 requirement was never real, and the composite action needs no checkout step at all. README.md and docs/providers/github.md now show the workflow without a checkout step, and the github.md admonition explains that a checkout is only needed when other steps in the job want the repository files. The repo's own dogfood workflow and the PR action-smoke job keep their checkout, which uses: ./ requires, but drop fetch-depth: 0.
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.
What was verified in the code
grep -rE 'subprocess|pygit2|dulwich|GitPython|os\.system|shutil\.which' semvertag/returns nothing. The full import set of the package is stdlib plushttpx2,httpware,pydantic,pydantic-settings,semver,typer,rich,modern_di. No git binary, no git library.grep -rE 'open\(|Path\(|pathlib|read_text|\.toml|env_file' semvertag/returns nothing. The package never reads a file from the tree;_settings.pyis purepydantic-settingsover environment variables and CLI flags.semvertag/providers/_base.pydefines the whole provider surface as four REST calls:get_default_branch,get_latest_commit_on_default_branch,list_tags,create_tag.providers/github.pyimplements them against/repos/{repo},/repos/{repo}/commits?per_page=1,/repos/{repo}/tagsandPOST /repos/{repo}/git/refs.semvertag/_use_case.pyfetches exactly one commit (the head of the default branch) and the tag list, then passes that singleCommittostrategy.decide.strategies/conventional_commits.pyandstrategies/branch_prefix.pyboth take oneCommit. Nothing walks history.action.ymlrunsastral-sh/setup-uvthenuvx 'semvertag>=0.5.0,<1' tag. It reads nothing from the tree, so the composite action needs no checkout step for its own operation.This matches
docs/adr/0005-composite-action-does-not-check-out.md, merged in #74.What each page said before and says now
README.md, "Use it in GitHub Actions"
actions/checkout@v4andfetch-depth: 0, and the prose said "fetch-depth: 0matters, the default1misses tag-relative history".- uses: modern-python/semvertag@v0alone, and the prose says semvertag never reads the working tree so the job needs noactions/checkoutstep at all.docs/providers/github.md, Quick Start
fetch-depth: 0checkout.docs/providers/github.md, the admonition under Quick Start
fetch-depth: 0matters: semvertag walks commit history to determine the bump.actions/checkout@v4's defaultfetch-depth: 1only fetches the single tip commit and will miss tag-relative history." Both claims are false: semvertag does not walk history, and the single tip commit is in fact all it uses, read over the API rather than from the tree.actions/checkoutstep nor afetch-depthsetting is required, and that a checkout is worth adding only when other steps in the same job need the repository files.docs/providers/github.md, the outputs example (
semvertag-and-release)fetch-depth: 0checkout; the downstream step only reads step outputs.docs/providers/github.md, "Without the composite action" pure-CLI recipe
uvx semvertag tagreads the API, not the tree..github/workflows/semvertag.yml (dogfood) and .github/workflows/ci.yml (
action-smoke)actions/checkout@v6withfetch-depth: 0.actions/checkout@v6with nowith:block. These two jobs do still need a checkout, because they run the action by local path (uses: ./) and Actions can only resolve that from a checked-out tree. They never needed the history depth. Leavingfetch-depth: 0here would have contradicted the page this PR fixes.action.ymlitself mentions no checkout and needed no change.docs/index.mdanddocs/providers/gitlab.mdalready described the API-only behaviour correctly and are untouched.Gates
uv run --no-sync pytest -quv run --no-sync eof-fixer . --checklychee --offline --no-progress README.md docs/providers/github.md--remapofblob/mainURLs to the workspacejust docs-build(mkdocs build --strict)Out of scope, noted for a follow-up
docs/providers/github.mddescribesconventional-commitsas bumping "from Conventional Commits headers since the last tag" (strategy table) and as scanning "commits since the last tag" (the "Branch-prefix vs conventional-commits" section). The code decides from the head commit alone. That is a separate inaccuracy about strategy semantics rather than about checkout depth, so this PR leaves it alone.