Conversation
|
@copilot make sure the /tmp/gh-aw/ folder is created before writing aw_info.json to it. |
|
@copilot the code that generate aw_info.json into a separate .json that also validate context variable and prints agent overview in step summary. |
…ation job Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…ith context validation Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in c7824e5 —
Done in cfb306e — created Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation... |
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
There was a problem hiding this comment.
Pull request overview
Fixes activation-job failures when writing /tmp/gh-aw/aw_info.json by ensuring the /tmp/gh-aw directory exists before file creation, and refactors aw_info generation into a reusable JS module invoked from generated workflows.
Changes:
- Extracts the “Generate agentic run info” inline github-script into
actions/setup/js/generate_aw_info.cjs, including/tmp/gh-awdirectory creation before writingaw_info.json. - Updates the workflow compiler/tests to pass compile-time values via
GH_AW_INFO_*env vars and call the new module. - Regenerates workflow lockfiles and golden outputs to reflect the new structure.
Reviewed changes
Copilot reviewed 171 out of 171 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/js/generate_aw_info.cjs | New module that builds aw_info from env + context, creates /tmp/gh-aw, writes aw_info.json, sets outputs, and writes step summary. |
| actions/setup/js/generate_aw_info.test.cjs | Adds unit tests for env parsing, context validation warnings, optional cli_version, firewall fields, and step summary generation. |
| pkg/workflow/aw_info_tmp_test.go | Updates assertions to match the new generated YAML structure (module require + GH_AW_INFO_* env vars). |
| pkg/workflow/testdata/wasm_golden/TestWasmGolden_CompileFixtures/smoke-test-tools.golden | Golden output updated to ensure /tmp/gh-aw exists before writing aw_info.json. |
| pkg/workflow/testdata/wasm_golden/TestWasmGolden_CompileFixtures/claude-with-network.golden | Golden output updated to ensure /tmp/gh-aw exists before writing aw_info.json. |
| .github/workflows/*.lock.yml | Regenerated lock workflows to set GH_AW_INFO_* env vars and call /opt/gh-aw/actions/generate_aw_info.cjs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Parse allowed domains from JSON env var | ||
| let allowedDomains = []; | ||
| const allowedDomainsEnv = process.env.GH_AW_INFO_ALLOWED_DOMAINS || "[]"; | ||
| try { | ||
| allowedDomains = JSON.parse(allowedDomainsEnv); | ||
| } catch { | ||
| core.warning(`Failed to parse GH_AW_INFO_ALLOWED_DOMAINS: ${allowedDomainsEnv}`); | ||
| } |
There was a problem hiding this comment.
GH_AW_INFO_ALLOWED_DOMAINS is JSON-parsed but the result isn’t validated to be an array. If it parses to a non-array (e.g. a string/object), allowed_domains will not be an array and generate_workflow_overview.cjs will later call .slice(...).map(...) on it and throw. After parsing, ensure the value is an array (e.g. Array.isArray(parsed)), otherwise warn and fall back to [].
| // Create /tmp/gh-aw directory if it doesn't exist | ||
| if (!fs.existsSync("/tmp/gh-aw")) { | ||
| fs.mkdirSync("/tmp/gh-aw", { recursive: true }); | ||
| } | ||
| awInfoPath = "/tmp/gh-aw/aw_info.json"; | ||
|
|
There was a problem hiding this comment.
This test hardcodes /tmp/gh-aw//tmp/gh-aw/aw_info.json instead of using the same constant (TMP_GH_AW_PATH) as the implementation. If the path ever changes, the tests will silently diverge. Consider importing TMP_GH_AW_PATH from ./constants.cjs and deriving awInfoPath from it.
|
Smoke test results for
Overall: PASS (11/12)
|
There was a problem hiding this comment.
This PR cleanly extracts the inline generate_aw_info JavaScript into a dedicated CJS module with proper tests. The refactoring reduces lock file noise significantly. One path concern flagged inline — overall a solid improvement.
📰 BREAKING: Report filed by Smoke Copilot
| // Generate workflow overview and write to step summary | ||
| const { generateWorkflowOverview } = require('/opt/gh-aw/actions/generate_workflow_overview.cjs'); | ||
| await generateWorkflowOverview(core); | ||
| const { main } = require('/opt/gh-aw/actions/generate_aw_info.cjs'); |
There was a problem hiding this comment.
The path /opt/gh-aw/actions/generate_aw_info.cjs uses /opt/ which is for system-installed packages. At runtime, files are copied to /tmp/gh-aw/actions. This could fail if the setup action hasn't run or copies to a different location than expected. Consider verifying the runtime path is consistent with the setup action's copy destination.
| id: generate_aw_info | ||
| env: | ||
| GH_AW_MODEL_AGENT_COPILOT: ${{ vars.GH_AW_MODEL_AGENT_COPILOT || '' }} | ||
| GH_AW_INFO_ENGINE_ID: "copilot" |
There was a problem hiding this comment.
Good pattern: moving compile-time values to GH_AW_INFO_* env vars makes the step's generated YAML cleaner and easier to audit. This clearly separates static configuration from runtime context.
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
Smoke Test Results - Run §22526334288Status: PARTIAL
|
There was a problem hiding this comment.
💥 Automated smoke test review - all systems nominal! This PR extracts aw_info generation logic into a proper module with validation and tests. The architecture is clean and the test coverage looks solid.
💥 [THE END] — Illustrated by Smoke Claude
…info.cjs (#18876 follow-up) (#18890) * refactor: apply project conventions to generate_aw_info.cjs - Move fs require to module level (consistent with all other .cjs files) - Simplify null check: ctx[field] === undefined || ctx[field] === null → ctx[field] == null - Replace console.log with core.info per project JavaScript conventions (AGENTS.md) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * ci: trigger CI checks --------- Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
The activation job fails with
ENOENT: no such file or directory, open '/tmp/gh-aw/aw_info.json'because/tmp/gh-awdoesn't exist at that point —create_gh_aw_tmp_dir.shonly runs in the main job.Changes
actions/setup/js/generate_aw_info.cjs: New module extracted from the inline script that:GH_AW_INFO_*environment variables set by the stepcontextparameterrunId,runNumber,sha,ref,actor,eventName, orrepoare missing)/tmp/gh-awwithfs.mkdirSync(..., { recursive: true })before writingaw_info.jsonmodelstep outputgenerateWorkflowOverviewto print the agent overview in the step summaryactions/setup/js/generate_aw_info.test.cjs: 9 tests covering env var parsing, context validation, firewall config, conditionalcli_version, and step summary generationpkg/workflow/compiler_yaml.go:generateCreateAwInfonow setsGH_AW_INFO_*env vars for all compile-time values and replaces ~60 lines of inline JavaScript with:pkg/workflow/aw_info_tmp_test.go: Updated assertions to verify the new YAML structure.lock.ymlfiles: Recompiled to reflect the generated code changeOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Changeset
/tmp/gh-awbefore writingaw_info.json, preventing the activation job from failing when the temp directory is missing.Warning
The following domain was blocked by the firewall during workflow execution:
github.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.