Skip to content

Add AWF installer failure and platform regression coverage - #76193

Merged
pelikhan merged 4 commits into
mainfrom
copilot/harden-awf-binary-installation-step
Nov 9, 2026
Merged

pelikhan merged 4 commits into
mainfrom
copilot/harden-awf-binary-installation-step

Conversation

Copilot AI commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

AWF startup failures need actionable download diagnostics, and Windows-generated install steps must use the supported Bash shell. The installer already retries downloads and verifies checksums; this change adds regression coverage for those behaviors and platform-specific lock generation.

  • Download diagnostics: Simulate a failed curl request and verify its underlying error is preserved in the installer output.
  • Platform lock files: Verify generated Linux and Windows locks retain the checksum pin, and Windows selects Bash while Linux keeps its default shell.
- name: Install AWF binary
  shell: bash # Windows runner
  run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.28.62 --checksums-sha256 <digest>

Copilot AI changed the title [WIP] Harden AWF binary installation startup step Add AWF installer failure and platform regression coverage Nov 9, 2026
Copilot AI requested a review from gh-aw-bot November 9, 2026 09:02
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Category: feature | Risk: medium | Score: 54 (Impact 26 + Urgency 14 + Quality 14) | Action: batch_review | Batch: agent-runtime | Summary: installer failure diagnostics and platform regression coverage; important but broad enough for the grouped reliability review.

Generated by 🔧 PR Triage Agent · copilot · mai11 · ~7 AIC · ⌖ ~1 AIC · ⊞ 16K · ◷

@pelikhan
pelikhan marked this pull request as ready for review November 9, 2026 12:42
Copilot AI adaptive review requested due to automatic review settings November 9, 2026 12:42
@github-actions

github-actions Bot commented Nov 9, 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 Nov 9, 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 from Ponytail Reviewer · routed: gpt61 medium · ~5 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 181 · ◷

Generated by Ponytail Reviewer for #76193

@github-actions

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

Generated from Test Quality Sentinel · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 7.2K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

Generated by PR Specification Reviewer for #76193

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

Design Decision Gate 🏗️

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 from Design Decision Gate 🏗️ · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 8.6K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

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

Reviewed head 463d3f87a60cbe4d9a8fedef32e2cdb5275c93c2 against security architecture spec TT-01/TT-02 and compiler shell-boundary requirements.

Blocking finding: the new Windows regression assertion requires shell: bash, but the current AWF installer generator emits no shell override, leaving GitHub Actions to select PowerShell for windows-latest; the generated Bash command therefore is not covered by a passing regression. See the inline comment on pkg/workflow/awf_installer_integration_test.go:84.

No specification synchronization is proposed: this is an implementation/conformance gap, not an evidenced intentional contract change. Static review only; tests were not run per review policy.

Generated by PR Specification Reviewer for #76193 · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.7K
Comment /review-specs to run again

t.Errorf("generated %s lock file lacks the pinned installer command:\n%s", runner, installStep)
}
if runner == "windows-latest" {
if !strings.Contains(installStep, "shell: bash") {

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 regression assertion currently fails against the generator in pkg/workflow/copilot_engine_installation.go: the emitted AWF step always has run: bash "${RUNNER_TEMP}/... but no shell: bash, so on windows-latest GitHub Actions uses its default PowerShell shell and does not execute this Bash command as intended. Please update the generator (adding the explicit Bash shell only for Windows) or otherwise make the lock output satisfy this assertion before treating the platform regression as covered. This is especially important for the hardened AWF bootstrap covered by security architecture TT-01/TT-02.

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 lock test now asserts the exact pinned run: bash ... --rootless command, requires shell: bash on Windows, and rejects an explicit shell override on Linux. The focused lock test passes. Commit: b787dc0.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-11-09T12:50:00Z
review_event: COMMENT
top_themes: [test diagnostics assertions, generated-step boundary robustness]
files_reviewed: [actions/setup/sh/install_awf_binary_test.sh, pkg/workflow/awf_installer_integration_test.go]
comment_count: 2

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
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 · copilot · gpt50 · ~4 AIC · ⌖ ~1 AIC · ⊞ 1.6K · ◷
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.

Found two test-quality issues in the added coverage:

  • The curl diagnostic assertion checks only fake stderr passthrough, not the installer-generated error details.
  • The lock-step extraction can fall back to the rest of the lock file when the install step is last, allowing unrelated content to satisfy shell assertions.

No runtime code issues were identified from the changed lines. Review was static; tests were not run per the review instructions.

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

t.Fatalf("generated %s lock file lacks the AWF install step:\n%s", runner, lock)
}
installStepEnd := strings.Index(lockText[installStepStart+1:], "\n - ")
installStep := lockText[installStepStart:]

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.

If the install step is the final step, installStep falls back to the remainder of the entire lock file. The shell checks can then match unrelated later content, weakening the regression test and potentially causing false results as generated steps change. Please bound the slice at the next step or the end of the steps section, and fail if the boundary cannot be identified.

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 lock test now bounds the install-step slice at the next step or end of the steps section and fails if it cannot identify that boundary. Commit: b787dc0.

local expected_downloads=2
if [ -n "$curl_failure_asset" ]; then
expected_downloads=$((expected_downloads + 1))
if ! grep -qF "simulated curl network failure" "${test_dir}/output"; then

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.

The assertion currently proves only that the fake curl stderr was inherited by the captured output. It does not verify the installer actual diagnostic (Failed to download awf-bundle.js plus the curl exit/status), so a change that drops or misformats the installer error could still pass. Please assert the installer-generated error details as well, or narrow the test description to stderr passthrough.

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 optional-download case now checks the installer’s Failed to download diagnostic and HTTP/curl exit details as well as the simulated curl stderr. Commit: b787dc0.

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.

🟢 Approval recommended

No active review issues remain in the supplied evidence.

No open issues 🎉

What changed in this PR

Adds regression coverage for AWF installer download diagnostics and platform-specific workflow lock generation, including checksum preservation and Windows Bash selection.

Changes:

  • Simulates failed AWF bundle downloads and verifies underlying curl errors are retained.
  • Adds Linux and Windows lock-generation coverage for checksum pins and shell behavior.
  • Requires stronger assertions for the complete Windows Bash command and Linux’s absence of an explicit shell override.

This pull request requires changes.

File Summary
pkg/​workflow/​awf_installer_integration_test.go Adds Linux and Windows lock-generation tests for checksum pins and shell selection. The assertions should verify the complete Windows run: bash ... command and ensure Linux has no step-level shell: override.
actions/​setup/​sh/​install_awf_binary_test.sh Adds simulated curl-failure coverage and verifies that underlying download diagnostics remain in installer output.

Review effort: Lite (auto)

@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 /tdd and /diagnosing-bugs. Requesting changes on one counting bug in the new bash case. The Go lock test is solid.

📋 Key Themes & Highlights

Key Themes

  • Counting bug: line 248 overwrites the download count added at line 240, so v0.29.x plus a failing asset expects 3 downloads and gets 4. Fix: use + 1.
  • Coverage gap: the new case covers only the optional-bundle fallback. A required download failing (non-zero exit) has no diagnostics assertion.

Positive Highlights

  • ✅ The mutation check works: reverting the 2>/dev/null diagnostics change makes the new case fail, while the rest of the suite passes at 22/22 on the baseline.
  • ✅ TestAWFInstallerLockUsesBashOnLinuxAndWindows ran both subtests and passes. It pins the checksum and the Bash-only-on-Windows behavior through the real compiler.
  • ✅ The curl_failure_asset parameter is threaded through the harness cleanly and defaults to a no-op.

@copilot please address the review comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~6 AIC · ⌖ ~2 AIC · ⊞ 6.3K
Comment /matt to run again

else
fail "mismatched release identity was accepted" "$TEST_FAILURE_REASON"
fi
if test_curl_retry_all_errors '--retry-all-errors' true false '--retry-all-errors' v24.0.0 Linux v0.28.62 '' v0.28.62 awf-bundle.js; then

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.

[/diagnosing-bugs] This case only exercises the optional awf-bundle.js fallback, where the installer recovers. The failure this PR targets, a required download (checksums or the binary) failing and exiting non-zero, has no diagnostics assertion. The harness returns early on a non-zero exit before the output check runs, so that path is currently untested.

💡 Suggested test

Add an expected-failure variant that asserts the installer exits non-zero and that its output contains both the simulated curl error and the ERROR: Failed to download <asset> line with the curl exit code. I confirmed that a failing awf-linux-x64 under Node v18 makes the installer exit non-zero, so this scenario is reachable from this harness.

@copilot please address this.

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 an expected-failure test for a required checksums download: it requires a nonzero installer exit and checks the simulated curl error, failed asset, HTTP status, and curl exit code. Commit: b787dc0.

fi
fi
if [ "$release_version" = v0.29.5 ] || [ "$release_version" = v0.29.6 ] || [ "$release_version" = v0.29.7 ]; then
expected_downloads=3

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.

[/tdd] Line 248 overwrites the +1 that the failing-asset block adds on line 240. For v0.29.5, v0.29.6 and v0.29.7 with a failing asset, the harness expects 3 downloads but the installer makes 4, so this combination fails spuriously.

💡 Suggested change

Change line 248 to an increment so both adjustments compose:

    expected_downloads=$((expected_downloads + 1))

Verified locally: a v0.29.5 run with a failing awf-bundle.js reports expected 3 downloads, got 4 before this change and passes after it. The full suite stays at 22/22.

@copilot please address this.

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 modern-release download count now increments rather than overwriting the failed-asset adjustment; the optional bundle failure test exercises that combined case on v0.29.5. Commit: b787dc0.

@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/awf_installer_integration_test.go:84): address unresolved feedback - Review comment
  3. Review (pkg/workflow/awf_installer_integration_test.go:76): address unresolved feedback - Review comment
  4. Review (actions/setup/sh/install_awf_binary_test.sh:241): address unresolved feedback - Review comment
  5. Review (actions/setup/sh/install_awf_binary_test.sh:361): address unresolved feedback - Review comment
  6. Review (actions/setup/sh/install_awf_binary_test.sh:248): address unresolved feedback - Review comment
  7. Fix failing check impacted-go-tests (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": "463d3f87a60cbe4d9a8fedef32e2cdb5275c93c2",
  "kind": "requested",
  "schema_version": "1",
  "state": "363f3996da899446210bc3ce1fe6465b675319cd17e5b490b78512f0ef30618f",
  "work": [
    "42e5d572d9d75b7168fe7d0aeda0717cc07e65ed240f6d299e6fec661214f1ac",
    "84d44db58e38a1f12953f2030388172a12e3dd0c37d43074de61ddb8a690dff4",
    "ce97ddf2bdd4823b9f4410534c4a6f17e955bb6e123d5e7694de7713559e1507",
    "e5ab38bbd5181fc7cdc93a127d63135f972f7bf3c24d65204b38957c5e380ad8",
    "efe1f598cb3445a811048f1b3e769f9168ef0623bad2928d399863a77a0c26a8",
    "fcb34c5837af90ec12f7b590598907b91def766b15b0d61569197d53cdf45864"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · haiku45 · ~11 AIC · ⌖ ~14 AIC · ⊞ 1.3K · ◷
Comment /souschef to run again

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

🍳 The prep is done, but CI needs another taste test. Copilot's assigned task has finished; these checks are still failing: Completed task

Flagging the remaining blockers for maintainer investigation, not starting another copy of the same task.

Structured data
{
  "completed_task": 42625310989,
  "head": "b787dc002945ef59c168083fdf558f7a711f4900",
  "kind": "ci-follow-up",
  "schema_version": "1",
  "state": "ea1df1938408fe3816906d54718d203d11c750f772d45d00032b1ced173b16ab",
  "work": [
    "42e5d572d9d75b7168fe7d0aeda0717cc07e65ed240f6d299e6fec661214f1ac"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · haiku45 · ~4 AIC · ⌖ ~17 AIC · ⊞ 1.3K · ◷
Comment /souschef to run again

@pelikhan
pelikhan merged commit 9c16098 into main Nov 9, 2026
91 of 92 checks passed
@pelikhan
pelikhan deleted the copilot/harden-awf-binary-installation-step branch November 9, 2026 15:05
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.2.2

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.

[AW Top 10] 05 Harden AWF binary installation startup step

4 participants