Skip to content

Propagate 404s for declared workflow imports - #76430

Merged
pelikhan merged 4 commits into
mainfrom
copilot/fix-stale-lock-check-404
Nov 10, 2026
Merged

pelikhan merged 4 commits into
mainfrom
copilot/fix-stale-lock-check-404

Conversation

Copilot AI commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

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.

  • Hash verification: Propagate HTTP 404s from explicit frontmatter and body imports so stale-lock checking uses its local fallback.
  • Preserved behavior: Local ENOENT handling and optional runtime-import candidate reads remain unchanged.
imports:
  - shared/prompt.md

A 404 reading this listed file now triggers local verification instead of omitting it from the hash.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix stale-lock check to handle transient HTTP 404 errors Propagate 404s for declared workflow imports Nov 10, 2026
Copilot AI requested a review from pelikhan November 10, 2026 06:51
@github-actions

Copy link
Copy Markdown
Contributor

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.

Generated by 🔧 PR Triage Agent · copilot · mai11 · ~9 AIC · ⌖ ~2 AIC · ⊞ 15.8K · ◷

@github-actions

Copy link
Copy Markdown
Contributor

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.

Generated by 🔧 PR Triage Agent · copilot · mai11 · ~9 AIC · ⌖ ~2 AIC · ⊞ 15.8K · ◷

@github-actions

Copy link
Copy Markdown
Contributor

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.

Generated by 🔧 PR Triage Agent · copilot · mai11 · ~9 AIC · ⌖ ~2 AIC · ⊞ 15.8K · ◷

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

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.

Generated by 🔧 PR Triage Agent · copilot · mai11 · ~9 AIC · ⌖ ~2 AIC · ⊞ 15.8K · ◷

@pelikhan
pelikhan marked this pull request as ready for review November 10, 2026 14:27
Copilot AI adaptive review requested due to automatic review settings November 10, 2026 14:27
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

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.

Generated from Ponytail Reviewer · routed: gpt61 medium · ~4 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 181 · ◷

Generated by Ponytail Reviewer for #76430

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

PR Specification Reviewer

Outcome: reported_no_action

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.

Generated from PR Specification Reviewer · gpt56 · ~3 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 1.6K · ◷

Generated by PR Specification Reviewer for #76430

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

✅ 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: reported_no_action

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.

Generated from Design Decision Gate 🏗️ · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 8.5K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

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.

Generated from Test Quality Sentinel · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 7.2K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions github-actions Bot 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.

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

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.

🟡 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;

@github-actions github-actions Bot 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.

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") {

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.

[/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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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 => {

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.

[/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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Renamed the test to describe the listed-import 404 and edited-import outcomes. Commit: 2cc5a83.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/js/frontmatter_hash_pure.test.cjs:122): address unresolved feedback - Review comment
  3. Review (actions/setup/js/check_workflow_timestamp_api.test.cjs:851): address unresolved feedback - Review comment

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"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~2 AIC · ⌖ ~2 AIC · ⊞ 6.9K · ◷
Comment /souschef to run again

Copilot AI and others added 2 commits November 10, 2026 15:35
…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>

Copilot AI commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:...

Merged the latest main and addressed both requested test comments, while preserving remote workflow-spec import behavior. Commit: 2cc5a83.

Copilot AI requested a review from gh-aw-bot November 10, 2026 15:45
@pelikhan
pelikhan merged commit 3fad3d2 into main Nov 10, 2026
49 checks passed
@pelikhan
pelikhan deleted the copilot/fix-stale-lock-check-404 branch November 10, 2026 15:53
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stale-lock check: a transient HTTP 404 on a listed import is still swallowed and reported as "Hashes differ" (follow-up to #74539)

4 participants