Skip to content

fix(core): cnw sends correct selectedRepositoryName; prints instructions when user Ctrl+C#33699

Merged
jaysoo merged 2 commits intomasterfrom
feat/cnw-sigint
Dec 4, 2025
Merged

fix(core): cnw sends correct selectedRepositoryName; prints instructions when user Ctrl+C#33699
jaysoo merged 2 commits intomasterfrom
feat/cnw-sigint

Conversation

@jaysoo
Copy link
Copy Markdown
Member

@jaysoo jaysoo commented Dec 3, 2025

This PR adds SIGINT handling when user kills the process via Ctrl+C during CNW. This only prints when the workspace setup is complete, and we also print the Cloud onboarding URL if it has been set up.

Also fixes an issue where selectedRepositoryName is never sent during CNW.

@vercel
Copy link
Copy Markdown

vercel Bot commented Dec 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nx-dev Ready Ready Preview Dec 4, 2025 6:47pm

@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 3, 2025

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 71197e8
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/6931d5b61c91b300085f2ff1
😎 Deploy Preview https://deploy-preview-33699--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented Dec 3, 2025

View your CI Pipeline Execution ↗ for commit 71197e8

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ✅ Succeeded 34m 51s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 2m 49s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 12s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-12-04 19:20:18 UTC

## Current Behavior

When running `create-nx-workspace` with GitHub push flow, the Nx Cloud
onboarding URL does not include the repository name. This is because
`getVcsRemoteInfo()` is called before `pushToGitHub()` creates the git
remote, and it runs in the wrong directory (cwd instead of the new
workspace).

## Expected Behavior

The onboarding URL should include the repository name so Nx Cloud can
auto-detect the repo when users click the connect link.

## Changes

1. Reorder operations: create onboarding URL after git push completes
2. Add optional `directory` parameter to `getVcsRemoteInfo()` and
   `createNxCloudOnboardingURL()` so CNW can pass the workspace path
3. Remove `connectUrl` from `initializeGitRepo()` call (no longer needed
   in commit message)

## Related Issue(s)

Fixes CLOUD-3976

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@jaysoo jaysoo changed the title feat(core): print instructions to finish workspace setup during CNW if users kills the process chore(core): CNW sends correct selectedRepositoryName; prints instructions when user Ctrl+C Dec 4, 2025
@jaysoo jaysoo requested review from a team and MaxKless as code owners December 4, 2025 18:40
forceManual = false,
forceGithub = false
forceGithub = false,
directory?: string
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed during CNW, since the process.cwd() is not where the Nx workspace is. During nx connect or nx init it was fine but CNW never worked to find git remote info.


if (connectUrl) {
// Create onboarding URL AFTER git operations so getVcsRemoteInfo() can detect the repo
let connectUrl: string | undefined;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to move the createNxCloudOnboardingUrl function to after GitHub repo is (potentially) pushed. Otherwise, the remote info will never exist.

In the future we can see if passing the directory name and GitHub username (if we can get it from gh) are good fallback options.

@jaysoo jaysoo changed the title chore(core): CNW sends correct selectedRepositoryName; prints instructions when user Ctrl+C fix(core): cnw sends correct selectedRepositoryName; prints instructions when user Ctrl+C Dec 4, 2025
@jaysoo jaysoo merged commit aba0eb2 into master Dec 4, 2025
20 of 21 checks passed
@jaysoo jaysoo deleted the feat/cnw-sigint branch December 4, 2025 19:27
barbados-clemens pushed a commit that referenced this pull request Dec 8, 2025
…ons when user Ctrl+C (#33699)

This PR adds `SIGINT` handling when user kills the process via `Ctrl+C`
during CNW. This only prints when the workspace setup is complete, and
we also print the Cloud onboarding URL if it has been set up.

Also fixes an issue where `selectedRepositoryName` is never sent during
CNW.

---------

Co-authored-by: Claude <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Dec 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants