Repository navigation
Refuse a Mixed Companion and Script Pair When Hub Main Is Unresolved in hub_fetch_run.py - #3696
Conversation
…in hub_fetch_run.py Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
A recorded local strict-review pass covers head |
There was a problem hiding this comment.
🟡 Changes recommended
An active nit remains in the docstring because it does not document that differing unresolved main reads are rejected before the gate runs.
1 open issue
What changed in this PR
This pull request hardens the unresolved-main fallback in hub_fetch_run.py by double-fetching the companion and script, refusing to run the gate when the reads differ, while preserving single-fetch behavior for resolved commits.
Changes:
- Added shared fetching and structured fetch-error handling.
- Added consistency checks for unresolved
mainreads. - Added refusal behavior for potentially mixed revisions.
- Added tests for mixed-pair refusal, fallback fetch counts, and resolved-commit behavior.
- The function docstring should document the new refusal case.
| File | Description |
|---|---|
tests/test_hub_fetch_run.py |
Tests mixed-pair refusal, fallback fetch counts, and resolved-commit behavior. |
catalog/snippets/hub_fetch_run.py |
Implements shared fetching, error handling, and double-read consistency checks for unresolved main fetches. |
Review effort: Lite
…st Main Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3696 +/- ##
========================================
Coverage 81.91% 81.91%
========================================
Files 27 27
Lines 9224 9224
========================================
Hits 7556 7556
Misses 1668 1668
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ne Revision, and Place Copilot's Outstanding Findings (#3703) Promotes the changes merged into `develop` since promotion #3693 to `main`, the second round of a backlog burndown. - [#3698](#3698) Has `drive-pr` read `state=` in every digest `wait` or `status` prints. On a feature pull request a peer merged, the drive skips the merge and goes on to the post-merge path. On a promotion it reports the merge as the drive's end state. `state=CLOSED` is a stop. `state=` decides over any exit code on such a pull request. `scripts/README.md` documents the `state=`, `merged_at=`, `merge_commit=` and `closed_at=` fields. - [#3696](#3696) Has `hub_fetch_run.py` read the prose gate's companion and script twice from `main` when no hub commit resolves, refusing with "the gate did not run" when the reads differ, so a hub push between the two requests cannot pair revisions. A resolved commit is still fetched once. - [#3702](#3702) Places a Copilot overview's `Outstanding findings:` or `Unresolved review findings:` list and prints each item under FINDINGS WITH NO THREAD, marked by whether a current thread sits at its code-span `path:line`. A findings label with no readable list holds as an unplaced part. A changed file with no changed line, added, modified or deleted, is left out of the table match while a file with changed lines remains, so a table omitting only binary files reads as covering. Remaining for the maintainer, from #3702: an empty file, a mode-only change, and a text file `.gitattributes` marks `binary` or `-diff` read 0/0 like a binary file, so a Copilot table leaving one out still reads as covering. That is the trade #3489 asked for. Deferred review findings: #3697 (open findings on a peer-merged feature pull request get no outcome before cleanup in `drive-pr`) and #3700 (the three documents describing `hub_fetch_run.py`'s fallback without its new refusal). Fixes #3688 Fixes #3533 Fixes #3672 Fixes #3489 Fixes #3701 🤖 Generated with [Claude Code](https://claude.com/claude-code)
…r Refusal (#3829) ## Summary - Bump the two stale hub caller snippet pins, `merge-bot-pull-request.yml` (was 2.0.338) and `run-periodic-codegen-pull-request.yml` (was 2.0.352), to the 2.0.1319 release commit `320713d9`. Each snippet's `secrets:` matches the callee's `workflow_call` at that commit. The merge-bot's optional `rules`, `delete-branch` and `app-login` inputs, which the snippet's comments name, all exist there. The codegen callee dropped its optional `NINJA_API_KEY` secret, which the snippet never passed. `test-pull-request.yml`, `publish-release.yml` and `test-pull-request-smoke.yml` were already past the prose gate's non-UTF-8 fix and are unchanged. - GOVERNANCE.md "Hub-Hosted Tooling" gains the one sentence the maintainer chose on #3745: Dependabot keeps the `uses:` pin current, so the never-pinned rule for a doc gate fetched from `main` does not reach it. - State `hub_fetch_run.py`'s mixed-pair refusal where its unresolved-commit fallback is documented: GOVERNANCE.md "Running the Linters Locally" and the husky and pre-commit snippet READMEs. The fallback reads the prose gate and its data from `main` twice, refuses when the reads differ, and a re-run is the remedy. The residual per-URL CDN caching risk from #3696's review needs an immutable fetch, a design change filed as #3827 (`deferred`). Not changed: `docs/reusable-workflows.md`'s adopt-stub copies of these two pins (the "Adopting the Merge-Bot" and codegen stubs) and `catalog/snippets/workflows/README.md`'s history line still name 2.0.338 and 2.0.352. A Markdown-quoted pin is never bumped by Dependabot, which is exactly #1472's open question, so they are left for that issue rather than hand-bumped here. Closes on promotion: #1666, #3700 ## Pre-existing findings, not filed - `catalog/snippets/workflows/publish-release.yml`, `test-pull-request-smoke.yml`, `test-pull-request.yml`: these still pin 2.0.1122 and 2.0.1166, which are past the fix #1666 needed but older than 2.0.1319, and the hub's Dependabot config does not scan `catalog/snippets/workflows`. That is `pre-existing`, outside this change's file claim. The class, a snippet pin nothing keeps current, is #1472's. ## Verification - `git rev-parse '2.0.1319^{commit}'` resolves to `320713d9d491f578b5604a8d67b82478717d7b05`, the latest release per `gh release list`. - Callee `on.workflow_call` read at that commit for both snippets. - Prose gate against `origin/develop`: clean. Repo gate: every check ok, `sha-pin` resolving both new pins against GitHub. `tests/test_release_guards.py`: 33 passed. - `local-strict-review`, two recorded passes: the first raised two `introduced` wording findings in GOVERNANCE.md (a carried sentence leaning on a reason stated only in a hub-only section, and an ambiguous "That fallback"), both fixed in the second commit. The second pass raised nothing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>

Summary
When
resolve_main_commit()cannot resolve a SHA,hub_fetch_run.pyfetched the prose gate's companion and the script from movingmainas separate raw URLs, so a push between the requests could pair revisions. In that case the helper now fetches the companion and script sequence twice and refuses (exit 1, "the gate did not run") when any file differs between the two reads. A resolved commit is still fetched once.Why this design
The raw-only hosts that reach the unresolved path have no API, git, or archive route, so a single immutable fetch is unavailable there. Refusing outright would break the documented raw-only fallback. A bracketed double read needs no new endpoint, stays standard-library only, and turns a push landing mid-run into a loud refusal that names the re-run.
Residual limit, found in review and deliberately stated: raw.githubusercontent.com caches each URL separately at its CDN, so right after a push the two URLs can serve different revisions consistently, and the bracket cannot see that. The docstring claims only the mid-run push case. Closing the CDN case needs an immutable fetch (an archive, or a version stamp shared by script and data), which is a larger design change than this issue's snippet-only scope.
Docs in GOVERNANCE.md and the husky/pre-commit READMEs describe the unresolved fallback as still running the gate; they do not mention the new refusal. They were out of this change's file claim and are reported for a follow-up.
Closes on promotion: #3533
🤖 Generated with Claude Code