-
Notifications
You must be signed in to change notification settings - Fork 2.5k
feat(core): allow executors to specify if they are continuous #30821
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
88841ad
to
f4feaf5
Compare
f4feaf5
to
5c3577d
Compare
View your CI Pipeline Execution ↗ for commit 49b3888.
☁️ Nx Cloud last updated this comment at |
66b6ced
to
85c2d68
Compare
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.
Pull Request Overview
This PR introduces support for executors to specify their continuous behavior through the executor schema. Key changes include updating the executor schema normalization to include a "continuous" boolean flag, modifying tests to expect the "continuous" key, and refactoring executor parsing across the codebase.
Reviewed Changes
Copilot reviewed 60 out of 68 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
packages/nx/src/project-graph/utils/project-configuration-utils.spec.ts | Updated test assertions to include “continuous”: false in normalized targets. |
packages/nx/src/project-graph/utils/normalize-project-nodes.ts | Removed unused TargetConfiguration import. |
packages/nx/src/project-graph/plugins/public-api.ts | Updated documentation for projects configuration. |
packages/nx/src/plugins/package-json/create-nodes.ts | Refactored readTargetsFromPackageJson call to use additional parameters. |
packages/nx/src/devkit-internals.ts | Updated export to include parseExecutor from executor-utils. |
packages/nx/src/config/to-project-name.spec.ts | Updated inline snapshot to include the continuous property. |
packages/nx/src/config/misc-interfaces.ts | Added an optional “continuous” flag to the executor schema interface. |
packages/nx/src/command-line/run/* | Replaced direct executor string split with parseExecutor for robust parsing. |
packages/devkit/src/executors/read-target-options.ts | Aligned executor parsing with new parseExecutor usage. |
packages/cypress/src/utils/start-dev-server.ts | Updated executor parsing imports to include parseExecutor. |
e2e/angular/src/config.test.ts | Changed e2e builder from Cypress to Playwright with updated options. |
Files not reviewed (8)
- packages/angular/src/builders/dev-server/schema.json: Language not supported
- packages/angular/src/executors/module-federation-dev-server/schema.json: Language not supported
- packages/angular/src/executors/module-federation-ssr-dev-server/schema.json: Language not supported
- packages/expo/src/executors/run/schema.json: Language not supported
- packages/expo/src/executors/serve/schema.json: Language not supported
- packages/expo/src/executors/start/schema.json: Language not supported
- packages/js/src/executors/verdaccio/schema.json: Language not supported
- packages/next/src/executors/server/schema.json: Language not supported
Comments suppressed due to low confidence (2)
packages/nx/src/project-graph/utils/project-configuration-utils.spec.ts:1666
- [nitpick] Consider adding an additional test case to verify behavior when the executor schema specifies continuous as true.
"continuous": false,
e2e/angular/src/config.test.ts:138
- [nitpick] Ensure that the updated Playwright configuration fully replaces the previous Cypress logic and that any related test references have been updated accordingly.
"builder": "@nx/playwright:playwright",
): [module: string, name: string] { | ||
return executorString.split(':') as [string, string]; |
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.
Consider validating that the executorString contains a colon delimiter before splitting, to prevent potential runtime errors if the format is unexpected.
): [module: string, name: string] { | |
return executorString.split(':') as [string, string]; | |
): [module: string, name: string] { | |
if (!executorString.includes(':')) { | |
throw new Error( | |
`Invalid executor string "${executorString}". Expected format: "module:name".` | |
); | |
} |
Copilot uses AI. Check for mistakes.
010b8cd
to
22d8507
Compare
10c60f8
to
49b3888
Compare
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. |
Current Behavior
The only way to set if a task is continuous is either directly in
project.json
or via Project Graph Plugins.Expected Behavior
Executors know if they are definitely continuous or not. Plenty of existing continuous tasks are using executors. Executors are now able to define if they are continuous in their
schema.json
files. Thus, existing tasks configured with certain executors will automatically become continuous.Related Issue(s)
Fixes #