Skip to content

Warn instead of failing when Node is unavailable in the conclusion job - #65765

Merged
pelikhan merged 7 commits into
mainfrom
copilot/fix-node-bare-call
Oct 5, 2026
Merged

pelikhan merged 7 commits into
mainfrom
copilot/fix-node-bare-call

Conversation

Copilot AI commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

On runners without node on PATH, the conclusion job’s usage collector exits 127, leaving an error annotation and skipping the final file listing. Activity summary generation is best-effort and should not fail the collection step.

  • Collector: Guard both Node-based generators with a PATH check. Emit a GitHub Actions warning when Node is absent, then continue to the usage-file listing.
  • Regression coverage: Add shell cases for runners with and without Node.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix bare node call in conclusion job for runners without node on PATH Warn instead of failing when Node is unavailable in the conclusion job Oct 5, 2026
Copilot AI requested a review from pelikhan October 5, 2026 04:59
@pelikhan

pelikhan commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

@copilot review conclusion job and replace using node with actions/github-script

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

@copilot review conclusion job and replace using node with actions/github-script

Moved both generators into the conclusion job’s pinned actions/github-script step and removed their bare Node shell calls. Updated and recompiled the workflow output in commit 1588e63.

@pelikhan pelikhan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot refactor in script file to minimize generated code

uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const path = require('path');

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot refactor in js file in sctions/setup/js

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.

The usage generation logic now lives in actions/setup/js/generate_usage_artifacts.cjs; generated workflows delegate to it. Commit ac91ea7.

@pelikhan
pelikhan marked this pull request as ready for review October 5, 2026 14:30
Copilot AI balanced review requested due to automatic review settings October 5, 2026 14:30
Copilot AI and others added 2 commits October 5, 2026 14:33
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

@copilot refactor in script file to minimize generated code

Moved the conclusion orchestration into actions/setup/js/generate_usage_artifacts.cjs and reduced the generated script to a module call. Commit ac91ea7.

Copilot AI requested a review from pelikhan October 5, 2026 14:42
@pelikhan

pelikhan commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

/smoke-copilot

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

📰 BREAKING: Smoke Copilot is now investigating this issue comment. Sources say the story is developing...

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.

Copilot review overview

🟡 Changes recommended

The shell regression test is not run by CI, and the implementation contradicts the documented warning behavior.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
What changed in this PR

Moves usage summary generation to actions/github-script, avoiding reliance on node being available on PATH.

Changes:

  • Separates file collection from best-effort JavaScript generation.
  • Exports generator entry points and adds a resilient orchestration wrapper.
  • Regenerates compiled workflow lockfiles.
File Description
actions/​setup/​sh/​collect_usage_artifact_files.sh Removes direct Node invocations.
actions/​setup/​sh/​collect_usage_artifact_files_test.sh Adds collector regression coverage.
actions/​setup/​js/​generate_usage_activity_summary.cjs Exports main.
actions/​setup/​js/​generate_usage_activity_summary.test.cjs Tests the exported entry point.
actions/​setup/​js/​unified_session.cjs Exposes unified-session generation.
actions/​setup/​js/​generate_usage_artifacts.cjs Orchestrates best-effort generation and file listing.
actions/​setup/​js/​generate_usage_artifacts.test.cjs Tests failure handling and listing.
pkg/​workflow/​notify_comment.go Adds the GitHub Script generation step.
pkg/​workflow/​notify_comment_test.go Validates generated conclusion steps.
.github/​workflows/​*.lock.yml Applies the generated step across compiled workflows.

Comment on lines +29 to +32
output="$(RUNNER_TEMP="$TEST_DIR" PATH="$TEST_DIR/bin" /bin/bash "$SCRIPT" 2>&1)"
! grep -q 'node not found on PATH' <<<"$output"
grep -q '/tmp/gh-aw/usage/activity/collector-test-marker' <<<"$output"
test ! -f /tmp/gh-aw/usage/activity/summary.json

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.

Added this regression script to the test-scripts target in commit 80a1d1c; make test-scripts now exercises it.

Comment on lines +352 to +355
" - name: Generate usage activity summary and unified session\n",
" if: always()\n",
" continue-on-error: true\n",
fmt.Sprintf(" uses: %s\n", pinAction("actions/github-script")),

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.

The collector now emits a GitHub Actions warning when system node is absent, while generation stays on actions/github-script. The shell test covers both PATH cases; see commit 7532f42.

@pelikhan

pelikhan commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

Copilot AI and others added 2 commits October 5, 2026 15:09
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

@copilot run pr-finisher skill

fix https://github.com/github/gh-aw/actions/runs/37326651081/job/111821643354

Ran the PR-finisher checks. I fixed the reproducible impacted Go test failure in 80a1d1c and restored the missing-Node warning plus both PATH regression cases in 7532f42. Local validation passes; CI is stale after these pushes and needs a maintainer re-trigger.

@pelikhan
pelikhan merged commit 73109ca into main Oct 5, 2026
2 checks passed
@pelikhan
pelikhan deleted the copilot/fix-node-bare-call branch October 5, 2026 15:32
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.91.0

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.

conclusion job: collect_usage_artifact_files.sh calls bare node (exit 127) on runners without node on PATH

3 participants