Visitar URL original
Name the uv No-Cache Setting When the Resolved PyYAML Interpreter Vanishes by ptr727 · Pull Request #3707 · ptr727/ProjectTemplate · GitHub
Skip to content

Name the uv No-Cache Setting When the Resolved PyYAML Interpreter Vanishes - #3707

Merged
ptr727 merged 2 commits into
developfrom
feature/burndown-2358
Oct 31, 2026
Merged

ptr727 merged 2 commits into
developfrom
feature/burndown-2358

Conversation

@ptr727

@ptr727 ptr727 commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

When PyYAML is not importable, the repo gate's composite-actions check resolves an interpreter through uvx --with pyyaml python and then runs its reader on that interpreter. Under UV_NO_CACHE or uv's no-cache = true, uv deletes that environment when uvx exits, so the launch failed with a bare "No such file or directory: ''".

Design: name the cause and the remedy in the existing single host finding, rather than falling back to running the reader inside uvx per file. The naming is a few lines and adds no second read path. A per-file fallback would add a path that re-resolves the environment for every action file and is only reachable on this host shape. The finding now reads: "the interpreter uvx provided could not start: [Errno 2] ...: '/gone', because uv deletes the environment when uvx exits under UV_NO_CACHE or uv's no-cache = true (unset UV_NO_CACHE, turn off uv's no-cache setting, or make PyYAML importable), so no run body was shellchecked". Only FileNotFoundError gets the explanation (it is also what Windows reports as WinError 2); other start failures keep the plain message. The load_action docstring notes the exception. scripts/repo_gate.py is a runpy wrapper, so only the action file changed.

Tests pin the full rendered sentence with a stubbed subprocess.run, and a PermissionError case that must not blame the uv cache.

Closes on promotion: #2358

Remaining findings:

🤖 Generated with Claude Code

ptr727 and others added 2 commits October 31, 2026 09:48
…ishes

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… load_action

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings October 31, 2026 16:55
@coderabbitai

coderabbitai Bot commented Oct 31, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@ptr727

ptr727 commented Oct 31, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 1ed11001ac9d8a42942995eea37e766f1a1c97c6, the content this pull request carries at that commit against develop, and it recorded 0 findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are identified, and the change includes scoped handling for the uv no-cache failure with coverage for the new diagnostic and unrelated startup errors.

No open issues 🎉

What changed in this PR

This pull request improves the composite-action gate diagnostic when uvx removes its resolved PyYAML interpreter under uv no-cache settings.

Changes:

  • Adds targeted FileNotFoundError guidance for UV_NO_CACHE and no-cache = true.
  • Documents the interpreter-resolution limitation in load_action.
  • Adds tests for the complete diagnostic and unrelated startup failures.
File Description
tests/​test_repo_gate.py Verifies the no-cache diagnostic and preserves plain messages for other startup failures.
.github/​actions/​repo-gate/​repo_gate.py Adds conditional uv no-cache guidance and documents the behavior.

Review effort: Lite

@codecov

codecov Bot commented Oct 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.02%. Comparing base (b30ce55) to head (1ed1100).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3707   +/-   ##
========================================
  Coverage    82.02%   82.02%           
========================================
  Files           27       27           
  Lines         9273     9273           
========================================
  Hits          7606     7606           
  Misses        1667     1667           
Flag Coverage Δ
python-3.13 82.02% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727
ptr727 merged commit 13e32ef into develop Oct 31, 2026
14 checks passed
@ptr727
ptr727 deleted the feature/burndown-2358 branch October 31, 2026 17:24
ptr727 added a commit that referenced this pull request Oct 31, 2026
…d Unread Moves Whole, and Name uv's No-Cache Setting (#3715)

Promotes the changes merged into `develop` since promotion #3703 to
`main`, the third round of a backlog burndown.

- [#3709](#3709) Reads a
push's remote, and the branch of a push with no refspec, in the
repository git actually uses in the write guard's owner check
(requirement 4). Before, `--git-dir` and a `GIT_DIR` on the push were
ignored, so a constructed `git --git-dir=<other>/.git push origin
develop` was checked against the working directory's repository rules
and allowed. A shape whose repository the guard cannot determine (an
earlier `GIT_DIR`, a `-c` or `--config-env` override of a `remote.` or
`url.` key, any `GIT_CONFIG*` variable, an unresolvable `--git-dir`) now
blocks `main`, `master` and `develop`. The self-test covers each shape
and `host-setup/agent-safety/README.md` states the requirement.
- [#3712](#3712) Reads a
file moved out of a source some rule never read in full for that rule in
the prose gate: a narrowed directory scope, a `home_path_exempt` file,
instruction text for `issue-ref`, and a move that changes the file's
lexer. Skips YAML block scalars when reading a Compose file's volume
entries.
- [#3707](#3707) Names
uv's no-cache setting, and its remedies, when the repo gate's resolved
PyYAML interpreter is gone at launch, rather than reporting a bare
missing-file error.
- [#3708](#3708) Moves the
section-name lookup key into one `section_key()` in
`spec/fidelity_text.py`, used by the carry, the audit, the skill build
and the review ledger, with no behavior change.

- [#3722](#3722) Applies
`env`'s directory and environment options to the command the write guard
judges, answering this promotion's first review round: `env
-C`/`--chdir` move the repository a relative `GIT_DIR` and the remote
resolve in, `env -i`/`-u` clear a `GIT_DIR` that no longer steers the
check, and `env -S` is read rather than skipped. A run-time directory
reads as undetermined, which blocks `main`, `master` and `develop`.
- [#3721](#3721) Finds a
Compose block-scalar opener through the YAML lexer the gate already uses
rather than a hand-written pattern, so a key holding `#`, quoted or not,
opens the opaque region. Also answers this promotion's first review
round.

- [#3727](#3727) Reads an
`env` option the write guard does not recognize, such as GNU `env`'s
`--ch` abbreviation of `--chdir`, as leaving the push's repository
undetermined, so `main`, `master` and `develop` fail closed, answering
this promotion's second review round. A feature-branch push is never
newly blocked.

- [#3731](#3731) Removes
the fallback #3727 kept for a push naming no refspec behind an
unrecognized `env` option, answering this promotion's third review
round. Such a push resolves its branch only through an absolute
`--git-dir`, git's own `-C`, or a `cd` in a wrapper body, and is
otherwise read as writing every protected default, so it fails closed
even from a feature branch.

Deferred review findings: #3705 (`scripts/README.md`'s uvx promise),
#3706 (`validate.py`'s exact section-name match), #3710 (whether
`section_key` should casefold), #3711 (Compose-name and directory moves
in the prose gate), #3713 (the review reader's `open review findings:`
spelling), #3714 (an edited shebang that changes a file's lexer), #3720
(the write guard's reading of `git push -o<value>`), #3723 (unused
`_bare_push_branch` parameters), #3729 (a bare push after a branch
switch earlier in the same command), #3732 (the review reader's `Review
findings remain:` spelling).

For the maintainer: #3730 asks whether every bare push whose repository
the guard cannot determine should fail closed, as #3731 now does behind
an unrecognized `env` option.

Fixes #3695
Fixes #3684
Fixes #3694
Fixes #2358
Fixes #3686
Fixes #3716
Fixes #3717
Fixes #3725
Fixes #3728

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

2 participants