Skip to content

Normalize setup-js caught-error logging to use getErrorMessage - #49686

Merged
pelikhan merged 3 commits into
mainfrom
copilot/eslint-monster-normalize-caught-error-logging
Aug 2, 2026
Merged

Normalize setup-js caught-error logging to use getErrorMessage#49686
pelikhan merged 3 commits into
mainfrom
copilot/eslint-monster-normalize-caught-error-logging

Conversation

Copilot AI commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

This change addresses the ESLint cluster in actions/setup/js where caught errors were still stringified with String(err) / String(error) despite getErrorMessage() already being available in scope. The update makes error-message formatting consistent across the affected setup scripts without expanding scope beyond actions/setup/js.

  • Scope

    • Replaced eligible caught-error stringification in 38 actions/setup/js modules called out by the issue.
    • Kept the change limited to sites where getErrorMessage(...) was already imported or otherwise available.
  • What changed

    • Updated thrown error messages that wrapped filesystem, patch, gateway, eval, and artifact failures.
    • Updated warning / failure logging paths in command-dispatch and entrypoint code where caught errors were still falling back to String(...).
  • Behavioral effect

    • Standardizes error output on the shared helper used elsewhere in the setup-js surface.
    • Avoids raw String(...) coercion in caught-error paths, aligning these files with the repository’s preferred error-message handling.
  • Representative change

    throw new Error(`Failed to read file ${patchFilePath}: ${getErrorMessage(err)}`, { cause: err });
  • Areas touched

    • Slash-command routing and PR dispatch helpers
    • Safe-outputs setup and loaders
    • Eval / runtime import helpers
    • Artifact, patch, manifest, and repo-memory utilities
    • MCP gateway and related setup scripts

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 10.4 AIC · ⌖ 6.45 AIC · ⊞ 8.2K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · gpt54 · 25.2 AIC · ⌖ 10.7 AIC · ⊞ 8.2K ·
Comment /souschef to run again

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Normalize caught-error logging to use getErrorMessage Normalize setup-js caught-error logging to use getErrorMessage Aug 2, 2026
Copilot AI requested a review from pelikhan August 2, 2026 01:11
@pelikhan
pelikhan marked this pull request as ready for review August 2, 2026 01:18
Copilot AI review requested due to automatic review settings August 2, 2026 01:18

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.

Pull request overview

Normalizes caught-error formatting across actions/setup/js using the shared getErrorMessage() helper.

Changes:

  • Replaces String(err) and String(error) in 38 setup modules.
  • Standardizes filesystem, API, gateway, artifact, and command-routing errors.
  • Preserves existing causes, control flow, and scope.
Show a summary per file
File Description
actions/setup/js/apply_safe_outputs_replay.cjs Normalizes replay filesystem errors.
actions/setup/js/apply_samples.cjs Normalizes sample replay failures.
actions/setup/js/artifact_client.cjs Normalizes artifact directory errors.
actions/setup/js/build_checkout_manifest.cjs Normalizes manifest filesystem errors.
actions/setup/js/check_workflow_recompile_needed.cjs Normalizes file-read errors.
actions/setup/js/convert_gateway_config_shared.cjs Normalizes gateway output errors.
actions/setup/js/create_code_scanning_alert.cjs Normalizes SARIF write errors.
actions/setup/js/create_pull_request.cjs Normalizes branch and patch errors.
actions/setup/js/frontmatter_hash_pure.cjs Normalizes frontmatter read errors.
actions/setup/js/generate_aw_info.cjs Normalizes info-file errors.
actions/setup/js/generate_git_bundle.cjs Normalizes bundle directory errors.
actions/setup/js/generate_git_patch.cjs Normalizes patch filesystem errors.
actions/setup/js/generate_safe_outputs_tools.cjs Normalizes tool-generation write errors.
actions/setup/js/github_rate_limit_logger.cjs Normalizes logger directory errors.
actions/setup/js/handle_agent_failure.cjs Normalizes template-read errors.
actions/setup/js/handle_detection_runs.cjs Normalizes detection template errors.
actions/setup/js/handle_noop_message.cjs Normalizes no-op template errors.
actions/setup/js/install_frontmatter_skills.cjs Normalizes skill installation errors.
actions/setup/js/load_experiment_state_from_repo.cjs Normalizes experiment-state errors.
actions/setup/js/mcp_scripts_config_loader.cjs Normalizes MCP config read errors.
actions/setup/js/merge_remote_agent_github_folder.cjs Normalizes merge and entrypoint errors.
actions/setup/js/messages_core.cjs Normalizes message-template errors.
actions/setup/js/mount_mcp_as_cli.cjs Normalizes MCP CLI directory errors.
actions/setup/js/parse_mcp_gateway_log.cjs Normalizes gateway log errors.
actions/setup/js/patch_awf_chroot_config.cjs Normalizes chroot config errors.
actions/setup/js/pick_experiment.cjs Normalizes experiment persistence errors.
actions/setup/js/push_repo_memory.cjs Normalizes repo-memory read errors.
actions/setup/js/push_to_pull_request_branch.cjs Normalizes patch-read errors.
actions/setup/js/route_slash_command.cjs Normalizes routing warnings and failures.
actions/setup/js/run_evals.cjs Normalizes evaluation filesystem errors.
actions/setup/js/runtime_import.cjs Normalizes runtime cache errors.
actions/setup/js/safe_outputs_config.cjs Normalizes output-directory errors.
actions/setup/js/safe_outputs_handlers.cjs Normalizes handler filesystem errors.
actions/setup/js/safe_outputs_tools_loader.cjs Normalizes output append errors.
actions/setup/js/setup_comment_memory_files.cjs Normalizes comment-memory errors.
actions/setup/js/setup_threat_detection.cjs Normalizes threat-detection errors.
actions/setup/js/start_mcp_gateway.cjs Normalizes gateway filesystem errors.
actions/setup/js/upload_artifact.cjs Normalizes artifact staging errors.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 38/38 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Great work on normalizing the error-handling patterns across actions/setup/js! 🎯 This addresses a real consistency issue flagged by ESLint, and the scope is well-defined (38 files, single concern).

One thing that would strengthen this PR:

  • Add tests for the error paths — the changes refactor caught-error logging in critical paths like artifact handling, safe-outputs setup, and MCP gateway configuration. Consider adding unit tests that exercise these error-handling branches and verify that getErrorMessage() produces the expected output for different error types (filesystem errors, network errors, etc.).

The PR is otherwise ready to go — good description, focused changes, and aligned with the project's error-handling conventions.

Add unit tests for error-handling paths in actions/setup/js modules affected by the getErrorMessage normalization.

Focus on:
1. Filesystem error handling (apply_samples.cjs, build_checkout_manifest.cjs, etc.)
2. Network/API error handling (artifact_client.cjs, create_pull_request.cjs, github_rate_limit_logger.cjs)
3. Eval/import error handling (runtime_import.cjs)
4. MCP gateway error handling (start_mcp_gateway.cjs)

Each test should:
- Trigger an error condition
- Verify getErrorMessage() is called and produces readable output
- Check that error messages include the helper format rather than raw String(err)

Generated by ✅ Contribution Check · auto · 49.9 AIC · ⌖ 5.03 AIC · ⊞ 8.7K ·

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot quick triage for this PR:

  • Please investigate this PR and move it toward merge readiness.
  • There are no failing compact checks listed right now, but the PR still looks unstabilized; please re-run the pr-finisher skill, refresh the branch if needed, and summarize any remaining maintainer blockers on the current head.
  • If all blockers are maintainer-only, say so explicitly in your reply.

Run details: https://github.com/github/gh-aw/actions/runs/30727625239

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 10.4 AIC · ⌖ 6.45 AIC · ⊞ 8.2K ·
Comment /souschef to run again

Copilot AI commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot quick triage for this PR:

  • Please investigate this PR and move it toward merge readiness.
  • There are no failing compact checks listed right now, but the PR still looks unstabilized; please ...

Re-ran triage on the current head (29d5b01).

  • No unresolved PR review threads or review comments are open against this change.
  • The branch is already refreshed with main; I didn’t find another branch-update action to take.
  • Local validation: make fmt and make lint pass.
  • Local unit validation is not fully green on the current head: TEST_UNIT_RUN_FULL=1 make test-unit fails in pkg/cli/TestAWFailureInvestigatorPrefetchUsesRunLevelFailures, which is checking .github/workflows/aw-failure-investigator.md / pkg/cli content outside this PR’s actions/setup/js scope.
  • GitHub-side, the CJS runs for this PR head are action_required with no jobs started, so CI on the refreshed head still needs maintainer-side approval/re-trigger to produce a fresh signal. The linked Sous Chef run itself had no failed jobs.

So: not all remaining blockers are maintainer-only. The remaining non-maintainer blocker I found is the unrelated local pkg/cli unit-test failure on the current head; otherwise this PR has no open in-scope review/thread blockers.

Copilot AI requested a review from gh-aw-bot August 2, 2026 02:07
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot quick triage for this PR:

  • No unresolved PR review threads are visible, but your latest update still reports an unrelated local make test-unit failure on the current head. Please re-run the pr-finisher skill, confirm whether that failure is still present, and summarize whether any blockers remain in-scope for this PR versus maintainer-only.
  • Branch refresh: GitHub branch update was requested from this run.
  • If all remaining blockers are maintainer-only, say so explicitly in your reply.

Run details: https://github.com/github/gh-aw/actions/runs/30731801766

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 25.2 AIC · ⌖ 10.7 AIC · ⊞ 8.2K ·
Comment /souschef to run again

Copilot AI commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot quick triage for this PR:

  • No unresolved PR review threads are visible, but your latest update still reports an unrelated local make test-unit failure on the current head. Please re-run th...

Re-ran triage on the current head (29d5b01).

  • I unshallowed /home/runner/work/gh-aw/gh-aw, fetched origin/main, and re-ran make test-unit; the earlier local failure is no longer present. On the current head it exits cleanly (No changed Go files; skipping impacted Go tests.).
  • make fmt and make lint also pass on the current head.
  • There are still no unresolved PR review threads or review comments in scope for this PR.
  • The requested branch refresh did not produce a new branch head; local and remote are both still 29d5b01.
  • The referenced Sous Chef run failed in safe_outputs, but the log shows workflow-side branch-update/review-dismissal issues (There are no new commits on the base branch and stale review-dismissal 404s), not an in-scope blocker caused by this PR’s actions/setup/js changes.

So yes: all remaining blockers are maintainer-only. I do not see any remaining in-scope PR blockers on the current head; what remains is GitHub-side workflow/check state and any maintainer re-trigger/approval needed to get fresh CI on this head.

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

🔍 Triage Summary

Field Value
Category refactor
Risk low
Priority medium
Score 40/100 (impact 15 + urgency 10 + quality 15)
Recommended action batch_review
Batch eslint-monster

Normalizes error logging via getErrorMessage across setup-js. CI green, reviewer commented (no blocking issues).

Automated triage — see the triage report for full context.

Generated by 🔧 PR Triage Agent · auto · 40.3 AIC · ⌖ 4.01 AIC · ⊞ 8K ·

@pelikhan
pelikhan merged commit 4e43110 into main Aug 2, 2026
10 checks passed
@pelikhan
pelikhan deleted the copilot/eslint-monster-normalize-caught-error-logging branch August 2, 2026 09:56
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.

[eslint-monster] actions/setup/js: normalize caught-error logging to getErrorMessage

4 participants