From 75521bb64d0343e065f229b1f1351b75ae86b41c Mon Sep 17 00:00:00 2001 From: Craigory Coppola Date: Tue, 1 Apr 2025 20:17:07 -0400 Subject: [PATCH] fix(misc): add missing flag to azure devops ci workflow generator (#30482) ## Current Behavior `-t` is missing in the azure pipelines ci workflow ## Expected Behavior `nx affected` is called with `-t` ## Related Issue(s) Fixes #30331 --- .../__snapshots__/ci-workflow.spec.ts.snap | 20 +++++++++---------- .../ci-workflow/ci-workflow.spec.ts | 2 +- .../files/azure/azure-pipelines.yml__tmpl__ | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/workspace/src/generators/ci-workflow/__snapshots__/ci-workflow.spec.ts.snap b/packages/workspace/src/generators/ci-workflow/__snapshots__/ci-workflow.spec.ts.snap index 595ddaf931..5e763eaa47 100644 --- a/packages/workspace/src/generators/ci-workflow/__snapshots__/ci-workflow.spec.ts.snap +++ b/packages/workspace/src/generators/ci-workflow/__snapshots__/ci-workflow.spec.ts.snap @@ -59,7 +59,7 @@ jobs: # - script: npx nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected # When you enable task distribution, run the e2e-ci task instead of e2e - - script: npx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) lint test build e2e + - script: npx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) -t lint test build e2e " `; @@ -301,7 +301,7 @@ jobs: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - script: bun nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - script: bun nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) lint test build + - script: bun nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) -t lint test build " `; @@ -567,7 +567,7 @@ jobs: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - script: npx nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - script: npx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) lint test build + - script: npx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) -t lint test build " `; @@ -830,7 +830,7 @@ jobs: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - script: pnpm exec nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - script: pnpm exec nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) lint test build + - script: pnpm exec nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) -t lint test build " `; @@ -1108,7 +1108,7 @@ jobs: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - script: yarn nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - script: yarn nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) lint test build + - script: yarn nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) -t lint test build " `; @@ -1370,7 +1370,7 @@ jobs: # - script: npx nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected # When you enable task distribution, run the e2e-ci task instead of e2e - - script: npx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) lint test build e2e + - script: npx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) -t lint test build e2e " `; @@ -1613,7 +1613,7 @@ jobs: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - script: bun nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - script: bun nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) lint test build + - script: bun nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) -t lint test build " `; @@ -1880,7 +1880,7 @@ jobs: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - script: npx nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - script: npx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) lint test build + - script: npx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) -t lint test build " `; @@ -2144,7 +2144,7 @@ jobs: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - script: pnpm exec nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - script: pnpm exec nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) lint test build + - script: pnpm exec nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) -t lint test build " `; @@ -2423,7 +2423,7 @@ jobs: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - script: yarn nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - script: yarn nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) lint test build + - script: yarn nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) -t lint test build " `; diff --git a/packages/workspace/src/generators/ci-workflow/ci-workflow.spec.ts b/packages/workspace/src/generators/ci-workflow/ci-workflow.spec.ts index 94aef2977b..e89d74e670 100644 --- a/packages/workspace/src/generators/ci-workflow/ci-workflow.spec.ts +++ b/packages/workspace/src/generators/ci-workflow/ci-workflow.spec.ts @@ -460,7 +460,7 @@ describe('CI Workflow generator', () => { # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - script: npx nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - script: npx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) lint test build typecheck + - script: npx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) -t lint test build typecheck " `); }); diff --git a/packages/workspace/src/generators/ci-workflow/files/azure/azure-pipelines.yml__tmpl__ b/packages/workspace/src/generators/ci-workflow/files/azure/azure-pipelines.yml__tmpl__ index cb4076372f..e76495f25d 100644 --- a/packages/workspace/src/generators/ci-workflow/files/azure/azure-pipelines.yml__tmpl__ +++ b/packages/workspace/src/generators/ci-workflow/files/azure/azure-pipelines.yml__tmpl__ @@ -68,4 +68,4 @@ jobs: # - script: <%= packageManagerPrefix %> nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected<% if(hasE2E){ %> # When you enable task distribution, run the e2e-ci task instead of e2e<% } %> - - script: <%= packageManagerPrefix %> nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) lint test build<% if(hasTypecheck){ %> typecheck<% } %><% if(hasE2E){ %> e2e<% } %> + - script: <%= packageManagerPrefix %> nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) -t lint test build<% if(hasTypecheck){ %> typecheck<% } %><% if(hasE2E){ %> e2e<% } %>