@smoothbricks/nx-plugin 0.4.26 → 0.4.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +994 -117
- package/dist/bin/smoo-nx-bound-failures.d.ts +3 -0
- package/dist/bin/smoo-nx-bound-failures.d.ts.map +1 -0
- package/dist/bin/smoo-nx-bound-failures.js +31 -0
- package/dist/bin/smoo-nx-cargo-hash.js +28 -3
- package/dist/bin/smoo-nx-exec.js +15 -73
- package/dist/bin/smoo-nx-failures.d.ts +3 -0
- package/dist/bin/smoo-nx-failures.d.ts.map +1 -0
- package/dist/bin/smoo-nx-failures.js +3 -0
- package/dist/bin/smoo-nx-nextest-extract.js +3 -2
- package/dist/bin/smoo-nx-test-walks.d.ts +3 -0
- package/dist/bin/smoo-nx-test-walks.d.ts.map +1 -0
- package/dist/bin/smoo-nx-test-walks.js +34 -0
- package/dist/bounded-test-policy.d.ts +7 -1
- package/dist/bounded-test-policy.d.ts.map +1 -1
- package/dist/bounded-test-policy.js +101 -40
- package/dist/build-state-output-policy.d.ts +25 -0
- package/dist/build-state-output-policy.d.ts.map +1 -0
- package/dist/build-state-output-policy.js +64 -0
- package/dist/cargo-closure-input.d.ts +3 -2
- package/dist/cargo-closure-input.d.ts.map +1 -1
- package/dist/cargo-closure-input.js +16 -15
- package/dist/cargo-dev-profile.d.ts +37 -0
- package/dist/cargo-dev-profile.d.ts.map +1 -0
- package/dist/cargo-dev-profile.js +108 -0
- package/dist/cargo-source-hash.d.ts +43 -6
- package/dist/cargo-source-hash.d.ts.map +1 -1
- package/dist/cargo-source-hash.js +309 -73
- package/dist/cargo-toolchain-policy.d.ts +4 -0
- package/dist/cargo-toolchain-policy.d.ts.map +1 -1
- package/dist/cargo-toolchain-policy.js +5 -0
- package/dist/cargo-workspace.d.ts +101 -5
- package/dist/cargo-workspace.d.ts.map +1 -1
- package/dist/cargo-workspace.js +291 -10
- package/dist/cross-check-policy.d.ts +21 -3
- package/dist/cross-check-policy.d.ts.map +1 -1
- package/dist/cross-check-policy.js +24 -6
- package/dist/disk-command-policy.d.ts +7 -0
- package/dist/disk-command-policy.d.ts.map +1 -0
- package/dist/disk-command-policy.js +98 -0
- package/dist/ensure-built-receipt.d.ts +25 -0
- package/dist/ensure-built-receipt.d.ts.map +1 -0
- package/dist/ensure-built-receipt.js +261 -0
- package/dist/ensure-built-witness.d.ts +57 -0
- package/dist/ensure-built-witness.d.ts.map +1 -0
- package/dist/ensure-built-witness.js +412 -0
- package/dist/ensure-built.d.ts +207 -12
- package/dist/ensure-built.d.ts.map +1 -1
- package/dist/ensure-built.js +576 -202
- package/dist/eslint-file-set.d.ts +7 -0
- package/dist/eslint-file-set.d.ts.map +1 -0
- package/dist/eslint-file-set.js +12 -0
- package/dist/executors/bounded-exec/cpu-pool.d.ts +63 -0
- package/dist/executors/bounded-exec/cpu-pool.d.ts.map +1 -0
- package/dist/executors/bounded-exec/cpu-pool.js +379 -0
- package/dist/executors/bounded-exec/cpu-tokens.d.ts +82 -0
- package/dist/executors/bounded-exec/cpu-tokens.d.ts.map +1 -0
- package/dist/executors/bounded-exec/cpu-tokens.js +114 -0
- package/dist/executors/bounded-exec/disk-lease.d.ts +61 -0
- package/dist/executors/bounded-exec/disk-lease.d.ts.map +1 -0
- package/dist/executors/bounded-exec/disk-lease.js +91 -0
- package/dist/executors/bounded-exec/executor.d.ts +45 -2
- package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
- package/dist/executors/bounded-exec/executor.js +447 -52
- package/dist/executors/bounded-exec/gateway-lease.d.ts +52 -0
- package/dist/executors/bounded-exec/gateway-lease.d.ts.map +1 -0
- package/dist/executors/bounded-exec/gateway-lease.js +143 -0
- package/dist/executors/bounded-exec/hang-diagnostics.d.ts +35 -0
- package/dist/executors/bounded-exec/hang-diagnostics.d.ts.map +1 -0
- package/dist/executors/bounded-exec/hang-diagnostics.js +231 -0
- package/dist/executors/bounded-exec/progress.d.ts +35 -0
- package/dist/executors/bounded-exec/progress.d.ts.map +1 -0
- package/dist/executors/bounded-exec/progress.js +79 -0
- package/dist/executors/bounded-exec/ram-temp-fixtures.d.ts +3 -0
- package/dist/executors/bounded-exec/ram-temp-fixtures.d.ts.map +1 -0
- package/dist/executors/bounded-exec/ram-temp-fixtures.js +12 -0
- package/dist/executors/bounded-exec/ram-temp-held.d.ts +91 -0
- package/dist/executors/bounded-exec/ram-temp-held.d.ts.map +1 -0
- package/dist/executors/bounded-exec/ram-temp-held.js +152 -0
- package/dist/executors/bounded-exec/ram-temp.d.ts +223 -0
- package/dist/executors/bounded-exec/ram-temp.d.ts.map +1 -0
- package/dist/executors/bounded-exec/ram-temp.js +1528 -0
- package/dist/executors/bounded-exec/schema.d.ts +29 -11
- package/dist/executors/bounded-exec/schema.d.ts.map +1 -1
- package/dist/executors/bounded-exec/verdict.d.ts +162 -0
- package/dist/executors/bounded-exec/verdict.d.ts.map +1 -0
- package/dist/executors/bounded-exec/verdict.js +318 -0
- package/dist/executors/shard-timings/executor.d.ts +14 -0
- package/dist/executors/shard-timings/executor.d.ts.map +1 -0
- package/dist/executors/shard-timings/executor.js +25 -0
- package/dist/executors/shard-timings/schema.d.ts +4 -0
- package/dist/executors/shard-timings/schema.d.ts.map +1 -0
- package/dist/executors/shard-timings/schema.js +1 -0
- package/dist/failure-summary.d.ts +5 -0
- package/dist/failure-summary.d.ts.map +1 -0
- package/dist/failure-summary.js +118 -0
- package/dist/generators/create-package/generator.d.ts.map +1 -1
- package/dist/generators/create-package/generator.js +6 -2
- package/dist/index.d.ts +14 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +370 -138
- package/dist/managed-files/ci-workflow.d.ts +13 -0
- package/dist/managed-files/ci-workflow.d.ts.map +1 -1
- package/dist/managed-files/ci-workflow.js +44 -13
- package/dist/managed-files/files.d.ts +7 -1
- package/dist/managed-files/files.d.ts.map +1 -1
- package/dist/managed-files/files.js +62 -8
- package/dist/managed-files/json-edit.d.ts +21 -0
- package/dist/managed-files/json-edit.d.ts.map +1 -0
- package/dist/managed-files/json-edit.js +295 -0
- package/dist/managed-files/managed-format.d.ts +33 -1
- package/dist/managed-files/managed-format.d.ts.map +1 -1
- package/dist/managed-files/managed-format.js +82 -2
- package/dist/managed-files/pr-preview-cleanup-workflow.d.ts +7 -0
- package/dist/managed-files/pr-preview-cleanup-workflow.d.ts.map +1 -1
- package/dist/managed-files/pr-preview-cleanup-workflow.js +68 -4
- package/dist/managed-files/publish-workflow.d.ts.map +1 -1
- package/dist/managed-files/publish-workflow.js +231 -48
- package/dist/managed-files/tree.d.ts +5 -0
- package/dist/managed-files/tree.d.ts.map +1 -1
- package/dist/managed-files/tree.js +5 -3
- package/dist/manifest-hash.d.ts.map +1 -1
- package/dist/manifest-hash.js +2 -5
- package/dist/nextest-code-bound.d.ts +62 -0
- package/dist/nextest-code-bound.d.ts.map +1 -0
- package/dist/nextest-code-bound.js +154 -0
- package/dist/nextest-extraction.d.ts +24 -8
- package/dist/nextest-extraction.d.ts.map +1 -1
- package/dist/nextest-extraction.js +42 -7
- package/dist/package-target-policy.d.ts.map +1 -1
- package/dist/package-target-policy.js +3 -5
- package/dist/release-config-policy.d.ts.map +1 -1
- package/dist/release-config-policy.js +3 -5
- package/dist/runtime-input.d.ts +14 -0
- package/dist/runtime-input.d.ts.map +1 -0
- package/dist/runtime-input.js +15 -0
- package/dist/rust-tokens.d.ts +11 -0
- package/dist/rust-tokens.d.ts.map +1 -0
- package/dist/rust-tokens.js +81 -0
- package/dist/task-results.d.ts +6 -0
- package/dist/task-results.d.ts.map +1 -0
- package/dist/task-results.js +61 -0
- package/dist/test-program.d.ts +54 -0
- package/dist/test-program.d.ts.map +1 -0
- package/dist/test-program.js +292 -0
- package/dist/test-timings.d.ts +71 -0
- package/dist/test-timings.d.ts.map +1 -0
- package/dist/test-timings.js +393 -0
- package/dist/test-walk-policy.d.ts +103 -0
- package/dist/test-walk-policy.d.ts.map +1 -0
- package/dist/test-walk-policy.js +657 -0
- package/dist/testing.d.ts +177 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +824 -0
- package/dist/type-guards.d.ts +3 -0
- package/dist/type-guards.d.ts.map +1 -0
- package/dist/type-guards.js +4 -0
- package/dist/typecheck-test-policy.d.ts +8 -5
- package/dist/typecheck-test-policy.d.ts.map +1 -1
- package/dist/typecheck-test-policy.js +113 -100
- package/dist/workspace-config-policy.d.ts +8 -0
- package/dist/workspace-config-policy.d.ts.map +1 -1
- package/dist/workspace-config-policy.js +175 -63
- package/dist/workspace-index.d.ts +12 -0
- package/dist/workspace-index.d.ts.map +1 -0
- package/dist/workspace-index.js +17 -0
- package/dist/workspace-manifest.d.ts +37 -0
- package/dist/workspace-manifest.d.ts.map +1 -1
- package/executors.json +5 -0
- package/loader.js +13 -11
- package/managed/raw/envrc +33 -67
- package/managed/raw/git-format-staged.yml +30 -35
- package/managed/raw/patches/nx@23.2.1.patch +3484 -0
- package/managed/raw/tooling/direnv/apple-developer.sh +83 -0
- package/managed/raw/tooling/direnv/developer-links.ts +569 -11
- package/managed/raw/tooling/direnv/devenv.smoo.nix +314 -93
- package/managed/raw/tooling/direnv/github-actions-bootstrap.sh +20 -11
- package/managed/raw/tooling/direnv/linked-snapshots.ts +845 -0
- package/managed/raw/tooling/direnv/nx-socket-dir.sh +82 -0
- package/managed/raw/tooling/direnv/repo-path +14 -2
- package/managed/raw/tooling/direnv/setup-environment.ts +962 -148
- package/managed/raw/tooling/direnv/toolchain-stamp.ts +45 -3
- package/managed/raw/tooling/direnv/ttsc-env.sh +39 -0
- package/managed/raw/tooling/git-hooks/commit-msg.sh +5 -6
- package/managed/raw/tooling/git-hooks/pre-commit.sh +7 -6
- package/managed/raw/tooling/git-hooks/pre-push.sh +20 -15
- package/managed/templates/github/actions/cache-nix-devenv/action.yml +6 -6
- package/managed/templates/github/actions/cache-node-modules/action.yml +6 -4
- package/managed/templates/github/actions/cache-nx/action.yml +1 -1
- package/managed/templates/github/actions/cache-ttsc-plugins/action.yml +1 -1
- package/managed/templates/github/actions/forgejo-artifact.cjs +99 -0
- package/managed/templates/github/actions/forgejo-download-artifact/action.yml +49 -0
- package/managed/templates/github/actions/forgejo-download-artifact/index.cjs +7 -0
- package/managed/templates/github/actions/forgejo-upload-artifact/action.yml +65 -0
- package/managed/templates/github/actions/forgejo-upload-artifact/index.cjs +7 -0
- package/managed/templates/github/actions/setup-devenv/action.yml +21 -3
- package/managed/templates/github/workflows/managed-files.yml +1 -2
- package/nextest.toml +8 -41
- package/package.json +74 -12
- package/runtime-input.sh +81 -0
- package/src/__tests__/counted-cargo.ts +33 -14
- package/src/__tests__/fixture-nx-env.ts +111 -46
- package/src/__tests__/progress-clock.ts +43 -0
- package/src/__tests__/runtime-input.ts +23 -0
- package/src/bin/smoo-nx-bound-failures.test.ts +127 -0
- package/src/bin/smoo-nx-bound-failures.ts +33 -0
- package/src/bin/smoo-nx-cargo-hash.ts +28 -3
- package/src/bin/smoo-nx-exec.ts +16 -74
- package/src/bin/smoo-nx-failures.ts +4 -0
- package/src/bin/smoo-nx-nextest-extract.ts +3 -2
- package/src/bin/smoo-nx-test-walks.ts +42 -0
- package/src/bounded-test-policy.test.ts +268 -21
- package/src/bounded-test-policy.ts +114 -42
- package/src/build-state-output-policy.test.ts +115 -0
- package/src/build-state-output-policy.ts +90 -0
- package/src/bun-bootstrap.test.ts +57 -3
- package/src/bun-file-packages.test.ts +47 -0
- package/src/cargo-closure-input.test.ts +138 -66
- package/src/cargo-closure-input.ts +17 -15
- package/src/cargo-dev-profile.ts +137 -0
- package/src/cargo-resolve-cache.test.ts +70 -1
- package/src/cargo-source-hash.test.ts +193 -97
- package/src/cargo-source-hash.ts +345 -68
- package/src/cargo-toolchain-policy.ts +6 -0
- package/src/cargo-workspace.test.ts +320 -0
- package/src/cargo-workspace.ts +336 -10
- package/src/cross-check-policy.test.ts +59 -1
- package/src/cross-check-policy.ts +25 -6
- package/src/disk-command-policy.test.ts +61 -0
- package/src/disk-command-policy.ts +107 -0
- package/src/ensure-built-receipt.test.ts +184 -0
- package/src/ensure-built-receipt.ts +263 -0
- package/src/ensure-built-witness.test.ts +344 -0
- package/src/ensure-built-witness.ts +252 -0
- package/src/ensure-built.test.ts +1036 -578
- package/src/ensure-built.ts +820 -224
- package/src/eslint-file-set.ts +9 -0
- package/src/executors/bounded-exec/cpu-pool.test.ts +454 -0
- package/src/executors/bounded-exec/cpu-pool.ts +417 -0
- package/src/executors/bounded-exec/cpu-tokens.test.ts +269 -0
- package/src/executors/bounded-exec/cpu-tokens.ts +177 -0
- package/src/executors/bounded-exec/disk-lease.test.ts +185 -0
- package/src/executors/bounded-exec/disk-lease.ts +139 -0
- package/src/executors/bounded-exec/executor-host.test.ts +778 -0
- package/src/executors/bounded-exec/executor.test.ts +1116 -63
- package/src/executors/bounded-exec/executor.ts +565 -67
- package/src/executors/bounded-exec/gateway-lease.ts +176 -0
- package/src/executors/bounded-exec/hang-diagnostics.test.ts +285 -0
- package/src/executors/bounded-exec/hang-diagnostics.ts +283 -0
- package/src/executors/bounded-exec/progress.test.ts +79 -0
- package/src/executors/bounded-exec/progress.ts +118 -0
- package/src/executors/bounded-exec/ram-temp-fixtures.ts +12 -0
- package/src/executors/bounded-exec/ram-temp-held.test.ts +264 -0
- package/src/executors/bounded-exec/ram-temp-held.ts +242 -0
- package/src/executors/bounded-exec/ram-temp-host.test.ts +605 -0
- package/src/executors/bounded-exec/ram-temp.test.ts +674 -0
- package/src/executors/bounded-exec/ram-temp.ts +1918 -0
- package/src/executors/bounded-exec/schema.json +11 -5
- package/src/executors/bounded-exec/schema.ts +27 -11
- package/src/executors/bounded-exec/verdict.test.ts +440 -0
- package/src/executors/bounded-exec/verdict.ts +433 -0
- package/src/executors/shard-timings/executor.ts +36 -0
- package/src/executors/shard-timings/schema.json +21 -0
- package/src/executors/shard-timings/schema.ts +4 -0
- package/src/failure-summary.ts +119 -0
- package/src/generators/bounded-test-targets/generator.test.ts +4 -4
- package/src/generators/bun-test-tracing/generator.test.ts +2 -2
- package/src/generators/create-package/generator.test.ts +6 -0
- package/src/generators/create-package/generator.ts +6 -2
- package/src/host-controller-wiring.test.ts +31 -0
- package/src/index.test.ts +909 -295
- package/src/index.ts +441 -143
- package/src/linked-snapshots.nx.test.ts +172 -0
- package/src/managed-files/ci-workflow.ts +54 -13
- package/src/managed-files/files.ts +65 -9
- package/src/managed-files/forgejo-artifact.test.ts +395 -0
- package/src/managed-files/generator.test.ts +60 -1
- package/src/managed-files/json-edit.test.ts +216 -0
- package/src/managed-files/json-edit.ts +290 -0
- package/src/managed-files/managed-format-json.test.ts +308 -0
- package/src/managed-files/managed-format.ts +90 -2
- package/src/managed-files/pr-preview-cleanup-workflow.ts +69 -3
- package/src/managed-files/publish-workflow.ts +285 -67
- package/src/managed-files/repo-path.test.ts +129 -0
- package/src/managed-files/trace-db-artifact.test.ts +7 -0
- package/src/managed-files/tree.ts +11 -3
- package/src/manifest-hash.ts +2 -6
- package/src/nextest-code-bound.test.ts +155 -0
- package/src/nextest-code-bound.ts +195 -0
- package/src/nextest-extraction.test.ts +37 -5
- package/src/nextest-extraction.ts +51 -9
- package/src/nextest-partitions.test.ts +427 -82
- package/src/nx-cache-bound.test.ts +5 -10
- package/src/nx-cache-restore-mtime.test.ts +170 -0
- package/src/nx-daemon-claim.test.ts +277 -0
- package/src/nx-daemon-idle-cpu.test.ts +81 -0
- package/src/nx-daemon-idle-policy.test.ts +51 -0
- package/src/nx-daemon-ignore-files.test.ts +210 -0
- package/src/nx-daemon-root-normalization.test.ts +105 -0
- package/src/nx-daemon-validity.test.ts +925 -0
- package/src/nx-dot-input-policy.test.ts +353 -0
- package/src/nx-failure-life-cycles.test.ts +207 -0
- package/src/nx-files-archive-racy.test.ts +97 -0
- package/src/nx-foreign-workspace-env.test.ts +329 -0
- package/src/nx-incomplete-run-summary.test.ts +70 -0
- package/src/nx-plugin-load-errors.test.ts +120 -0
- package/src/nx-project-resolution-cache.test.ts +176 -0
- package/src/nx-raw-inputs.test.ts +166 -0
- package/src/nx-resident-graph-workers.test.ts +7 -16
- package/src/nx-run-information.test.ts +118 -0
- package/src/nx-skipped-task-exit.test.ts +180 -0
- package/src/nx-state-location.test.ts +63 -0
- package/src/nx-store-resolution.test.ts +26 -25
- package/src/nx-task-graph-cycles.test.ts +148 -0
- package/src/nx-task-output-lease.test.ts +414 -0
- package/src/nx-use-local.test.ts +103 -0
- package/src/package-target-policy.ts +3 -6
- package/src/release-config-policy.ts +3 -6
- package/src/runtime-input.test.ts +215 -0
- package/src/runtime-input.ts +17 -0
- package/src/rust-tokens.ts +78 -0
- package/src/serial-group-wiring.test.ts +326 -0
- package/src/task-history-namespace.test.ts +87 -89
- package/src/task-results.test.ts +226 -0
- package/src/task-results.ts +75 -0
- package/src/test-program.test.ts +303 -0
- package/src/test-program.ts +341 -0
- package/src/test-timings.test.ts +240 -0
- package/src/test-timings.ts +311 -0
- package/src/test-walk-policy.test.ts +585 -0
- package/src/test-walk-policy.ts +731 -0
- package/src/testing.test.ts +509 -0
- package/src/testing.ts +922 -0
- package/src/type-guards.ts +4 -0
- package/src/typecheck-test-policy.test.ts +496 -11
- package/src/typecheck-test-policy.ts +137 -103
- package/src/workspace-config-policy.test.ts +212 -13
- package/src/workspace-config-policy.ts +101 -73
- package/src/workspace-index.ts +18 -0
- package/src/workspace-manifest.ts +41 -0
- package/test-timings.json +85 -30
- package/managed/raw/tooling/direnv/inherited-devenv.ts +0 -665
- package/managed/raw/tooling/direnv/shared-caches.sh +0 -53
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
// A linked-package snapshot vouched for by real Nx: the managed snapshot module's default probe, which loads the
|
|
2
|
+
// plugin product a consumer installs (this package's built `ensure-built`) and calls its read-only `probeBuilt`
|
|
3
|
+
// against a provider workspace that real Nx built and cached. No receipt is injected: the hit, the task hash, HEAD
|
|
4
|
+
// and every output byte come from the provider's own Nx, and a provider Nx cannot vouch for is refused unwritten.
|
|
5
|
+
import { describe, expect, it } from 'bun:test';
|
|
6
|
+
import { mkdir, mkdtemp, readFile, rm, stat, symlink, writeFile } from 'node:fs/promises';
|
|
7
|
+
import { tmpdir } from 'node:os';
|
|
8
|
+
import { dirname, join } from 'node:path';
|
|
9
|
+
import { fileURLToPath } from 'node:url';
|
|
10
|
+
import typia from 'typia';
|
|
11
|
+
import { fixtureNxEnv, withNxFixture } from './__tests__/fixture-nx-env.js';
|
|
12
|
+
import { managedAssetsRoot } from './managed-assets.js';
|
|
13
|
+
|
|
14
|
+
const packageRoot = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
15
|
+
const repoRoot = dirname(dirname(packageRoot));
|
|
16
|
+
const nxEntry = join(repoRoot, 'node_modules', '.bin', 'nx');
|
|
17
|
+
const SNAPSHOTS = join(managedAssetsRoot, 'raw/tooling/direnv/linked-snapshots.ts');
|
|
18
|
+
const DECLARATION = { targets: ['linked-api:build'], artifactModules: [] };
|
|
19
|
+
|
|
20
|
+
/** One capture through the default probe, in a fresh Bun process as shell entry runs it: no plugins preloaded. */
|
|
21
|
+
const CAPTURE = `
|
|
22
|
+
const snapshots = await import(Bun.argv[1]);
|
|
23
|
+
const [consumer, source, declaration] = JSON.parse(Bun.argv[2]);
|
|
24
|
+
const binding = await snapshots.snapshotBinding(consumer, 'linked-api', source, declaration);
|
|
25
|
+
const receipt = binding.kind === 'snapshot' ? snapshots.verifySnapshot(binding.directory.slice(0, -'/packages/api'.length)) : null;
|
|
26
|
+
process.stdout.write(JSON.stringify({ binding, receipt }));
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
interface Captured {
|
|
30
|
+
readonly binding: {
|
|
31
|
+
readonly kind: string;
|
|
32
|
+
readonly id?: string;
|
|
33
|
+
readonly directory?: string;
|
|
34
|
+
readonly reason?: string;
|
|
35
|
+
};
|
|
36
|
+
readonly receipt: {
|
|
37
|
+
readonly id: string;
|
|
38
|
+
readonly provenance: {
|
|
39
|
+
readonly head: string;
|
|
40
|
+
readonly headTree: string;
|
|
41
|
+
readonly tasks: readonly { readonly id: string; readonly hash: string }[];
|
|
42
|
+
};
|
|
43
|
+
} | null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
async function execute(file: string, args: string[], cwd: string, env = process.env) {
|
|
47
|
+
const child = Bun.spawn([file, ...args], { cwd, env, stdout: 'pipe', stderr: 'pipe' });
|
|
48
|
+
const [status, stdout, stderr] = await Promise.all([
|
|
49
|
+
child.exited,
|
|
50
|
+
new Response(child.stdout).text(),
|
|
51
|
+
new Response(child.stderr).text(),
|
|
52
|
+
]);
|
|
53
|
+
return { status, stdout, stderr };
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async function git(workspace: string, ...args: string[]): Promise<string> {
|
|
57
|
+
const run = await execute(
|
|
58
|
+
'git',
|
|
59
|
+
['-C', workspace, '-c', 'user.name=Snapshot fixture', '-c', 'user.email=fixture@example.invalid', ...args],
|
|
60
|
+
workspace,
|
|
61
|
+
);
|
|
62
|
+
expect(run.status, run.stdout + run.stderr).toBe(0);
|
|
63
|
+
return run.stdout.trim();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** A provider Nx workspace whose `linked-api:build` copies its source into `dist`, committed. */
|
|
67
|
+
async function writeProvider(workspace: string): Promise<string> {
|
|
68
|
+
await git(workspace, 'init', '--quiet');
|
|
69
|
+
await writeFile(join(workspace, '.gitignore'), '.nx\nnode_modules\npackages/*/dist\n');
|
|
70
|
+
// The repository's own node_modules, so the fixture resolves the Nx this package is written against.
|
|
71
|
+
await symlink(join(repoRoot, 'node_modules'), join(workspace, 'node_modules'), 'dir');
|
|
72
|
+
await writeFile(join(workspace, 'nx.json'), JSON.stringify({ useDaemonProcess: true, cacheDirectory: '.nx/cache' }));
|
|
73
|
+
await writeFile(
|
|
74
|
+
join(workspace, 'package.json'),
|
|
75
|
+
JSON.stringify({ name: 'provider', private: true, workspaces: ['packages/*'] }),
|
|
76
|
+
);
|
|
77
|
+
const api = join(workspace, 'packages/api');
|
|
78
|
+
await mkdir(join(api, 'src'), { recursive: true });
|
|
79
|
+
await writeFile(
|
|
80
|
+
join(api, 'package.json'),
|
|
81
|
+
JSON.stringify({
|
|
82
|
+
name: 'linked-api',
|
|
83
|
+
version: '1.0.0',
|
|
84
|
+
type: 'module',
|
|
85
|
+
files: ['dist', 'src'],
|
|
86
|
+
exports: { '.': { default: './dist/index.js' } },
|
|
87
|
+
}),
|
|
88
|
+
);
|
|
89
|
+
await writeFile(
|
|
90
|
+
join(api, 'project.json'),
|
|
91
|
+
JSON.stringify({
|
|
92
|
+
name: 'linked-api',
|
|
93
|
+
targets: {
|
|
94
|
+
build: {
|
|
95
|
+
executor: 'nx:run-commands',
|
|
96
|
+
cache: true,
|
|
97
|
+
inputs: ['{projectRoot}/src/**/*'],
|
|
98
|
+
outputs: ['{projectRoot}/dist'],
|
|
99
|
+
options: { command: 'mkdir -p dist && cp src/index.js dist/index.js', cwd: '{projectRoot}' },
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
}),
|
|
103
|
+
);
|
|
104
|
+
await writeFile(join(api, 'src/index.js'), 'export const value = "first";\n');
|
|
105
|
+
await git(workspace, 'add', '-A');
|
|
106
|
+
await git(workspace, 'commit', '-qm', 'provider');
|
|
107
|
+
return api;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
describe('linked snapshots vouched for by the provider’s real Nx', () => {
|
|
111
|
+
it('captures what real Nx built, names a new commit anew, and refuses stale output without writing it', async () => {
|
|
112
|
+
const consumer = await mkdtemp(join(tmpdir(), 'linked-snapshot-consumer-'));
|
|
113
|
+
try {
|
|
114
|
+
await withNxFixture('linked-snapshot-', async ({ workspace, socketDirectory }) => {
|
|
115
|
+
const source = await writeProvider(workspace);
|
|
116
|
+
const daemonless = { ...fixtureNxEnv(workspace, socketDirectory), NX_DAEMON: 'false' };
|
|
117
|
+
const built = await execute(
|
|
118
|
+
'node',
|
|
119
|
+
[nxEntry, 'run', 'linked-api:build', '--outputStyle=static'],
|
|
120
|
+
workspace,
|
|
121
|
+
daemonless,
|
|
122
|
+
);
|
|
123
|
+
expect(built.status, built.stdout + built.stderr).toBe(0);
|
|
124
|
+
|
|
125
|
+
// The consumer installs this package's built plugin product, as a workspace installs @smoothbricks/nx-plugin.
|
|
126
|
+
await mkdir(join(consumer, 'node_modules/@smoothbricks'), { recursive: true });
|
|
127
|
+
await writeFile(join(consumer, 'package.json'), JSON.stringify({ name: 'consumer', private: true }));
|
|
128
|
+
await symlink(packageRoot, join(consumer, 'node_modules/@smoothbricks/nx-plugin'), 'dir');
|
|
129
|
+
const env = { ...fixtureNxEnv(workspace, socketDirectory), NX_DAEMON: 'true' };
|
|
130
|
+
const capture = async (): Promise<Captured> => {
|
|
131
|
+
const run = await execute(
|
|
132
|
+
process.execPath,
|
|
133
|
+
['-e', CAPTURE, SNAPSHOTS, JSON.stringify([consumer, source, DECLARATION])],
|
|
134
|
+
consumer,
|
|
135
|
+
env,
|
|
136
|
+
);
|
|
137
|
+
expect(run.status, run.stderr).toBe(0);
|
|
138
|
+
return typia.json.assertParse<Captured>(run.stdout);
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
const first = await capture();
|
|
142
|
+
expect(first.binding.kind, first.binding.reason).toBe('snapshot');
|
|
143
|
+
expect(first.receipt?.provenance.head).toBe(await git(workspace, 'rev-parse', 'HEAD'));
|
|
144
|
+
expect(first.receipt?.provenance.headTree).toBe(await git(workspace, 'rev-parse', 'HEAD^{tree}'));
|
|
145
|
+
expect(first.receipt?.provenance.tasks.map(({ id }) => id)).toContain('linked-api:build');
|
|
146
|
+
expect(await readFile(join(first.binding.directory ?? '', 'dist/index.js'), 'utf8')).toBe(
|
|
147
|
+
'export const value = "first";\n',
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
// The same bytes under another commit are another snapshot with another provenance.
|
|
151
|
+
await git(workspace, 'commit', '-qm', 'same tree', '--allow-empty');
|
|
152
|
+
const second = await capture();
|
|
153
|
+
expect(second.binding.kind, second.binding.reason).toBe('snapshot');
|
|
154
|
+
expect(second.binding.id).not.toBe(first.binding.id);
|
|
155
|
+
expect(second.receipt?.provenance.head).toBe(await git(workspace, 'rev-parse', 'HEAD'));
|
|
156
|
+
|
|
157
|
+
// Output the producer did not record: refused as not current, and the provider's dist is left as it was.
|
|
158
|
+
const output = join(source, 'dist/index.js');
|
|
159
|
+
await writeFile(output, 'export const value = "tampered";\n');
|
|
160
|
+
const before = await stat(output, { bigint: true });
|
|
161
|
+
const stale = await capture();
|
|
162
|
+
expect(stale.binding.kind).toBe('refused');
|
|
163
|
+
expect(stale.binding.reason).toContain('is not current');
|
|
164
|
+
const after = await stat(output, { bigint: true });
|
|
165
|
+
expect([after.ino, after.mtimeNs, after.ctimeNs]).toEqual([before.ino, before.mtimeNs, before.ctimeNs]);
|
|
166
|
+
expect(await readFile(output, 'utf8')).toBe('export const value = "tampered";\n');
|
|
167
|
+
});
|
|
168
|
+
} finally {
|
|
169
|
+
await rm(consumer, { recursive: true, force: true });
|
|
170
|
+
}
|
|
171
|
+
}, 60_000);
|
|
172
|
+
});
|
|
@@ -20,6 +20,37 @@ import type {
|
|
|
20
20
|
} from '../workspace-manifest.js';
|
|
21
21
|
import { renderRunsOnLine } from './github-runs-on.js';
|
|
22
22
|
|
|
23
|
+
export const githubActionPins: Readonly<
|
|
24
|
+
Record<
|
|
25
|
+
'checkout' | 'nxSetShas' | 'cacheSave' | 'uploadArtifact' | 'downloadArtifact',
|
|
26
|
+
{
|
|
27
|
+
readonly ref: string;
|
|
28
|
+
readonly version: string;
|
|
29
|
+
}
|
|
30
|
+
>
|
|
31
|
+
> = {
|
|
32
|
+
checkout: {
|
|
33
|
+
ref: 'actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd',
|
|
34
|
+
version: 'v6.0.2',
|
|
35
|
+
},
|
|
36
|
+
nxSetShas: {
|
|
37
|
+
ref: 'nrwl/nx-set-shas@afb73a62d26e41464e9254689e1fd6122ee683c1',
|
|
38
|
+
version: 'v5.0.1',
|
|
39
|
+
},
|
|
40
|
+
cacheSave: {
|
|
41
|
+
ref: 'actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae',
|
|
42
|
+
version: 'v5.0.5',
|
|
43
|
+
},
|
|
44
|
+
uploadArtifact: {
|
|
45
|
+
ref: 'actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a',
|
|
46
|
+
version: 'v7.0.1',
|
|
47
|
+
},
|
|
48
|
+
downloadArtifact: {
|
|
49
|
+
ref: 'actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c',
|
|
50
|
+
version: 'v8.0.1',
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
|
|
23
54
|
export enum CiWorkflowStepKind {
|
|
24
55
|
Checkout = 'checkout',
|
|
25
56
|
SourceCheckouts = 'source-checkouts',
|
|
@@ -377,10 +408,11 @@ function yamlLinesForStep(step: CiWorkflowStep, options: CiWorkflowDefinitionOpt
|
|
|
377
408
|
case CiWorkflowStepKind.Checkout:
|
|
378
409
|
return [
|
|
379
410
|
` - name: ${step.name}`,
|
|
380
|
-
|
|
411
|
+
` uses: ${githubActionPins.checkout.ref} # ${githubActionPins.checkout.version}`,
|
|
381
412
|
' with:',
|
|
382
|
-
'
|
|
413
|
+
' # Full history includes blobs needed by nx affected after checkout credentials are removed.',
|
|
383
414
|
' fetch-depth: 0',
|
|
415
|
+
' persist-credentials: false',
|
|
384
416
|
];
|
|
385
417
|
case CiWorkflowStepKind.SourceCheckouts:
|
|
386
418
|
return sourceCheckoutsStepLines(step, options.sourceCheckouts ?? []);
|
|
@@ -395,7 +427,7 @@ function yamlLinesForStep(step: CiWorkflowStep, options: CiWorkflowDefinitionOpt
|
|
|
395
427
|
return [
|
|
396
428
|
` - name: ${step.name}`,
|
|
397
429
|
" if: github.server_url == 'https://github.com' || endsWith(github.api_url, '/api/v3')",
|
|
398
|
-
|
|
430
|
+
` uses: ${githubActionPins.nxSetShas.ref} # ${githubActionPins.nxSetShas.version}`,
|
|
399
431
|
' with:',
|
|
400
432
|
' workflow-id: ci.yml',
|
|
401
433
|
];
|
|
@@ -515,7 +547,7 @@ function yamlLinesForStep(step: CiWorkflowStep, options: CiWorkflowDefinitionOpt
|
|
|
515
547
|
" ${{ steps.setup.outputs.host-runner != 'true' && github.event_name == 'push' && github.ref ==",
|
|
516
548
|
" format('refs/heads/{0}', github.event.repository.default_branch) && steps.nx-cache.outputs.cache-hit != 'true'",
|
|
517
549
|
' }}',
|
|
518
|
-
|
|
550
|
+
` uses: ${githubActionPins.cacheSave.ref} # ${githubActionPins.cacheSave.version}`,
|
|
519
551
|
' with:',
|
|
520
552
|
' path: |',
|
|
521
553
|
' .nx/cache',
|
|
@@ -529,7 +561,7 @@ function yamlLinesForStep(step: CiWorkflowStep, options: CiWorkflowDefinitionOpt
|
|
|
529
561
|
'upload',
|
|
530
562
|
[
|
|
531
563
|
'name: trace-results-${{ github.run_id }}',
|
|
532
|
-
|
|
564
|
+
`path: ${TRACE_DB_ARTIFACT_GLOB}`,
|
|
533
565
|
'if-no-files-found: ignore',
|
|
534
566
|
'retention-days: 14',
|
|
535
567
|
'include-hidden-files: true',
|
|
@@ -1293,7 +1325,7 @@ function darwinCrossTestTargetNames(options: CiWorkflowDefinitionOptions): strin
|
|
|
1293
1325
|
* step carries exactly these archives, and upload-artifact roots an artifact at
|
|
1294
1326
|
* the least common ancestor of the files it uploaded.
|
|
1295
1327
|
*
|
|
1296
|
-
* One cargo workspace's triples all share
|
|
1328
|
+
* One cargo workspace's triples all share `.cache/nextest` and travel together.
|
|
1297
1329
|
* Two workspaces that each declare a darwin triple do not: their common
|
|
1298
1330
|
* ancestor is above the directory the runner targets read from, so the pair is
|
|
1299
1331
|
* refused here instead of restoring both archives one directory too high.
|
|
@@ -1365,6 +1397,16 @@ ${renderOptionalLines(deployStepSecretEnvLines(options))} # prettier-igno
|
|
|
1365
1397
|
${renderCiWorkflowSteps(followUpCleanupStep(numbers), options)}`;
|
|
1366
1398
|
}
|
|
1367
1399
|
|
|
1400
|
+
/**
|
|
1401
|
+
* Every package's lmao trace sink, with its WAL sidecars: a run killed before a
|
|
1402
|
+
* checkpoint leaves its committed frames in `-wal`, and without them the
|
|
1403
|
+
* uploaded database reads `no such table: spans`. lmao's
|
|
1404
|
+
* `TRACE_DB_DIRECTORY`/`TRACE_DB_FILENAME` own the path; the plugin cannot
|
|
1405
|
+
* import them at runtime (lmao is not a runtime dependency), so a test pins
|
|
1406
|
+
* this glob to them.
|
|
1407
|
+
*/
|
|
1408
|
+
export const TRACE_DB_ARTIFACT_GLOB = 'packages/*/.cache/lmao/trace-results.db*';
|
|
1409
|
+
|
|
1368
1410
|
export function artifactStepLines(
|
|
1369
1411
|
provider: PackageSmooGithub['actionsProvider'],
|
|
1370
1412
|
name: string,
|
|
@@ -1372,17 +1414,16 @@ export function artifactStepLines(
|
|
|
1372
1414
|
inputs: readonly string[],
|
|
1373
1415
|
condition = 'success()',
|
|
1374
1416
|
): string[] {
|
|
1375
|
-
//
|
|
1376
|
-
// Forgejo
|
|
1377
|
-
// Forgejo 15 supports v4 artifacts; its pinned clients remove the GHES gate.
|
|
1417
|
+
// Local adapters keep both providers in GitHub's workflow grammar while
|
|
1418
|
+
// Forgejo runs its exact pinned clients without the GitHub GHES rejection.
|
|
1378
1419
|
const action =
|
|
1379
1420
|
provider === 'forgejo'
|
|
1380
1421
|
? kind === 'upload'
|
|
1381
|
-
? '
|
|
1382
|
-
: '
|
|
1422
|
+
? './.github/actions/forgejo-upload-artifact'
|
|
1423
|
+
: './.github/actions/forgejo-download-artifact'
|
|
1383
1424
|
: kind === 'upload'
|
|
1384
|
-
?
|
|
1385
|
-
:
|
|
1425
|
+
? `${githubActionPins.uploadArtifact.ref} # ${githubActionPins.uploadArtifact.version}`
|
|
1426
|
+
: `${githubActionPins.downloadArtifact.ref} # ${githubActionPins.downloadArtifact.version}`;
|
|
1386
1427
|
return [
|
|
1387
1428
|
` - name: ${name}`,
|
|
1388
1429
|
` if: ${condition}`,
|
|
@@ -12,7 +12,7 @@ import type {
|
|
|
12
12
|
} from '../workspace-manifest.js';
|
|
13
13
|
import { type CiCrossTestArchive, privateNpmReadTokenJobEnv, renderCiWorkflowYaml } from './ci-workflow.js';
|
|
14
14
|
import { renderRunsOnLine } from './github-runs-on.js';
|
|
15
|
-
import { renderPrPreviewCleanupWorkflowYaml } from './pr-preview-cleanup-workflow.js';
|
|
15
|
+
import { renderPrPreviewCleanupWorkflowYaml, renderPrStageSweepWorkflowYaml } from './pr-preview-cleanup-workflow.js';
|
|
16
16
|
import { renderPublishWorkflowYaml } from './publish-workflow.js';
|
|
17
17
|
import type { ManagedFile } from './tree.js';
|
|
18
18
|
|
|
@@ -74,12 +74,24 @@ export const managedTtscPatch = {
|
|
|
74
74
|
path: 'patches/ttsc@0.30.4.patch',
|
|
75
75
|
} as const;
|
|
76
76
|
|
|
77
|
+
/** Maintained Nx 23.2.1 repairs, applied as an ordinary Bun patchedDependency over the registry release. */
|
|
78
|
+
export const managedNxPatch = {
|
|
79
|
+
version: '23.2.1',
|
|
80
|
+
key: 'nx@23.2.1',
|
|
81
|
+
path: 'patches/nx@23.2.1.patch',
|
|
82
|
+
} as const;
|
|
83
|
+
|
|
77
84
|
const managedFiles: ManagedFileDescriptor[] = [
|
|
78
85
|
{
|
|
79
86
|
kind: 'raw',
|
|
80
87
|
source: managedTtscPatch.path,
|
|
81
88
|
target: managedTtscPatch.path,
|
|
82
89
|
},
|
|
90
|
+
{
|
|
91
|
+
kind: 'raw',
|
|
92
|
+
source: managedNxPatch.path,
|
|
93
|
+
target: managedNxPatch.path,
|
|
94
|
+
},
|
|
83
95
|
{
|
|
84
96
|
kind: 'raw',
|
|
85
97
|
source: 'envrc',
|
|
@@ -114,6 +126,11 @@ const managedFiles: ManagedFileDescriptor[] = [
|
|
|
114
126
|
source: 'tooling/direnv/developer-links.ts',
|
|
115
127
|
target: 'tooling/direnv/developer-links.ts',
|
|
116
128
|
},
|
|
129
|
+
{
|
|
130
|
+
kind: 'raw',
|
|
131
|
+
source: 'tooling/direnv/linked-snapshots.ts',
|
|
132
|
+
target: 'tooling/direnv/linked-snapshots.ts',
|
|
133
|
+
},
|
|
117
134
|
{
|
|
118
135
|
kind: 'raw',
|
|
119
136
|
source: 'tooling/direnv/secret-references.ts',
|
|
@@ -132,14 +149,18 @@ const managedFiles: ManagedFileDescriptor[] = [
|
|
|
132
149
|
},
|
|
133
150
|
{
|
|
134
151
|
kind: 'raw',
|
|
135
|
-
source: 'tooling/direnv/
|
|
136
|
-
target: 'tooling/direnv/
|
|
152
|
+
source: 'tooling/direnv/nx-socket-dir.sh',
|
|
153
|
+
target: 'tooling/direnv/nx-socket-dir.sh',
|
|
137
154
|
},
|
|
138
155
|
{
|
|
139
156
|
kind: 'raw',
|
|
140
|
-
source: 'tooling/direnv/
|
|
141
|
-
target: 'tooling/direnv/
|
|
142
|
-
|
|
157
|
+
source: 'tooling/direnv/ttsc-env.sh',
|
|
158
|
+
target: 'tooling/direnv/ttsc-env.sh',
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
kind: 'raw',
|
|
162
|
+
source: 'tooling/direnv/apple-developer.sh',
|
|
163
|
+
target: 'tooling/direnv/apple-developer.sh',
|
|
143
164
|
},
|
|
144
165
|
{
|
|
145
166
|
kind: 'raw',
|
|
@@ -192,6 +213,12 @@ const managedFiles: ManagedFileDescriptor[] = [
|
|
|
192
213
|
target: '.github/workflows/pr-preview-cleanup.yml',
|
|
193
214
|
cloudflareDeployOnly: true,
|
|
194
215
|
},
|
|
216
|
+
{
|
|
217
|
+
kind: 'generated',
|
|
218
|
+
source: 'pr-stage-sweep-workflow',
|
|
219
|
+
target: '.github/workflows/pr-stage-sweep.yml',
|
|
220
|
+
cloudflareDeployOnly: true,
|
|
221
|
+
},
|
|
195
222
|
{
|
|
196
223
|
kind: 'generated',
|
|
197
224
|
source: 'publish-workflow',
|
|
@@ -233,6 +260,31 @@ const managedFiles: ManagedFileDescriptor[] = [
|
|
|
233
260
|
source: 'github/actions/cache-nx/action.yml',
|
|
234
261
|
target: '.github/actions/cache-nx/action.yml',
|
|
235
262
|
},
|
|
263
|
+
{
|
|
264
|
+
kind: 'template',
|
|
265
|
+
source: 'github/actions/forgejo-upload-artifact/action.yml',
|
|
266
|
+
target: '.github/actions/forgejo-upload-artifact/action.yml',
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
kind: 'template',
|
|
270
|
+
source: 'github/actions/forgejo-upload-artifact/index.cjs',
|
|
271
|
+
target: '.github/actions/forgejo-upload-artifact/index.cjs',
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
kind: 'template',
|
|
275
|
+
source: 'github/actions/forgejo-download-artifact/action.yml',
|
|
276
|
+
target: '.github/actions/forgejo-download-artifact/action.yml',
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
kind: 'template',
|
|
280
|
+
source: 'github/actions/forgejo-download-artifact/index.cjs',
|
|
281
|
+
target: '.github/actions/forgejo-download-artifact/index.cjs',
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
kind: 'template',
|
|
285
|
+
source: 'github/actions/forgejo-artifact.cjs',
|
|
286
|
+
target: '.github/actions/forgejo-artifact.cjs',
|
|
287
|
+
},
|
|
236
288
|
];
|
|
237
289
|
|
|
238
290
|
export const managedFileTargetsForTest = managedFiles.map(({ target, executable }) => ({ target, executable }));
|
|
@@ -265,7 +317,7 @@ export function renderManagedFiles(context: ManagedFileContext): ManagedFile[] {
|
|
|
265
317
|
|
|
266
318
|
/** Renders a generated workflow through its real managed-file descriptor, so the context wiring is covered. */
|
|
267
319
|
export function renderManagedWorkflowForTest(
|
|
268
|
-
source: 'ci-workflow' | 'publish-workflow' | 'pr-preview-cleanup-workflow',
|
|
320
|
+
source: 'ci-workflow' | 'publish-workflow' | 'pr-preview-cleanup-workflow' | 'pr-stage-sweep-workflow',
|
|
269
321
|
context: ManagedFileContext,
|
|
270
322
|
): string {
|
|
271
323
|
const file = managedFiles.find((candidate) => candidate.kind === 'generated' && candidate.source === source);
|
|
@@ -322,8 +374,12 @@ function getManagedContent(file: ManagedFileDescriptor, context: ManagedFileCont
|
|
|
322
374
|
deploySecrets: context.ciDeploySecrets,
|
|
323
375
|
});
|
|
324
376
|
}
|
|
325
|
-
if (file.source === 'pr-preview-cleanup-workflow') {
|
|
326
|
-
|
|
377
|
+
if (file.source === 'pr-preview-cleanup-workflow' || file.source === 'pr-stage-sweep-workflow') {
|
|
378
|
+
const render =
|
|
379
|
+
file.source === 'pr-preview-cleanup-workflow'
|
|
380
|
+
? renderPrPreviewCleanupWorkflowYaml
|
|
381
|
+
: renderPrStageSweepWorkflowYaml;
|
|
382
|
+
return render({
|
|
327
383
|
runsOn: context.ciRunsOn,
|
|
328
384
|
privateNpm: context.privateNpm,
|
|
329
385
|
sourceCheckouts: context.sourceCheckouts,
|