Skip to content

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

Merged
merged 3 commits into from
Apr 24, 2025

Conversation

FrozenPandaz
Copy link
Collaborator

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 #

Copy link

vercel bot commented Apr 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Apr 24, 2025 6:30pm

Copy link

nx-cloud bot commented Apr 23, 2025

View your CI Pipeline Execution ↗ for commit 49b3888.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-ci ✅ Succeeded 10m 49s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 21s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 3s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 1s View ↗
nx documentation ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-04-24 20:28:31 UTC

@FrozenPandaz FrozenPandaz force-pushed the continuous-executors branch 2 times, most recently from 66b6ced to 85c2d68 Compare April 23, 2025 21:37
@FrozenPandaz FrozenPandaz marked this pull request as ready for review April 23, 2025 21:41
@FrozenPandaz FrozenPandaz requested review from a team and Coly010 as code owners April 23, 2025 21:41
Copy link
Contributor

@Copilot Copilot AI left a 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",

Comment on lines +42 to +43
): [module: string, name: string] {
return executorString.split(':') as [string, string];
Copy link
Preview

Copilot AI Apr 23, 2025

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.

Suggested change
): [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.

@FrozenPandaz FrozenPandaz force-pushed the continuous-executors branch from 10c60f8 to 49b3888 Compare April 24, 2025 18:20
@FrozenPandaz FrozenPandaz merged commit 4254c4b into master Apr 24, 2025
6 checks passed
@FrozenPandaz FrozenPandaz deleted the continuous-executors branch April 24, 2025 20:41
Copy link

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 Apr 30, 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