Skip to content

Conversation

jogelin
Copy link
Contributor

@jogelin jogelin commented Oct 13, 2025

Summary

Align sync generator invocation with regular generators by providing schema-based options from nx.json and project configuration.

Current Behavior

Currently, sync generators are invoked with only a Tree parameter and do not receive any configuration options from the generator's schema, nx.json, or project configuration:

// Before
export type SyncGenerator = (tree: Tree) => SyncGeneratorResult;

This means sync generators cannot:

  • Access generator-specific options defined in their schema
  • Use options configured in nx.json via generators configuration
  • Use project-level generator defaults
  • Apply schema defaults and validations

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

// After
export type SyncGenerator<T = unknown> = (
  tree: Tree,
  schema: T
) => SyncGeneratorResult | Promise<SyncGeneratorResult>;

Related Discussion

Related to #32663

Copy link

netlify bot commented Oct 13, 2025

👷 Deploy request for nx-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 15da9f7

Copy link

vercel bot commented Oct 13, 2025

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

Project Deployment Preview Updated (UTC)
nx-dev Ready Ready Preview Oct 14, 2025 5:53am

Copy link
Contributor

nx-cloud bot commented Oct 13, 2025

View your CI Pipeline Execution ↗ for commit 89bb354

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ❌ Failed 1h 40m 13s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 2m 6s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 5s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 4s View ↗
nx documentation ✅ Succeeded 2m 54s View ↗

☁️ Nx Cloud last updated this comment at 2025-10-13 22:30:15 UTC

Copy link
Contributor

@nx-cloud nx-cloud bot left a 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.

Nx CloudView in Nx Cloud ↗


🎓 To learn more about Self Healing CI, please visit nx.dev

@jogelin jogelin marked this pull request as ready for review October 14, 2025 05:26
@jogelin jogelin requested a review from a team as a code owner October 14, 2025 05:26
@jogelin jogelin requested a review from Cammisuli October 14, 2025 05:26
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.

1 participant