Skip to content

Fix full local Go and JavaScript test suites - #55559

Merged
dsyme merged 9 commits into
mainfrom
fix/local-full-test-suites
Aug 25, 2026
Merged

Fix full local Go and JavaScript test suites#55559
dsyme merged 9 commits into
mainfrom
fix/local-full-test-suites

Conversation

@dsyme

@dsyme dsyme commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • make local Go tests non-interactive by stubbing sudo in the Copilot installer test
  • keep harness subprocess tests offline and fast by skipping best-effort AWF reflection and shortening retry delays in test environments
  • restore Node 20 compatibility for firewall log globbing and make prompt-dependent tests hermetic
  • restore and test both JavaScript projects from the top-level Make targets
  • prevent safe-output tests from creating an undefined/ directory in the checkout
  • make the change-scoped custom Go lint gate ignore diagnostics from unchanged baseline files while still failing changed-file diagnostics and analyzer errors

Validation

  • make deps
  • make build
  • make build-js
  • make test-unit-all
  • make test-js
    • actions/setup/js: 413 files passed, 13,527 tests passed, 31 skipped
    • eslint-factory: 60 files passed, 643 tests passed
  • make lint-cjs
  • make agent-report-progress
    • 292 workflow lock files verified in sync

@dsyme
dsyme marked this pull request as ready for review August 25, 2026 00:48
Copilot AI balanced review requested due to automatic review settings August 25, 2026 00:48
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Ponytail Reviewer completed successfully!

Generated by Ponytail Reviewer for #55559

@github-actions

github-actions Bot commented Aug 25, 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 Aug 25, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR #55559 does not have the implementation label and has only 9 new lines of code in business logic directories (threshold: 100).

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Aug 25, 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

Copy link
Copy Markdown
Contributor

Comment Memory

reviewed_at: 2026-08-25T00:49:00Z
review_event: COMMENT
top_themes:
  - no actionable changed-line defects found
files_reviewed:
  - Makefile
  - actions/setup/js/add_comment.test.cjs
  - actions/setup/js/awf_reflect.cjs
  - actions/setup/js/awf_reflect.test.cjs
  - actions/setup/js/claude_harness.test.cjs
  - actions/setup/js/copilot_harness.test.cjs
  - actions/setup/js/generate_usage_activity_summary.cjs
  - actions/setup/js/notify_comment_error.test.cjs
  - actions/setup/js/package.json
  - actions/setup/js/package-lock.json
  - actions/setup/js/safe_outputs_mcp_server_defaults.test.cjs
  - pkg/cli/install_copilot_cli_test.go
  - scripts/agent-report-progress.sh
comment_count: 0

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · pi · gpt54 · 7.37 AIC · ⌖ 6.9 AIC · ⊞ 7K ·
Comment /review to run again

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

Verdict

COMMENT — I did not find a changed-line defect here that clearly warrants blocking the PR.

Highlights

I checked the Makefile/test wiring, the AWF reflect skip path, the harness test env changes, the glob compatibility fix, the safe-outputs temp-path handling, the installer test sudo stub, and the change-scoped custom Go lint filtering.

The only suspicious item was the custom-lint filter in scripts/agent-report-progress.sh, but the new logic still preserves non-file analyzer failures and still fails when any diagnostic hits a changed Go file, so I don't have a concrete correctness break to pin on this diff.

The background grumpy-coder helper failed to produce usable output, so this review is based on my own pass only.

🔎 Code quality review by PR Code Quality Reviewer · pi · gpt54 · 7.37 AIC · ⌖ 6.9 AIC · ⊞ 7K
Comment /review to run again

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

This pass focused on over-engineering only. The main simplification I’d cut is the new diagnostic parser in the custom Go lint gate; it adds a lot of shell-state handling for a narrow use case. net: -20 lines possible.

Generated by ✂️ Ponytail Reviewer for #55559 · codex · mai10 · 7.76 AIC · ⌖ 2.06 AIC · ⊞ 16.7K
Comment /ponytail to run again

Comment thread scripts/agent-report-progress.sh

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

Review: Fix full local Go and JavaScript test suites

All changes are targeted, correct, and improve test reliability. Key fixes:

  • generate_usage_activity_summary.cjs: globSync was incorrectly imported from node:fs (which has no such export). The fix to use the glob package is correct.
  • awf_reflect.cjs: Making the timeout configurable via GH_AW_REFLECT_TIMEOUT_MS is a clean testability improvement.
  • Test isolation (add_comment.test.cjs, notify_comment_error.test.cjs): Proper beforeAll/afterAll save-and-restore of GH_AW_PROMPTS_DIR prevents cross-test contamination.
  • GH_AW_SKIP_REFLECT: "true" in harness test child envs prevents unintended network calls during unit tests.
  • Makefile: Wiring eslint-factory into test-js and deps ensures the new test suite runs in CI.

No blocking issues found. ✅

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · copilot · sonnet46 · 32.5 AIC · ⌖ 9.1 AIC · ⊞ 6.2K

@github-actions github-actions Bot mentioned this pull request Aug 25, 2026

@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 and /tdd — requesting changes on three correctness issues and one test hermetic concern.

📋 Key Themes & Highlights

Key Issues

  • Path normalisation gap (scripts/agent-report-progress.sh line 194): golangci-lint sometimes emits ./pkg/... paths; go_files[] holds bare pkg/... paths. The string equality check silently suppresses changed-file diagnostics when they don't match — the main risk in this PR.
  • Implicit return 0 (scripts/agent-report-progress.sh line 938): control flow falls through implicitly to success; the intent should be explicit to survive future edits.
  • NaN timeout (actions/setup/js/awf_reflect.cjs line 35): Number.parseInt("") is NaN; an empty env var makes every reflect call time out immediately with no visible error.
  • Hermetic gap (notify_comment_error.test.cjs line 65): sets GH_AW_PROMPTS_DIR to a relative ../md path instead of using syncRuntimePromptTemplates() like the sibling test does; will break if cwd() differs.

Positive Highlights

  • GH_AW_SKIP_REFLECT bypass is clean, well-tested, and makes subprocess tests genuinely offline.
  • harnessChildEnv constant cleanly DRYs up the env setup across all harness test call-sites.
  • safe_outputs_mcp_server_defaults.test.cjs temp-dir creation/cleanup pattern is correct and complete.
  • ✅ Switching globSync to the glob npm package (away from node:fs) is the right fix for Node 20 compatibility.
  • make test-js now covers eslint-factory — good gap to close.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet46 · 60.5 AIC · ⌖ 10.5 AIC · ⊞ 7.6K
Comment /matt to run again

Comments that could not be inline-anchored

scripts/agent-report-progress.sh:194

[/diagnosing-bugs] Path comparison between linter output and go_files[] is fragile — if the linter emits ./pkg/foo/bar.go but go_files holds pkg/foo/bar.go (or vice versa), the match silently fails and all diagnostics for changed files are suppressed, making the change-scoped gate useless.

<details>
<summary>💡 Suggested fix</summary>

Strip a leading ./ from both sides before comparing:

local normalised_diag=&quot;${diagnostic_file#./}&quot;
for changed_file in &quot;${go_files[@]…

</details>

<details><summary>scripts/agent-report-progress.sh:938</summary>

**[/diagnosing-bugs]** When `diagnostic_found=1` but no diagnostic matches a changed file, the function prints the exit message but returns `0` (implicit). The linter failure is silently swallowed — callers have no way to know whether the gate was a no-op skip or a genuine pass.

&lt;details&gt;
&lt;summary&gt;💡 Suggested fix&lt;/summary&gt;

The final condition should still return the original status when no diagnostics matched but the linter exited non-zero for other reasons (e.g. config errors, analyzer pani…

</details>

<details><summary>actions/setup/js/notify_comment_error.test.cjs:65</summary>

**[/tdd]** `notify_comment_error.test.cjs` sets `GH_AW_PROMPTS_DIR` to a hard-coded relative path (`path.join(process.cwd(), &quot;../md&quot;)`), while the sibling `add_comment.test.cjs` uses the proper `syncRuntimePromptTemplates()` helper that creates a stable, isolated copy. The inconsistency means this test still depends on the layout of the source tree and will break if `cwd()` differs between environments.

&lt;details&gt;
&lt;summary&gt;💡 Suggested fix&lt;/summary&gt;

Apply the same hermetic pattern used in `add…

</details>

<details><summary>actions/setup/js/awf_reflect.cjs:35</summary>

**[/diagnosing-bugs]** `GH_AW_REFLECT_TIMEOUT_MS` falls back to `&quot;60000&quot;` but `Number.parseInt` returns `NaN` for an empty string (`process.env.GH_AW_REFLECT_TIMEOUT_MS = &quot;&quot;`). `NaN` ms silently makes every `AbortController` timeout fire immediately, causing all reflection calls to fail without an obvious error message.

&lt;details&gt;
&lt;summary&gt;💡 Suggested fix&lt;/summary&gt;

Guard against NaN:

```js
const _rawTimeout = Number.parseInt(process.env.GH_AW_REFLECT_TIMEOUT_MS || &quot;60000&quot;, 10);
const AWF_REF…

</details>

<details><summary>actions/setup/js/awf_reflect.test.cjs:116</summary>

**[/tdd]** The new `fetchAWFReflect` disable test (line 668) asserts `fetchMock` was not called — good. But there is no test that verifies the **log message** is emitted when `GH_AW_SKIP_REFLECT` is absent (i.e. the normal path still logs its `fetching ...` prefix). Without that, a future refactor that accidentally gates the normal-path log behind the same env check would go undetected.

&lt;details&gt;
&lt;summary&gt;💡 Why it matters&lt;/summary&gt;

The `&quot;disabled&quot;` reason code is a new signal for callers (e.…

</details>

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

Improves reliability and completeness of local Go and JavaScript test suites.

Changes:

  • Makes subprocess and prompt-dependent tests faster and hermetic.
  • Runs dependency installation and tests for both JavaScript projects.
  • Adds change-scoped custom Go lint filtering and Node 20 glob support.
Show a summary per file
File Description
scripts/agent-report-progress.sh Filters custom linter diagnostics by changed files.
pkg/cli/install_copilot_cli_test.go Stubs sudo in installer testing.
Makefile Includes eslint-factory dependencies and tests.
actions/setup/js/safe_outputs_mcp_server_defaults.test.cjs Provides a temporary runner directory.
actions/setup/js/package.json Adds the glob dependency.
actions/setup/js/package-lock.json Locks updated JavaScript dependencies.
actions/setup/js/notify_comment_error.test.cjs Configures and restores the prompts directory.
actions/setup/js/generate_usage_activity_summary.cjs Replaces the Node filesystem glob implementation.
actions/setup/js/copilot_harness.test.cjs Accelerates and isolates harness subprocesses.
actions/setup/js/claude_harness.test.cjs Accelerates and isolates harness subprocesses.
actions/setup/js/awf_reflect.test.cjs Tests disabled AWF reflection.
actions/setup/js/awf_reflect.cjs Adds reflection disabling and timeout configuration.
actions/setup/js/add_comment.test.cjs Uses hermetic runtime prompt templates.

Review details

Files not reviewed (1)
  • actions/setup/js/package-lock.json: Generated file
  • Files reviewed: 12/13 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread actions/setup/js/generate_usage_activity_summary.cjs Outdated
Comment thread scripts/agent-report-progress.sh Outdated
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

gh-aw-pr-sous-chef
@copilot PR Sous Chef triage: this PR still needs a forward-progress pass before maintainer investigation is likely to be productive.

Please do one focused follow-up pass:

  • address the blocking github-actions review requesting changes on the path normalization in scripts/agent-report-progress.sh, explicit return handling for non-matching diagnostics, the GH_AW_REFLECT_TIMEOUT_MS NaN guard, and the hermetic prompt-dir setup in notify_comment_error.test.cjs
  • investigate the failing check: impacted-go-tests — https://github.com/github/gh-aw/actions/runs/32795082842/job/97644647104
  • refresh the branch if needed and use the pr-finisher skill before handing back for review

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

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 14.8 AIC · ⌖ 9.31 AIC · ⊞ 8.7K ·
Comment /souschef to run again

dsyme and others added 5 commits August 25, 2026 03:06
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>
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 Aug 25, 2026

Copy link
Copy Markdown
Contributor

gh-aw-pr-sous-chef
@copilot PR Sous Chef triage: this PR still needs a forward-progress pass before maintainer investigation is likely to be productive.
...

Addressed in 915a972ff4, 81a05026a1, and bc90bcde18:

  • restored change-scoped Go lint filtering with path normalization and blocking non-diagnostic/analyzer failures
  • added guarded GH_AW_REFLECT_TIMEOUT_MS parsing with tests
  • switched notify_comment_error.test.cjs to hermetic runtime prompt templates
  • investigated the impacted-go-tests failure; the timeout test now passes locally and in the newer check run
  • fixed the deployed usage summary script to remain dependency-free while preserving session-log glob depth

Validated with targeted JS/Go tests, make test-js, and make agent-report-progress.

Copilot AI requested a review from gh-aw-bot August 25, 2026 01:48
@dsyme
dsyme merged commit 012c51f into main Aug 25, 2026
44 checks passed
@dsyme
dsyme deleted the fix/local-full-test-suites branch August 25, 2026 09:49
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.

5 participants