Skip to content

Test: Cover the UV_NO_MODIFY_PATH refusal - #257

Merged
ModeSevenIndustrialSolutions merged 1 commit into
lfreleng-actions:mainfrom
lfreleng-bot-forks:code-monkey/issue-255
Nov 15, 2026
Merged

ModeSevenIndustrialSolutions merged 1 commit into
lfreleng-actions:mainfrom
lfreleng-bot-forks:code-monkey/issue-255

Conversation

@lf-releng-code-monkey-bot

Copy link
Copy Markdown
Contributor

Closes #255

Authored by an AI agent; human review required
Command Exit
prek install -t pre-commit -t commit-msg 0
prek run --files .github/workflows/testing.yaml 0
uvx zizmor --persona auditor --offline .github/workflows/testing.yaml 0
git commit -s (pre-commit and commit-msg hooks incl. gitlint) 0
git log --raw --format=%h bf519ff0a3a6e7ad46951926a83c04189e3e54fb..HEAD 0

The github-code-monkey-bot workflow opened this pull request.
Nobody has merged it; a maintainer must review it first.
Review findings on this pull request are answered by a later revision round of this workflow, up to ten rounds per antagonistic review round; after that a maintainer, or the next antagonistic review, takes on any finding that remains, and a maintainer reviews every round before merge.


What changed

Adds a uv-no-modify-path job to .github/workflows/testing.yaml covering the Refuse an inherited UV_NO_MODIFY_PATH step from #254. Before this change no test exercised the guard, so removing it, or letting it accept an empty value, left every job passing.

The job has three matrix legs, and each calls uses: $/ (the self-repository form the other jobs use) with continue-on-error: true:

Case UV_NO_MODIFY_PATH Expected outcome
unset not defined success
empty '' failure
one '1' failure
  • A leg fails when steps.run.outcome doesn't match the expected outcome.
  • Proof that a refused run stopped before installing uv: whenever astral-sh/setup-uv runs, it exports UV_TOOL_BIN_DIR (because the action passes tool-bin-dir) and UV_PYTHON_INSTALL_DIR to later steps, whatever UV_NO_MODIFY_PATH is set to (addToolBinToPath and addPythonDirToPath in its src/setup-uv.ts). A refused leg fails if either variable is set after the action. The unset leg requires both to be set afterwards, which shows this check can detect a run.
  • A control step before the action checks that the variable is defined, and holds the expected value, for each leg. This makes the empty leg fail loudly if the runner drops an empty GITHUB_ENV definition, instead of quietly testing the unset case. The same step also checks that neither probe variable was set before the action ran.

No new actions are added. The job reuses the SHA-pinned harden-runner and checkout pins already in this file.

Checks run

  • prek run --files .github/workflows/testing.yaml: every hook passed, including yamllint, actionlint-shellcheck, gha-workflow-linter, aislop, check-github-workflows and the timeout-minutes check.
  • uvx zizmor --persona auditor --offline .github/workflows/testing.yaml: no findings.
  • The commit-msg hooks, including gitlint, passed on commit.

Points for review

  • This workflow won't run on this PR. The pull_request trigger excludes .github/**, so the new job runs only after merge (push to main) or through workflow_dispatch. Please trigger a run on this branch, or check the first main run, to see all three legs pass.
  • Nothing here has run on an actual Actions runner. The job depends on two assumptions: a GITHUB_ENV line UV_NO_MODIFY_PATH= defines the variable as an empty string, and step environment reaches the composite action's inner steps. The control step and the unset leg turn a wrong assumption into a red job, not a false pass.
  • Each leg runs on ubuntu-24.04 only. The guard is plain bash and doesn't depend on the OS, so a macOS leg adds cost without adding coverage.

The 'Refuse an inherited UV_NO_MODIFY_PATH' step had no test, so
removing the guard, or letting it accept an empty value, left every
job passing.

Add a uv-no-modify-path job with three legs: variable unset (the
action proceeds), defined as an empty string and defined as '1'
(both refused). Each leg runs the action with continue-on-error and
fails if the step outcome differs. A refused leg also fails if
UV_TOOL_BIN_DIR or UV_PYTHON_INSTALL_DIR is set afterwards: setup-uv
always exports both, so their absence shows the action stopped
before installing uv. The unset leg requires both to be set, which
keeps that probe honest. A control step fails the empty leg if the
runner drops the empty definition.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: lf-releng-code-monkey-bot[bot] <332050256+lf-releng-code-monkey-bot[bot]@users.noreply.github.com>

Copilot AI 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.

🔵 Needs a closer look

The PR path filter skips this workflow-only change, so a branch workflow_dispatch run is needed to validate all three matrix legs, including empty GITHUB_ENV propagation and setup-uv probe exports.

No open issues 🎉

What changed in this PR

Adds regression coverage for the composite action’s UV_NO_MODIFY_PATH refusal introduced in #254, addressing issue #255 without changing the guard.

Changes:

  • Adds three matrix cases covering unset, empty, and '1' values and checking the expected action outcome.
  • Validates the caller environment and uses setup-uv’s exported variables to check that refused runs stop before uv installation.
  • Reuses existing SHA-pinned actions. Actual runner validation remains pending because workflow-only PR changes do not trigger this workflow.
File Description
.github/​workflows/​testing.yaml Adds the refusal-test matrix, environment checks, and outcome assertions.

Review effort: Balanced

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🤖 Antagonistic review by agent: no line-level findings; the summary below is the verdict.

No concrete defects found in the added refusal coverage. The matrix distinguishes unset, empty, and nonempty values and checks outcomes and installation probes; the reported CI does not include execution of this new job.

Antagonistic round 1 of 3.


Automated antagonistic review by lf-releng-antagonistic-review-bot[bot] using model gpt-6-astra; see the run. This is not a human review and never an approval: a maintainer must still review and approve this pull request.

@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions merged commit 08e9a0a into lfreleng-actions:main Nov 15, 2026
11 checks passed
@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions deleted the code-monkey/issue-255 branch November 15, 2026 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-quality Updates to code-quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test: Cover the UV_NO_MODIFY_PATH refusal

2 participants