Repository navigation
Propagate 404s for declared workflow imports - #76430
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Category: bug | Risk: medium | Score: 52/100 (impact 25 + urgency 15 + quality 12) | Recommended action: batch_review | Notes: propagates 404s for workflow imports to avoid stale-lock false positives; important correctness fix, but not a broad outage.
|
|
Category: bug | Risk: medium | Score: 52/100 (impact 25 + urgency 15 + quality 12) | Recommended action: batch_review | Notes: propagates 404s for workflow imports to avoid stale-lock false positives; important correctness fix, but not broad outage risk.
|
|
Category: bug | Risk: medium | Score: 52/100 (impact 25 + urgency 15 + quality 12) | Recommended action: batch_review | Notes: prevents false stale-lock mismatches by propagating 404s for workflow imports.
|
1 similar comment
|
Category: bug | Risk: medium | Score: 52/100 (impact 25 + urgency 15 + quality 12) | Recommended action: batch_review | Notes: prevents false stale-lock mismatches by propagating 404s for workflow imports.
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
✅ PR Specification Reviewer completed successfully! PR Specification ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Design Decision Gate 🏗️Outcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
There was a problem hiding this comment.
Reviewed the changed 404 handling and associated tests. No actionable correctness, performance, or security issues found in the diff. The new behavior consistently propagates HTTP 404s for declared imports while preserving local ENOENT and optional runtime-import handling; coverage exercises the fallback and mismatch cases.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again
There was a problem hiding this comment.
🟡 Changes recommended
Valid remote imports are incorrectly treated as local files, causing activation to fail on expected 404s instead of excluding those paths from hashing.
1 open issue
What changed in this PR
This PR addresses #76361 by routing HTTP 404 errors for declared imports through stale-lock checking’s local fallback, rather than computing an incomplete hash.
Changes:
- Propagate HTTP 404s from declared-import frontmatter and body hash walkers.
- Preserve local missing-file handling and optional runtime-import candidate behavior.
- Add regression coverage for transient 404 fallback, missing imports, and genuine hash mismatches.
| File | Description |
|---|---|
actions/setup/js/frontmatter_hash_pure.test.cjs |
Updates expectations for declared versus optional import 404s. |
actions/setup/js/frontmatter_hash_pure.cjs |
Detects and propagates HTTP 404s in declared-import walkers. |
actions/setup/js/check_workflow_timestamp_api.test.cjs |
Tests local fallback and missing or edited import behavior. |
Review effort: Balanced (auto)
| importedFrontmatterTexts.push(...nestedResult.importedFrontmatterTexts); | ||
| } catch (err) { | ||
| if (!isFileNotFound(err)) throw err; | ||
| if (!isFileNotFound(err) || isHttpNotFound(err)) throw err; |
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs (pr-triage classified this as a bugfix) and /tdd to the test changes.
Core fix looks correct. isHttpNotFound is excluded from the ENOENT-as-missing path in both processImportsTextBased and collectImportedBodies, so listed-import 404s now throw and trigger the local-fallback verification. Runtime-import candidate reads still skip 404s, and local ENOENT still counts as a missing import. The regression is covered by the new local-fallback test and the flipped 404 expectation.
📋 Key Themes & Highlights
Key Themes
- Test readability: two test names/branches no longer match their assertions (see inline comments).
- Unverified in this environment: the vitest suites could not be installed here because the npm registry presents a TLS certificate that Node rejects, so I checked the logic with standalone Node scripts instead (9 behavior cases plus a symlink-retry case, all passing). Please confirm the vitest suites pass in CI.
Positive Highlights
- ✅ Preserves ENOENT handling and optional runtime-import skipping.
- ✅ Symlinked listed imports resolve via the 404 retry and hash identically to a direct read.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~7 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again
| expect(hash).toBe(expected); | ||
| it("should propagate API 404s for listed imports but skip optional runtime-import candidates", async () => { | ||
| const fileReader = readerWithError({ status: 404, message: "Not Found" }); | ||
| if (name === "runtime imports") { |
There was a problem hiding this comment.
[/tdd] This it now branches on name === "runtime imports", so the listed-import and runtime-import expectations sit behind a conditional, and a failure does not say which case broke. Splitting them into separate it blocks (or an it.each table with an explicit expected outcome per row) would let each case read as a specification.
💡 Suggested shape
Give the listed-import case its own it that asserts rejects.toThrow("(HTTP 404)"), and give the runtime-import candidate case its own it that asserts the hash matches the no-candidate hash. Each test name then matches its assertion.
@copilot please address this.
There was a problem hiding this comment.
Split the listed-import and optional runtime-import 404 expectations into separate named tests. Commit: 2cc5a83.
| expect(mockCore.setFailed).not.toHaveBeenCalled(); | ||
| }); | ||
|
|
||
| it.each([404, 200])("should preserve missing-import and edited-import behavior (HTTP %s)", async status => { |
There was a problem hiding this comment.
[/tdd] The test name says "should preserve missing-import and edited-import behavior", but the HTTP 404 case now asserts setFailed with HTTP 404, so the name no longer describes what is checked. Renaming it to state the new contract (for example, "should fail on a listed-import HTTP 404 and detect edited imports") keeps the test readable as a spec.
@copilot please address this.
There was a problem hiding this comment.
Renamed the test to describe the listed-import 404 and edited-import outcomes. Commit: 2cc5a83.
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "0018e81ca5842e1704d1a89d7a3842eba8fc5807",
"kind": "requested",
"schema_version": "1",
"state": "52e83a24daba24ca25f69161b432cb51f34ebcd88bde9b7100155fe995996418",
"work": [
"1f999d0f1c5a6acdd82bc79d33941a7f9cd264eecbd5f452b8b826c43ea6e087",
"f7b8d92faafbf72b4ea73400e6a4b7c35a8a34a7fecdc09ef2f7fc96786bad14"
],
"workflow": "pr-sous-chef"
}
|
…k-check-404 Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Merged the latest |
|
🎉 This pull request is included in a new release. Release: |

A transient Contents API 404 for a listed import was silently treated as a missing file, producing an incomplete hash and a false stale-lock mismatch.
ENOENThandling and optional runtime-import candidate reads remain unchanged.A 404 reading this listed file now triggers local verification instead of omitting it from the hash.