Skip to content

tests/test_release_workflow.py runs the ref step on a tag in a checkout that holds four commits and requires it to leave them whole, so a --depth on its fetch cannot pass the suite (closes opensoft/openRepoTools#287) - #10

Merged
brettheap merged 5 commits into
mainfrom
pick/287-code-lane2
Nov 9, 2026

Conversation

@brettheap

@brettheap brettheap commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openRepoTools-2
Claim: opensoft/openRepoTools#287 (comment)

release.yml's ref step fetches git's copy of the release tag without --depth, because the checkout
holds full history. No test held that: the tag cases ran against a checkout with no history, so a
--depth=1 on the fetch passed every test. The first pick runs the ref step on a tag in a checkout
that holds four commits and requires the step to leave the checkout whole and its one git fetch to
name no depth option. The second pick rewords tagged_origin's docstring and says in the ref-step
test's docstring that a depth taken from a variable, and beyond the four commits, would pass both
checks and is not held; the third rewords that sentence. Neither changes a test. Only
tests/test_release_workflow.py changes, and release.yml is as it was.

The picks, from lane openRepoTools-2's branches in opensoft/openRepoTools, each made with git cherry-pick -x and followed by its source commit:

  • tests/test_release_workflow.py runs the ref step on a tag in a checkout that holds four commits and requires it to leave them whole, so a --depth on its fetch cannot pass the suite
    (cherry picked from commit 15f5e2b162fd62c0833eed165727b798e406e672)
  • tests/test_release_workflow.py rewords tagged_origin's docstring on its commits, and says in the ref-step test's docstring that a depth beyond the four commits taken from a variable passes both checks and is not held
    (cherry picked from commit 132e478b2b2032a587bcd1eaca686350c9538600)
  • tests/test_release_workflow.py rewords the sentence in the ref-step test's docstring on a depth taken from a variable, so that the variable is read as qualifying the depth and not the four commits
    (cherry picked from commit e14c2f71d6825c95ed63f88ca4be250141c5e389)

Closes opensoft/openRepoTools#287.

Lane: openRepoTools-2
Co-Authored-By: Claude Sonnet 5.5 [email protected]

🤖 Generated with Claude Code

Summary by Sourcery

Strengthen release workflow tests to require full-history tag fetches and prevent regressions to shallow checkout behavior.

Bug Fixes:

  • Add coverage ensuring the release ref step preserves a tag checkout’s complete history and does not use shallow-fetch options.

Enhancements:

  • Extend the tagged repository test fixture to create configurable commit histories.

Tests:

  • Add a release workflow test covering tag builds from a four-commit checkout and validating the resulting fetch command and repository depth.

Brett Heap and others added 3 commits November 7, 2026 18:18
…ut that holds four commits and requires it to leave them whole, so a --depth on its fetch cannot pass the suite (#287)

The ref step fetches git's copy of the release tag again, and its comment (release.yml:377-380) and the header (:25-28) say it does so without `--depth`: the checkout holds full history, and a depth would cut that history off at the run's commit. The test file pinned the checkout's `fetch-depth` as 0 and nothing else about it: no `--depth`, no `shallow`, no `git fetch`. The tag cases ran against a checkout with no history, so a `--depth=1` at release.yml:409 passed every test (lane openRepoTools-2's re-check of #284, NIT 5).

`tagged_origin` takes a `history` argument, one commit by default so its callers are unchanged, and builds that many commits, each the child of the one before it, with the tags at the last. The new test makes an origin with four commits and `v1.1.0`, fetches every tag into the checkout, which is what `fetch-depth: 0` leaves (it asserts that premise: not shallow, four commits), and runs the ref step on `refs/tags/v1.1.0` under the forge fake. It requires the step to pass, the checkout to be not shallow afterwards and to hold all four commits, and the step's one `git fetch` to name none of --depth, --deepen, --shallow-since and --shallow-exclude. The effect alone cannot show a depth that reaches the root of the history, which git leaves whole, so the line is held too.

With `--depth=1` added to that fetch, the 22 older ref-step tests still pass and the new test fails: "the step left the checkout shallow", 'true' == 'false'. With `--depth=100` the effect checks pass and the line check fails.

Only tests/test_release_workflow.py changes, and release.yml is as it was. -k test_release_workflow: 500 passed.

A branch for the code leg, not a pull request: it is cherry-picked into openRepoTools-code after v1.1.0 is tagged.

Part of #287.

Lane: openRepoTools-2
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
(cherry picked from commit 15f5e2b162fd62c0833eed165727b798e406e672)
…ts commits, and says in the ref-step test's docstring that a depth beyond the four commits taken from a variable passes both checks and is not held (#287)

Lane openRepoTools-2's review of #287's commit (RV-A) found two NITs, both about docstrings. This commit changes those two docstrings and nothing else. The file's syntax tree is the same with its docstrings blanked, so no test is added, removed or changed, and release.yml is as it was.

- `tagged_origin`'s docstring (`:715-722`) described its `history` commits in a parenthesis ("one with no parent, unless a case asks for more, each the child of the one before it") that read awkwardly. It now says in two plain sentences that the commits are in a line, the first with no parent and each later one the child of the one before it, and that `history` is 1 unless a case asks for more.
- The ref-step test's docstring now says that a depth beyond the four commits that the fetch line takes from a variable would pass both checks. The text check reads the line as written, so `git fetch $limit origin ...` shows it no `--depth`, and a depth that reaches past the root leaves the checkout whole (RV-A's variant: `limit="--depth=100"`). RV-A called it contrived, worth a sentence at most, so the docstring says so and no test is added for it. RV-A wrote "four or more", and the boundary is one higher: git leaves a checkout of four commits shallow at `--depth=4`, which the shallow check refuses, and whole from `--depth=5`.

A branch for the code leg, not a pull request: it is cherry-picked into openRepoTools-code after v1.1.0 is tagged, on top of 15f5e2b.

Part of #287.

Lane: openRepoTools-2
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
(cherry picked from commit 132e478b2b2032a587bcd1eaca686350c9538600)
…est's docstring on a depth taken from a variable, so that the variable is read as qualifying the depth and not the four commits (#287)

The final review of #287 (Lane openRepoTools-2's opus pass on head 43891a2, comment 6321040376) found no MUST and no SHOULD and one optional NIT: the docstring sentence at `tests/test_release_workflow.py:1470-1472` read "A depth beyond the four commits that the line takes from a variable would pass both checks", and "that the line takes from a variable" can be read as describing the commits. This commit rewords that one sentence and nothing else. The file's syntax tree is the same with its docstrings blanked (80 test functions before and after, and the one docstring whose text differs is this test's), so no test is added, removed or changed, and release.yml is as it was.

- The sentence now reads "A depth that the fetch line takes from a variable, and that is beyond the four commits, would pass both checks": the clause on the variable stands next to the depth it qualifies, and the commits come after it. The rest of the sentence ("that is contrived, and no case holds it") is as it was. It is three lines before and after, so no later line of the file moves.
- The gap's meaning is as 132e478 stated it and the review confirmed it: the text check reads the fetch line as written, so a depth taken from a variable shows it no `--depth`. Git leaves a checkout of four commits shallow at `--depth=4`, which the shallow check refuses, and whole from `--depth=5`, which neither check refuses. No case is added for it, as before.
- `tests/run.sh -k ref_step` on this tree: 23 passed, 2987 deselected.

A branch for the code leg, not a pull request: it is cherry-picked into openRepoTools-code after v1.1.0 is tagged, on top of 43891a2.

Part of #287.

Lane: openRepoTools-2
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
(cherry picked from commit e14c2f71d6825c95ed63f88ca4be250141c5e389)
@sourcery-ai

sourcery-ai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Tests

Extend the tagged-repository fixture to create multi-commit history and use it to verify that the release ref step preserves all four commits without shallow-fetch options.

  • tests/test_release_workflow.py L722-729, L736-738, L1462-1502

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

sourcery-ai[bot]
sourcery-ai Bot previously approved these changes Nov 8, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

brettheap and others added 2 commits November 9, 2026 13:09
The in-place merge of runbook v9: the stack grows by this clean merge, with no force-push.

Lane: openRepoTools-2
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The in-place merge of runbook v9: the stack grows by this clean merge, with no force-push.

Lane: openRepoTools-2
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@brettheap brettheap closed this Nov 9, 2026
@brettheap brettheap reopened this Nov 9, 2026
@sonarqubecloud

sonarqubecloud Bot commented Nov 9, 2026

Copy link
Copy Markdown

@brettheap
brettheap changed the base branch from pick/286-code-lane2 to main November 9, 2026 21:59
@brettheap
brettheap dismissed sourcery-ai[bot]’s stale review November 9, 2026 21:59

The base branch was changed.

@brettheap
brettheap merged commit 8400ddc into main Nov 9, 2026
18 checks passed
@brettheap
brettheap deleted the pick/287-code-lane2 branch November 9, 2026 23:26
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.

No test pins release.yml's ref step to fetch the tag without --depth, so --depth=1 there passes every test

1 participant