Skip to content

Harden temporary files and fix Windows installer test compatibility - #76974

Merged
pelikhan merged 4 commits into
mainfrom
pelikhan/workflow-failure-investigation
Nov 11, 2026
Merged

pelikhan merged 4 commits into
mainfrom
pelikhan/workflow-failure-investigation

Conversation

@pelikhan

Copy link
Copy Markdown
Collaborator

Summary

Private installer-log regression tests introduced in #76954 failed on Windows because Git Bash/MSYS symlink and permission behavior differs from Unix. Skip only these Unix-dependent scenarios on MINGW, MSYS, and Cygwin, and verify that the planted symlink exists before running the installer on supported hosts.

This branch also includes the temporary-file hardening from #76954: private cache-commit diagnostics and installer logs, exclusive MCP shell-output allocation, cleanup, and regression coverage. The changes overlap #76954, and the focused Windows test fix has already been pushed to that PR as well.

Validation

  • Shell syntax and all four isolated private-log scenarios passed on macOS.
  • Simulated MINGW, MSYS, and Cygwin dispatches skipped the fixture without invoking an installer.
  • The final repository validation gate passed for the focused fix.
  • Read-only security review of the focused test change passed with no confirmed vulnerabilities.

Hosted Windows execution remains unverified. No workflows were manually dispatched.

Relates to #76954.

pelikhan and others added 3 commits November 11, 2026 12:14
…aller logs

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review November 11, 2026 21:57
Copilot AI dynamic review requested due to automatic review settings November 11, 2026 21:57
@github-actions

github-actions Bot commented Nov 11, 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 commented Nov 11, 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 11, 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 11, 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.5K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

PR Specification 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 PR Specification Reviewer · gpt56 · ~3 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 1.6K · ◷

Generated by PR Specification Reviewer for #76974

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Generated by Ponytail Reviewer for #76974

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

What this change does: It makes temporary output and diagnostic files private and cleans them up. It also skips Unix-specific installer tests on Windows.

One simplification is noted inline: the installer can print diagnostics directly without saving and replaying them.

Verdict: fix 1 first.
Lean: -10 lines possible.

Generated by ✂️ Ponytail Reviewer for #76974 · codex · routed: gpt61 medium · ~5 AIC · ⌖ ~1 AIC · ⊞ 181
Comment /ponytail to run again

Comment thread install-gh-aw.sh Resolved

@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 blocking issues: the new private log allocation failure aborts installation instead of preserving the manual fallback, and the new regression suite is skipped on the Windows environments this change targets. Inline comments explain the required fixes. Static review only; tests were not run per review instructions.

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

Comment thread scripts/test-install-script.sh Resolved
Comment thread install-gh-aw.sh Resolved
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan

Copy link
Copy Markdown
Collaborator Author

Regarding the Matt Pocock Skills Reviewer notification: no code change is needed because this is a review-start notification, not actionable feedback.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Regarding the Test Quality Sentinel notification: no code change is needed because this announces analysis without requesting a fix.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Regarding the PR Code Quality Reviewer notification: no code change is needed because this is a progress update with no actionable finding.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Regarding the Design Decision Gate notification: no code change is needed because this only announces a check and does not request a design record or identify a missing one.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Regarding the PR Specification Reviewer notification: no code change is needed because this is a processing notification without a specification finding.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Regarding the Ponytail Reviewer notification: the notification itself needs no code change. The subsequent inline simplification suggestion was accepted and addressed in 46eae24, and its thread is resolved.

@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 test wiring, platform coverage, and one behavior change in the commit step.

📋 Key Themes & Highlights

Key Themes

  • Untested new path: the commit-diagnostics tests are not referenced by the Makefile or any workflow, so they never run.
  • Unguarded Windows assertions: the new symlink and 0o700 mode checks in mcp_handler_shell.test.cjs have no platform skip.
  • Hard-fail change: under set -euo pipefail, an mktemp failure now fails the always-run commit step.

Positive Highlights

  • ✅ Private mktemp directories and wx+ fd-based reads close the fixed-name symlink race.
  • ✅ Cleanup ordering in the JS finally is correct: outputs are read through the fd before the directory is removed.
  • ✅ Installer trap is safe under set -u, because STAGING_DIR and GH_INSTALL_LOG_DIR are initialized before the trap is set.
  • ✅ The test-exit semantics in the test_private_* subshells propagate failures correctly.

@copilot please address the review comments above.

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

)

echo "Test 4: Private commit diagnostics preserve behavior and clean up"
for scenario in success error benign allocation-failure; do

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] The new Test 4 never runs in CI. commit_cache_memory_git_test.sh is not listed in the Makefile test targets (around line 573) or in any workflow, so the sentinel, legacy-link, and allocation-failure guarantees are unverified.

💡 Suggested wiring

Add a line next to the other _test.sh entries in the Makefile, for example:

	bash actions/setup/sh/commit_cache_memory_git_test.sh

and make sure the target runs in a CI job, so that regressions in the private-diagnostics path are caught.

@copilot please address this.

const sentinel = path.join(tempDir, "sentinel");
fs.writeFileSync(sentinel, "external=unchanged");
const legacyPath = path.join(tempDir, `mcp-shell-output-123-${(0.5).toString(36).substring(2)}.txt`);
fs.symlinkSync(sentinel, legacyPath);

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] The symlink test and the POSIX mode assertion on line 212 are unguarded. fs.symlinkSync typically needs elevated rights on Windows, and mode & 0o777 is not meaningful there, so this test would fail on Windows if vitest ever ran there.

💡 Suggested guard

Wrap the symlink and mode cases in a platform guard, for example it.skipIf(process.platform === "win32")(...), or skip the mode check on win32. This keeps the Linux coverage while avoiding false failures on Windows.

@copilot please address this.

# Commit on the current integrity branch; allow empty commits in case
# the agent made no changes (idempotent).
if git -c commit.gpgSign=false commit --no-verify --allow-empty -m "run-${RUN_ID}" -q 2>/tmp/gh-aw-commit-err; then
COMMIT_TEMP_DIR=$(mktemp -d "${TMPDIR:-/tmp}/gh-aw-commit.XXXXXX")

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 is a behavior change. Under set -euo pipefail, an mktemp failure now aborts the post-agent commit step. That step runs with if: always() and no continue-on-error, so a failure in diagnostics-only plumbing now fails the job. The previous path was best-effort.

💡 Suggested fix

If the hard failure is not intended, fall back to a non-fatal path (for example, log a warning and skip the diagnostics file) instead of exiting. The test at allocation failure propagates currently locks in the hard failure, so update it too if the fallback is chosen. If the hard failure is intended, state that in the PR description.

@copilot please address this.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Regarding 6808032547: no code change is needed because this is a review-start notification, not actionable feedback.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Regarding 6808032956: completion is noted, with no specific fix requested. The reported_no_action result is not treated as proof of tests or publication.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Regarding 6808032976: the completion notification itself needs no code change. Its two separate inline findings are addressed by 46eae24 and have received individual replies.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Regarding 6808033653: no missing ADR or actionable design finding is supplied, so no change is needed. The reported_no_action status does not establish implementation correctness or publication.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Regarding 6808033963: no specification finding requiring a change is supplied. The reported_no_action status is not treated as validation evidence.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Regarding 6808034339: the completion notification needs no code change. The separate installer simplification suggestion was implemented in 46eae24.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Regarding 6808273033: the earlier assessment still holds; the linked review-start notification requests no code change.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Regarding 6808273348: the original notification now reports completion rather than ongoing analysis. It still supplies no specific fix, so no code change is needed.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Regarding 6808273676: the original notification now reports completion. Its separate inline findings are both addressed by 46eae24; the status comment itself needs no code change.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Regarding 6808274024: the gate now reports completion but identifies no missing ADR requiring a change. No code change is needed for this acknowledgment.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Regarding 6808274346: the specification review now reports completion rather than processing, without a finding requiring action. No code change is needed.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Regarding 6808274745: this acknowledgment correctly records the simplification in 46eae24 and resolution of its thread. No further code change is needed.

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.

🟡 Changes recommended

Scenario subshells inherit TESTS_FAILED, causing earlier failures to incorrectly mark later passing scenarios as failed.

1 open issue
What changed in this PR

Hardens temporary-file handling in gh-aw’s installer and action helpers, incorporating the work from #76954 and adapting installer regression tests for Windows shell behavior.

Changes:

  • Store cache diagnostics and installer logs in private temporary directories with cleanup.
  • Allocate MCP shell outputs exclusively and retain the original file descriptor for readback.
  • Add regression coverage and skip Unix-dependent installer-log scenarios on Windows hosts.
File Description
scripts/​test-install-script.sh Adds private-log regressions, symlink verification, and Windows skips.
install-gh-aw.sh Uses private installer logs and centralized cleanup.
actions/​setup/​sh/​commit_cache_memory_git.sh Isolates commit diagnostics and cleans up temporary files.
actions/​setup/​sh/​commit_cache_memory_git_test.sh Adds diagnostic, cleanup, and allocation-failure regressions.
actions/​setup/​js/​mcp_handler_shell.test.cjs Tests private allocation, safe readback, and cleanup.
actions/​setup/​js/​mcp_handler_shell.cjs Creates private outputs exclusively and reads through the original descriptor.
actions/​setup-cli/​install.sh Mirrors installer log hardening and cleanup.

Review effort: Max (auto)

echo ""

test_private_commit_diagnostics() (
local scenario="$1"
@pelikhan
pelikhan merged commit 3e1d95c into main Nov 11, 2026
96 checks passed
@pelikhan
pelikhan deleted the pelikhan/workflow-failure-investigation branch November 11, 2026 22:22
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.2.3

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.

2 participants