Skip to content

fix(ci): log stderr when yarn cedar g secret fails on Windows#1789

Merged
Tobbe merged 3 commits into
cedarjs:mainfrom
lisa-assistant:lisa/debug-dbauth-secret-failure
May 15, 2026
Merged

fix(ci): log stderr when yarn cedar g secret fails on Windows#1789
Tobbe merged 3 commits into
cedarjs:mainfrom
lisa-assistant:lisa/debug-dbauth-secret-failure

Conversation

@lisa-assistant

Copy link
Copy Markdown
Contributor

Summary

Fixes a recurring flaky CI failure where yarn cedar g secret --raw exits with code 1 on Windows (seen in PRs #1757, #1775, #1778, #1773) but produces no visible diagnostic output — making it impossible to debug.

Root cause of the silence: the command was called with silent: true. When getExecOutput from @actions/exec throws on a non-zero exit code, the buffered stdout/stderr are discarded — so nothing about the actual failure was ever logged.

Changes

.github/actions/set-up-test-project/setUpTestProject.mts

  • Switch yarn cedar g secret --raw from silent: true to ignoreReturnCode: true
  • Manually check the exit code and log captured stdout + stderr before re-throwing
  • Update the Args TypeScript interface to expose ignoreReturnCode?: boolean in options and exitCode: number in the return type (the underlying getExecOutput already supports/returns both — the interface was just incomplete)

docs/implementation-plans/flaky-windows-smoke-tests-investigation.md

  • Documents this as the 4th occurrence across 4 unrelated PRs
  • Clarifies what's actually failing: yarn cedar g secret --raw (not yarn install — the log interleaving is misleading)
  • Notes the debug improvement applied

What this doesn't fix

The underlying cause of yarn cedar g secret --raw failing on Windows is still unknown. This PR just ensures the next failure will show the actual error output so we can diagnose it.

@netlify

netlify Bot commented May 15, 2026

Copy link
Copy Markdown

👷 Deploy request for cedarjs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 2e79cb1

@github-actions github-actions Bot added this to the next-release-patch milestone May 15, 2026
@greptile-apps

greptile-apps Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR improves CI debuggability for a recurring Windows failure by adding explicit error logging when yarn cedar g secret --raw exits non-zero — something that was previously invisible because the buffered output was discarded on throw. The underlying root cause of the Windows failure remains unknown, but the next occurrence will now surface the actual error output.

  • setUpTestProject.mts: ignoreReturnCode: true is added alongside the existing silent: true, allowing the exit code to be inspected; on failure, captured stdout/stderr are logged before re-throwing. The Args interface is updated to accurately reflect ignoreReturnCode in options and exitCode in the return type, matching what @actions/exec's getExecOutput already supports.
  • Investigation doc: A 4th-occurrence entry is appended, clarifying that the apparent yarn install failure in CI logs is actually yarn cedar g secret --raw due to log interleaving.

Confidence Score: 5/5

Safe to merge — the change is narrowly scoped to error-handling around a single CI command and does not affect production code paths.

The implementation is correct: ignoreReturnCode: true is forwarded through ...rest in actionsLib.mjs to getExecOutput, which always captures stdout/stderr regardless of silent: true. Keeping silent: true is intentional — it prevents the generated secret from appearing in CI logs on success while still allowing the captured output to be logged manually on failure. The Args interface updates accurately reflect the underlying @actions/exec API.

No files require special attention.

Important Files Changed

Filename Overview
.github/actions/set-up-test-project/setUpTestProject.mts Adds ignoreReturnCode: true alongside silent: true for the secret generation step, manually captures and logs stdout/stderr on failure before re-throwing; interface updated to reflect the options and return type accurately.
docs/implementation-plans/flaky-windows-smoke-tests-investigation.md Appends a new investigation update documenting the 4th occurrence of the Windows CI failure and the debug improvement applied; no functional code changes.

Reviews (2): Last reviewed commit: "style: fix prettier formatting in setUpT..." | Re-trigger Greptile

@nx-cloud

nx-cloud Bot commented May 15, 2026

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 2e79cb1

Command Status Duration Result
nx run-many -t build:pack --exclude create-ceda... ✅ Succeeded 2s View ↗
nx run-many -t build ✅ Succeeded 6s View ↗
nx run-many -t test --minWorkers=1 --maxWorkers=4 ✅ Succeeded 9s View ↗
nx run-many -t test:types ✅ Succeeded 12s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-15 08:45:37 UTC

@Tobbe Tobbe merged commit fc96e7a into cedarjs:main May 15, 2026
43 checks passed
@github-actions

Copy link
Copy Markdown

The changes in this PR are now available on npm.

Try them out by running yarn cedar upgrade -t 5.0.0-canary.2351

Or try it in a new app with yarn dlx create-cedar-app@5.0.0-canary.2351

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