Skip to content

fix(ci): log yarn.lock state after tarsync (debug)#1798

Merged
Tobbe merged 4 commits into
cedarjs:mainfrom
lisa-assistant:lisa/debug-tarsync-lockfile
May 17, 2026
Merged

fix(ci): log yarn.lock state after tarsync (debug)#1798
Tobbe merged 4 commits into
cedarjs:mainfrom
lisa-assistant:lisa/debug-tarsync-lockfile

Conversation

@lisa-assistant
Copy link
Copy Markdown
Contributor

Summary

Adds diagnostic logging after yarn project:tarsync --verbose runs in the test project setup, to help understand the intermittent Windows CI failure where yarn cedar g secret --raw fails with:

Internal Error: root-workspace-0b6124@workspace:.: This package doesn't seem to be present in your lockfile

What this adds

After tarsync completes, we now check:

  1. Did yarn.lock get created at all? (tarsync's internal yarn install errors are silently swallowed — we'd never know if it didn't run)
  2. Does the lockfile contain the root-workspace- entry? — the missing entry is exactly what causes the downstream failure

The next time this fails on Windows, the log will show one of:

  • WARNING: yarn.lock was not created by tarsync! → tarsync's yarn install didn't run or failed very early
  • WARNING: yarn.lock exists but has no root-workspace- entry! → yarn install ran but produced an incomplete lockfile
  • Root workspace entry found: root-workspace-... → lockfile is fine, look elsewhere for the failure

Relates to the investigation in docs/implementation-plans/flaky-windows-smoke-tests-investigation.md.

Test plan

  • Merge and wait for next Windows CI failure to collect diagnostic info

🤖 Generated with Claude Code

…ows failures

After tarsync runs yarn install in the test project, check whether yarn.lock
was created and whether it contains the root-workspace- entry. This surfaces
the failure that tarsync currently swallows silently before yarn cedar g secret
fails with the lockfile error.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented May 16, 2026

👷 Deploy request for cedarjs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit ab27dc6

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 16, 2026

Greptile Summary

Adds diagnostic logging after yarn project:tarsync --verbose in the test-project CI setup to help investigate intermittent Windows failures where yarn cedar g secret --raw errors with a missing root-workspace lockfile entry.

  • Checks whether yarn.lock was created at all (detecting silent tarsync failures), logs the line count with a correct trailing-newline adjustment, and searches for the \"root-workspace-… entry using the Yarn Berry v4 quoted-key format.
  • The two issues caught in the previous review round — off-by-one line count and missing leading \" in startsWith — are both addressed in this version of the code.

Confidence Score: 5/5

This is a purely additive diagnostic-only change that inserts logging after tarsync and before the already-guarded secret generation step; it cannot affect CI outcomes in any direction.

Both previously reported bugs (off-by-one line count and wrong startsWith prefix for Yarn Berry v4 quoted keys) are corrected in this version. The new code reads a file synchronously for logging only and has no effect on the surrounding async flow.

No files require special attention.

Important Files Changed

Filename Overview
.github/actions/set-up-test-project/setUpTestProject.mts Adds post-tarsync diagnostic logging to detect a missing or incomplete yarn.lock; both previously reported issues (off-by-one line count, missing quote prefix in root-workspace search) are already fixed in this version.

Reviews (4): Last reviewed commit: "chore: prettier" | Re-trigger Greptile

Comment thread .github/actions/set-up-test-project/setUpTestProject.mts Outdated
@github-actions github-actions Bot added this to the next-release-patch milestone May 16, 2026
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented May 16, 2026

🤖 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 ab27dc6

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

☁️ Nx Cloud last updated this comment at 2026-05-16 16:47:31 UTC

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented May 16, 2026

🤖 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 69780f4

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

☁️ Nx Cloud last updated this comment at 2026-05-16 10:56:46 UTC

Comment thread .github/actions/set-up-test-project/setUpTestProject.mts Outdated
@Tobbe Tobbe merged commit dac04a2 into cedarjs:main May 17, 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.2359

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

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