-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat(core): support providing schema in sync generators #33060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
👷 Deploy request for nx-docs pending review.Visit the deploys page to approve it
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
View your CI Pipeline Execution ↗ for commit 89bb354
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nx Cloud has identified a possible root cause for your failed CI:
The failures in both e2e test tasks are classified as environment_state issues unrelated to the pull request's code changes.
Task: e2e-react:e2e-ci--src/react-rspack.test.ts
This task failed during Playwright browser installation with a "Hash Sum mismatch" error when downloading from Google's Chrome APT repository (dl.google.com). The error shows that the expected and received SHA256 hashes don't match, indicating either a corrupted mirror, a mid-update sync issue, or network corruption. This is a transient external service failure that has no connection to the sync generator schema changes introduced in this PR.
Task: e2e-playwright:e2e-ci--src/playwright.test.ts
This task failed because Playwright tests could not connect to localhost:4200 (NS_ERROR_CONNECTION_REFUSED / Connection refused). The dev server that should have been running was not accessible, which indicates either a timing issue where tests started before the server was ready, a port conflict, or the server failed to start due to resource constraints in the test environment. This is a test infrastructure issue unrelated to the sync generator changes.
The PR modifies how sync generators receive schema-based configuration options by:
- Changing the SyncGenerator type signature to accept a schema parameter
- Updating runSyncGenerator to use combineOptionsForGenerator
- Passing projectsConfigurations and nxJsonConfiguration to all sync generator invocations
None of the failures reference these modified files or functions. The errors are purely environmental - external package repository issues and test server availability problems. These types of failures are common in CI environments and typically resolve on retry or when the external services recover.
A code change would likely not resolve this issue, so no action was taken.
🎓 To learn more about Self Healing CI, please visit nx.dev
89bb354 to
15da9f7
Compare
|
👍 interested |
| projectsConfigurations.projects | ||
| ); | ||
|
|
||
| // Combine options from nx.json and project configuration (no command line options for sync generators) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really just reading the config from the nx.json config right? Sync generators are ran once per workspace, not once per project, so there's not really a way to narrow down which project's options should be read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, since we’re inferring all project configurations — including sync generators — this feature is essential for us.
In some cases, we configure a sync generator on an existing target, but more commonly, we generate a dedicated sync target that contains a sync generator specific to the project type.
We also configure sync generators at the root project level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AgentEnder any thoughts related to my reply? :)
Summary
Align sync generator invocation with regular generators by providing schema-based options from
nx.jsonand project configuration.Current Behavior
Currently, sync generators are invoked with only a
Treeparameter and do not receive any configuration options from the generator's schema,nx.json, or project configuration:This means sync generators cannot:
Expected Behavior
Sync generators should receive combined options from their schema, just like regular generators do, but without command-line arguments (since they're not invoked directly by users).
Related Discussion
Related to #32663