Skip to content

tests/test_release_workflow.py runs the wheel check's whole step on a rehearsal's branch and on the version's tag, so a TAG taken from the ref's name, or a REPOSITORY hard-coded to the code leg, fails the suite (closes opensoft/openRepoTools#285) - #8

Merged
brettheap merged 4 commits into
mainfrom
pick/285-code-lane2
Nov 9, 2026

Conversation

@brettheap

@brettheap brettheap commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

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

release.yml's wheel check exports TAG, COMMIT and REPOSITORY in a bash line that no test ran: the
check's heredoc was run alone, with its values handed in through the environment, so a TAG taken
from the ref's name passed the suite. The first pick runs the whole step as GitHub runs it, on a
rehearsal's branch and on the version's tag. The second runs the rehearsal-branch case in
opensoft/openRepoTools, with its wheel stamped to match, so a REPOSITORY hard-coded to the code leg
fails one of the two cases. 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 wheel check's whole step on a rehearsal's branch and on the version's tag, so its bash line cannot take TAG from the ref's name and pass the suite
    (cherry picked from commit 9f161a99205337421acd243eb591f95bc11acd25)
  • tests/test_release_workflow.py runs the wheel check's rehearsal-branch case in opensoft/openRepoTools, with its wheel stamped to match, so a REPOSITORY hard-coded to the code leg in the step's bash line fails the suite
    (cherry picked from commit 33abe8ad2aae5d566c52932913b7de003d9f8c09)

Closes opensoft/openRepoTools#285.

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

🤖 Generated with Claude Code

Summary by Sourcery

Expand release workflow tests to ensure the wheel check derives release metadata from the workflow environment across rehearsal and tagged runs.

Bug Fixes:

  • Validate the release wheel-check step against both rehearsal-branch and version-tag executions so TAG and REPOSITORY must match the actual workflow context.

Enhancements:

  • Exercise the complete GitHub Actions wheel-check step with realistic release metadata and stamped wheels instead of testing only its heredoc.

Tests:

  • Add parametrized coverage for wheel-check behavior on rehearsal branches and version tags, including repository-specific wheel stamps.

Brett Heap and others added 2 commits November 7, 2026 18:18
… rehearsal's branch and on the version's tag, so its bash line cannot take TAG from the ref's name and pass the suite (#285)

The wheel check's bash line exports TAG, COMMIT and REPOSITORY, and the line after it names the wheel at $RUNNER_TEMP/dist-a/openrepotools-$VERSION-py3-none-any.whl. No test ran either: the heredoc was run alone, with its values handed in through the environment. So lane openRepoTools-2's mutant WX1, TAG="$GITHUB_REF_NAME", survived the suite (-k test_release_workflow, 499 passed). It can only fail a rehearsal on a branch, since the ref step already refuses any ref but refs/tags/v$VERSION.

The new test puts the wheel as built for the release at that path and runs the step as GitHub runs it, with only the values GitHub sets: VERSION, GITHUB_SHA, GITHUB_REPOSITORY, GITHUB_REF, GITHUB_REF_NAME and the step's own DIGEST, and `python3` this interpreter. It runs on refs/heads/l3-rehearsal-v1.1.0 with 1.1.0rc1 and on refs/tags/v1.1.0 with 1.1.0, and each must pass the stamp check and run to its last line. Under WX1 the branch case fails with the heredoc's "the release's values {... 'TAG': 'l3-rehearsal-v1.1.0' ...} are not this run's {... 'TAG': 'v1.1.0rc1' ...}"; the tag case passes either way, as the ref's name is the tag there.

Only tests/test_release_workflow.py changes, and release.yml is as it was. -k test_release_workflow: 501 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 #285.

Lane: openRepoTools-2
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
(cherry picked from commit 9f161a99205337421acd243eb591f95bc11acd25)
…h case in opensoft/openRepoTools, with its wheel stamped to match, so a REPOSITORY hard-coded to the code leg in the step's bash line fails the suite (#285)

Lane openRepoTools-2's review of #285's commit (RV-A) found one SHOULD. Both of the test's cases took REPOSITORY and GITHUB_REPOSITORY from `wheel_release()`, which gives the code leg's name (opensoft/openRepoTools-code), so a bash line that exports `REPOSITORY="opensoft/openRepoTools-code"` (release.yml:809) instead of `REPOSITORY="$GITHUB_REPOSITORY"` passed both. In production that line would refuse every run outside the code leg, and the only release runs so far (39416933776 on main, a branch rehearsal, and 39417405752 on v1.1.0rc1) ran in opensoft/openRepoTools.

The rehearsal-branch case now runs in `THIS_REPOSITORY`, opensoft/openRepoTools, as rehearsals run today, with the wheel stamped with that name. `WHEEL_CHECK_REFS` holds the run's repository beside the ref and the version, and the test builds its release values from `wheel_release()` with that repository. The tag case is as it was, in the code leg, so a REPOSITORY hard-coded to either name fails one of the two cases. Only tests/test_release_workflow.py changes: release.yml is as it was, no test is added or removed, and the two cases keep their ids.

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 9f161a9.

Part of #285.

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

sourcery-ai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Tests

Extend the release-workflow test inventory and add whole-step wheel-check coverage for rehearsal-branch and version-tag runs, checking that TAG and REPOSITORY match each run.

  • tests/test_release_workflow.py L46-48, L2160-2217

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 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!

Linked issues

#285 release.yml's wheel check exports TAG, COMMIT and REPOSITORY in a bash line that no test runs, so a TAG taken from the ref name passes the suite · 3 of 3 met

# Requirement Status Notes
1 Run the wheel check's whole step with a synthetic wheel at the path the step expects. ✅ Met The test writes the wheel under RUNNER_TEMP/dist-a and runs the selected step through Runner, then checks that it reaches its final command.
2 Exercise a rehearsal branch and the version's tag, and ensure TAG is v$VERSION rather than the ref name. ✅ Met WHEEL_CHECK_REFS covers refs/heads/l3-rehearsal-v1.1.0 and refs/tags/v1.1.0; the rehearsal case makes a TAG derived from the ref name fail.
3 Check the run's repository value in the wheel stamp for both dispatch contexts. ✅ Met The rehearsal case uses THIS_REPOSITORY and the tag case uses CODE_LEG; each synthetic wheel is stamped with the corresponding repository.

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]>
@sonarqubecloud

sonarqubecloud Bot commented Nov 9, 2026

Copy link
Copy Markdown

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.

release.yml's wheel check exports TAG, COMMIT and REPOSITORY in a bash line that no test runs, so a TAG taken from the ref name passes the suite

1 participant