You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(core): do not run sync generators when running tasks in ci (#30591)
## Current Behavior
When running tasks, Nx will run and check the sync generators associated
with the task graph. While locally this is desirable to ensure the code
is always up to date while making changes, in CI, we don't make changes
that need to be synced or checked for every task. This is suboptimal,
and it results in duplicate processing.
## Expected Behavior
Sync generators should not run when running tasks in CI. To validate the
sync status, it is recommended to have a dedicated early step in the CI
pipeline that runs `nx sync:check` once.
## Related Issue(s)
Fixes #
(cherry picked from commit 220023d)
'Make sure to run `nx sync` to apply the identified changes or set `sync.applyChanges` to `true` in your `nx.json` to apply them automatically when running tasks in interactive environments.';
336
-
constwillErrorOnCiMessage='This will result in an error in CI.';
337
336
338
-
if(isCI()||!process.stdout.isTTY){
339
-
// If the user is running in CI or is running in a non-TTY environment we
337
+
if(!process.stdout.isTTY){
338
+
// If the user is running a non-TTY environment we
340
339
// throw an error to stop the execution of the tasks.
341
340
if(areAllResultsFailures){
342
341
output.error({
@@ -394,7 +393,6 @@ async function ensureWorkspaceIsInSyncAndGetGraphs(
394
393
...resultBodyLines,
395
394
'',
396
395
'Your workspace is set to not apply the identified changes automatically (`sync.applyChanges` is set to `false` in your `nx.json`).',
397
-
willErrorOnCiMessage,
398
396
fixMessage,
399
397
],
400
398
});
@@ -418,10 +416,12 @@ async function ensureWorkspaceIsInSyncAndGetGraphs(
418
416
title: outOfSyncTitle,
419
417
bodyLines: [
420
418
...resultBodyLines,
421
-
'',
422
-
nxJson.sync?.applyChanges===true
423
-
? 'Proceeding to sync the identified changes automatically (`sync.applyChanges` is set to `true` in your `nx.json`).'
424
-
: willErrorOnCiMessage,
419
+
...(nxJson.sync?.applyChanges===true
420
+
? [
421
+
'',
422
+
'Proceeding to sync the identified changes automatically (`sync.applyChanges` is set to `true` in your `nx.json`).',
0 commit comments