Skip to content

Fix activation metadata loading for private reusable workflows - #78626

Merged
pelikhan merged 19 commits into
mainfrom
copilot/fix-reusable-workflow-activation
Nov 17, 2026
Merged

pelikhan merged 19 commits into
mainfrom
copilot/fix-reusable-workflow-activation

Conversation

@pelikhan

@pelikhan pelikhan commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Private reusable (callee) workflows failed in activation: generate_aw_info read the executing lock file through the Contents API using the caller's token, which returns 404 for a private callee repository.

Strategy

The runtime no longer reads the executing lock file at all. The compiler hands the run info step exactly the metadata it needs.

  • Embed only what can't be recovered. The compiler embeds only workflow-content records (inline agents and imports from the workflow itself). Repository agent records are not embedded.
  • Step-level, readable JSON. GH_AW_INFO_MARKDOWN_METADATA is set only on the "Generate agentic run info" step, as escaped JSON ($, ' and non-ASCII escaped) rather than base64.
  • Omitted when empty. No records means no env. A missing env is treated as an empty catalog. Empty {} records are dropped.
  • Large payloads. Payloads over 16,000 characters go to $RUNNER_TEMP/gh-aw-markdown-metadata.json via GH_AW_INFO_MARKDOWN_METADATA_FILE. The hard limit is 4 MiB.
  • Repository agents are recovered after checkout. interpolate_prompt runs after the .github checkout and before the activation artifact upload. It calls recoverCheckoutMarkdownMetadata, which reads checked-out lock headers and updates aw_info.json only when records were missing.
  • Removed fallbacks. The Contents API read of the executing lock, the git-object read, and the related quota handling are gone. The executing workflow identity check is kept in generate_aw_info.

Impact

  • 328 of 368 lock files no longer carry the env.
  • The remaining 40 carry small readable JSON (188–555 characters).
  • Net change: 736 lines removed and 40 added across the lock files.

@pelikhan pelikhan changed the title [WIP] Fix 404 error in reusable workflow activation with GITHUB_TOKEN Fix activation metadata loading for private reusable workflows Nov 17, 2026
@pelikhan
pelikhan marked this pull request as ready for review November 17, 2026 06:18
Copilot AI adaptive review requested due to automatic review settings November 17, 2026 06:18
@github-actions

github-actions Bot commented Nov 17, 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.

🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ⊞ 7.2K · ◷

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

PR Code Quality Reviewer

Outcome: reported_action

The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt56 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.5K · ◷

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

PR Specification Reviewer

Outcome: reported_action

The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated by PR Specification Reviewer for #78626 · copilot · gpt56 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.6K · ◷

@github-actions

github-actions Bot commented Nov 17, 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 · copilot · routed: haiku55 xhigh · ~7 AIC · ⌖ ~2 AIC · ⊞ 6.6K · ◷

@github-actions

github-actions Bot commented Nov 17, 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 by Ponytail Reviewer for #78626 · codex · routed: gpt61 medium · ~5 AIC · ⌖ ~1 AIC · ⊞ 185 · ◷

@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.

Found one blocking correctness issue and one test-coverage issue.

Highlights
  • Embedded metadata is not size-checked by the compiler, so oversized workflows compile but fail during activation.
  • The expression-inertness test checks base64 text, making the assertion vacuous.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.5K
Comment /review to run again

Comment thread pkg/workflow/compiler_yaml.go Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (spec-review-history)
{"id":"ldg-c6f21c5b-10c3-4390-bcf3-a1c1b110ef1c","parents":[],"payload":{"id":"ldg-5fe62976-30e8-4aa2-9035-27fae0040608","operation":"append","value":{"finding_count":0,"head_sha":"eb4b4e0e34eb20980b57a5a7f6fb91aea8270a5d","outcome":"aligned"}},"sha":"sha256:e5b9cda190681dece5c1fd8bae4af6896e7c4848123a08cbe78872f586f4c444","timestamp":"2026-11-17T06:26:29.952Z","type":"ledger_append","version":1}
History

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (review-history)
{"id":"ldg-818c19ad-9d5b-4f27-836c-7fff2f7ccee7","parents":[],"payload":{"id":"ldg-c06a08ac-c858-4761-a978-3a45316628ba","operation":"append","value":{"finding_count":2,"head_sha":"eb4b4e0e34eb20980b57a5a7f6fb91aea8270a5d","outcome":"findings"}},"sha":"sha256:04cf6589bcb6f3240d67ba70d622b20d178db083c6649fd1a519b77623dc9b92","timestamp":"2026-11-17T06:27:22.240Z","type":"ledger_append","version":1}
History

@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, /codebase-design, and /tdd. Requesting changes because the committed lock files are stale.

📋 Key Themes & Highlights

Key Themes

  • Stale lock files (blocking): the compiled activation job changes for every workflow, but none of the 368 .lock.yml files are regenerated. CI check-workflow-drift will fail. Run make recompile.
  • Silent skip: embedActivationMarkdownMetadata returns nil when the activation job is missing, which hides a broken catalog.
  • Duplicate work: the catalog is computed twice per compile (embed and manifest).
  • Weak test: the ${{ check on base64 is always true, so it does not prove what it claims.

Positive Highlights

  • ✅ The embedded path bypasses deduplicateMarkdownMetadata, so the catalog has no References that the activation job would be unable to resolve.
  • ✅ Base64 canonical round-trip, bounded decode, and no fallback on malformed input are well tested.
  • ✅ Env cleanup in generate_aw_info.test.cjs prevents leakage between tests.

@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

Comment thread pkg/workflow/compiler_yaml.go Resolved
Comment thread pkg/workflow/compiler_yaml.go Resolved
Comment thread pkg/workflow/compiler_yaml.go Resolved

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

The catalog-wide token budget rejects valid collections, while large catalog payloads can exceed workflow-expression and environment-entry size limits.

2 open issues
What changed in this PR

This PR addresses private reusable workflow activation failures by embedding compiler metadata in the activation job, avoiding callee-repository reads with the caller-scoped token.

Changes:

  • Embed base64-encoded metadata after prompt generation, keeping authored Actions expressions inert.
  • Prefer validated embedded catalogs while preserving revision-based loading for older lock files.
  • Add compiler/runtime regression coverage and refresh golden outputs.
File Description
pkg/​workflow/​testdata/​TestWasmGolden_CompileFixtures/​with-imports.golden Update embedded-metadata expectation for imports.
pkg/​workflow/​testdata/​TestWasmGolden_CompileFixtures/​smoke-copilot.golden Update Copilot smoke-test output.
pkg/​workflow/​testdata/​TestWasmGolden_CompileFixtures/​playwright-cli-mode.golden Update Playwright CLI fixture output.
pkg/​workflow/​testdata/​TestWasmGolden_CompileFixtures/​custom-safe-output-max-length.golden Update custom safe-output fixture output.
pkg/​workflow/​testdata/​TestWasmGolden_CompileFixtures/​basic-copilot.golden Update basic Copilot fixture output.
pkg/​workflow/​testdata/​TestWasmGolden_AllEngines/​pi.golden Expect embedded metadata for Pi.
pkg/​workflow/​testdata/​TestWasmGolden_AllEngines/​gemini.golden Expect embedded metadata for Gemini.
pkg/​workflow/​testdata/​TestWasmGolden_AllEngines/​copilot.golden Expect embedded metadata for Copilot.
pkg/​workflow/​testdata/​TestWasmGolden_AllEngines/​codex.golden Expect embedded metadata for Codex.
pkg/​workflow/​testdata/​TestWasmGolden_AllEngines/​claude.golden Expect embedded metadata for Claude.
pkg/​workflow/​compiler_yaml.go Embed the catalog in activation-job environment variables.
pkg/​workflow/​compiler_markdown_metadata_test.go Verify encoding and post-substitution metadata inclusion.
actions/​setup/​js/​markdown_metadata.cjs Prefer embedded catalogs and validate their encoding.
actions/​setup/​js/​markdown_metadata_sources.test.cjs Cover private-source loading and malformed-catalog rejection.
actions/​setup/​js/​generate_aw_info.test.cjs Cover run-info generation without private-repository access.
actions/​setup/​js/​generate_aw_info.cjs Pass embedded metadata to the loader.

Review effort: Max (adaptive)

Comment thread actions/setup/js/markdown_metadata.cjs Resolved
Comment thread pkg/workflow/compiler_yaml.go Resolved
@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 (pkg/workflow/compiler_yaml.go:31): address unresolved feedback - Review comment
  3. Review (pkg/workflow/compiler_markdown_metadata_test.go:36): address unresolved feedback - Review comment
  4. Review (pkg/workflow/compiler_yaml.go:240): address unresolved feedback - Review comment
  5. Review (pkg/workflow/compiler_yaml.go:22): address unresolved feedback - Review comment
  6. Review (pkg/workflow/compiler_yaml.go:24): address unresolved feedback - Review comment
  7. Review (pkg/workflow/compiler_markdown_metadata_test.go:36): address unresolved feedback - Review comment
  8. Review (actions/setup/js/markdown_metadata.cjs:358): address unresolved feedback - Review comment
  9. Review (pkg/workflow/compiler_yaml.go:31): 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": "eb4b4e0e34eb20980b57a5a7f6fb91aea8270a5d",
  "kind": "requested",
  "schema_version": "1",
  "state": "dc91b1af560f7a90ca8596bfe5ba86ded95aad197ab6f8b43fff8ccd3bf65539",
  "work": [
    "0fae82acb2e0ea51d2100aa9c47ce2394eb4cbe62aaa1b5ccc02b9ed8930bb3c",
    "2340e6be4547a9c83e1d54600d87c02265f275cc19702a3e39b72211f9fae3bf",
    "55ef969407b7b55d2390af518b95e14c81eecf6a06060969c8663dad586fa6a8",
    "853792647deb236e49b7b453338d418773aa2421bdb653b926787bb6872994a7",
    "9582df81128043d76135fd24121be136df9eee222b7ba4a7e8e8ccef5338130e",
    "ae02e174372d6af1dc43227f7fece16bba7f8e54fd8e6908030718a208ee9a9b",
    "af3a41abb52d9794ec2e6160624a3018ae19f91cbc0b422314b519b69e24bb2a",
    "dcea077d2d27deeced3685d663cfc6e027fc3043a7f3d6434dfa0e5a260e1254"
  ],
  "workflow": "pr-sous-chef"
}

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

Copilot AI commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

@copilot

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

Merged main via make merge-main in 4d47109. Addressed all eight linked comments in 104d460, with a lint-only follow-up in 001d27a; each linked thread has a reply.

Compiler/WASM golden tests, 152 runtime tests, Go lint, and drift verification for all 368 locks pass. Secret scans are clean. Custom-linter diagnostics remain only in unchanged files. CodeQL timed out without results and instructed against retrying. Working tree is clean; no PR merge or workflow dispatch was performed.

gh-aw-bot and others added 2 commits November 17, 2026 08:31
…workflow-activation

Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copilot AI commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

@copilot

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

Merged main in 631e14a and fixed the stale overflow-test expectations in bbf6a25. Targeted tests and the final validation gate pass; no CI was triggered.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copilot AI commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

@copilot store a preview of the activation metadata as a comment above the base64 payload (line comment with first 42 chars...)

Added escaped 42-character metadata previews for both payload transports in 8ba7ef6. Validation passed; CodeQL timed out without results.

Records whose compiled value is {} or null and that carry no errors or
references are omitted; absence already means empty at runtime.

Co-authored-by: Copilot App <[email protected]>
@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.

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "523dc7ae3dfeed81ceb028d50e73b24abb7fe77f",
  "kind": "requested",
  "schema_version": "1",
  "state": "074f8e1a4dc6f54205e2fb1cb661129151d6ded7e018742eac146752b26ba774",
  "work": [],
  "workflow": "pr-sous-chef"
}

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

gh-aw-bot and others added 4 commits November 17, 2026 17:12
…workflow-activation

# Conflicts:
#	pkg/workflow/type_conversion_test.go

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Set GH_AW_INFO_MARKDOWN_METADATA only on the run info step, as escaped
JSON rather than base64, and omit it when no records exist. Repository
agent records are recovered from the checkout after the .github checkout
in interpolate_prompt. The runtime no longer reads the executing lock
file via the Contents API or git objects.

Co-authored-by: Copilot App <[email protected]>
…tivation' into copilot/fix-reusable-workflow-activation

Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copilot AI commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

@copilot

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

Merged latest main in 2649f05 and preserved your concurrent metadata update in 370a94e. Added a narrow test-lint exemption in a9425ca. Published successfully. Focused Go tests and 174 runtime tests pass; the final validation rerun is still running. CodeQL timed out without results. No PR merge or workflow dispatch performed.

@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. Fix failing check impacted-go-tests (FAILURE): Check run.
  3. Fix failing check JS Tests (shard 8/8) (FAILURE): Check run.

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "a9425ca4a060393b7394fe8af7b74117206a25df",
  "kind": "requested",
  "schema_version": "1",
  "state": "345eb8a72e8f94206f67d45d317b3854aefc8d9172c55a3e64ba047a5d5ec012",
  "work": [
    "27ac911a80a91d6b02a3e07caef39b800cb632677606247471a58f9a93975854",
    "42e5d572d9d75b7168fe7d0aeda0717cc07e65ed240f6d299e6fec661214f1ac"
  ],
  "workflow": "pr-sous-chef"
}

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

Copilot AI commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

@copilot

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

Merged latest main with make merge-main in fed4852. Fixed the stale JavaScript boundary expectations and timing-sensitive Go assertion in 4b5a68b; metadata compiler lint follow-ups are in cda80a4 and 426e37f.

Targeted Go tests, all 182 selected JavaScript tests, and drift checks for all 366 workflows pass. Secret scans are clean. Unrelated package-wide linter findings remain unchanged; CodeQL timed out without results. Changes are published; no PR merge or workflow dispatch performed.

Collect the workflow-only and full Markdown metadata catalogs in one
scan, and enforce the runtime size limit on the escaped payload the
runtime actually reads. Assert the raw embedded value contains no
Actions expressions.

Co-authored-by: Copilot App <[email protected]>
@pelikhan
pelikhan merged commit 4aab628 into main Nov 17, 2026
139 checks passed
@pelikhan
pelikhan deleted the copilot/fix-reusable-workflow-activation branch November 17, 2026 19:37
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.3.1

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.

Reusable workflow from a private repo fails in activation: run-info metadata read 404s with caller's GITHUB_TOKEN (v1.2.2+)

4 participants