@smoothbricks/nx-plugin 0.5.6 → 0.6.0
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 +1095 -360
- package/dist/.build-inputs.json +138 -0
- package/dist/bin/smoo-nx-cargo-toolchain.d.ts +3 -0
- package/dist/bin/smoo-nx-cargo-toolchain.d.ts.map +1 -0
- package/dist/bin/smoo-nx-cargo-toolchain.js +8 -0
- package/dist/bin/smoo-nx-forbidden-spellings.d.ts +3 -0
- package/dist/bin/smoo-nx-forbidden-spellings.d.ts.map +1 -0
- package/dist/bin/smoo-nx-forbidden-spellings.js +32 -0
- package/dist/bin/smoo-nx-nextest-timings.d.ts +3 -0
- package/dist/bin/smoo-nx-nextest-timings.d.ts.map +1 -0
- package/dist/bin/smoo-nx-nextest-timings.js +28 -0
- package/dist/bounded-test-policy.d.ts +1 -1
- package/dist/bounded-test-policy.d.ts.map +1 -1
- package/dist/bounded-test-policy.js +14 -15
- package/dist/build-state-output-policy.d.ts +95 -1
- package/dist/build-state-output-policy.d.ts.map +1 -1
- package/dist/build-state-output-policy.js +368 -30
- package/dist/bun-lock-scope.d.ts +44 -0
- package/dist/bun-lock-scope.d.ts.map +1 -0
- package/dist/bun-lock-scope.js +97 -0
- package/dist/cargo-build-script-env.d.ts +49 -0
- package/dist/cargo-build-script-env.d.ts.map +1 -0
- package/dist/cargo-build-script-env.js +324 -0
- package/dist/cargo-closure-input.d.ts +31 -4
- package/dist/cargo-closure-input.d.ts.map +1 -1
- package/dist/cargo-closure-input.js +66 -6
- package/dist/cargo-retention-hook.d.ts +17 -0
- package/dist/cargo-retention-hook.d.ts.map +1 -0
- package/dist/cargo-retention-hook.js +85 -0
- package/dist/cargo-source-hash.d.ts +25 -7
- package/dist/cargo-source-hash.d.ts.map +1 -1
- package/dist/cargo-source-hash.js +108 -43
- package/dist/cargo-toolchain-paths.d.ts +40 -0
- package/dist/cargo-toolchain-paths.d.ts.map +1 -0
- package/dist/cargo-toolchain-paths.js +84 -0
- package/dist/cargo-toolchain-policy.d.ts +25 -8
- package/dist/cargo-toolchain-policy.d.ts.map +1 -1
- package/dist/cargo-toolchain-policy.js +39 -5
- package/dist/cargo-workspace.d.ts +10 -4
- package/dist/cargo-workspace.d.ts.map +1 -1
- package/dist/cargo-workspace.js +65 -95
- package/dist/cross-check-policy.d.ts +9 -9
- package/dist/cross-check-policy.d.ts.map +1 -1
- package/dist/cross-check-policy.js +11 -11
- package/dist/disk-command-policy.d.ts.map +1 -1
- package/dist/disk-command-policy.js +1 -0
- package/dist/ensure-built-receipt.d.ts +13 -5
- package/dist/ensure-built-receipt.d.ts.map +1 -1
- package/dist/ensure-built-receipt.js +126 -47
- package/dist/ensure-built-witness.d.ts +27 -8
- package/dist/ensure-built-witness.d.ts.map +1 -1
- package/dist/ensure-built-witness.js +45 -15
- package/dist/ensure-built.d.ts.map +1 -1
- package/dist/ensure-built.js +9 -1
- package/dist/eslint-config-closure.d.ts +7 -0
- package/dist/eslint-config-closure.d.ts.map +1 -0
- package/dist/eslint-config-closure.js +346 -0
- package/dist/executors/all-verdicts/executor.d.ts +35 -0
- package/dist/executors/all-verdicts/executor.d.ts.map +1 -0
- package/dist/executors/all-verdicts/executor.js +133 -0
- package/dist/executors/all-verdicts/schema.d.ts +10 -0
- package/dist/executors/all-verdicts/schema.d.ts.map +1 -0
- package/dist/executors/all-verdicts/schema.js +2 -0
- package/dist/executors/bounded-exec/bounds.d.ts +56 -0
- package/dist/executors/bounded-exec/bounds.d.ts.map +1 -0
- package/dist/executors/bounded-exec/bounds.js +43 -0
- package/dist/executors/bounded-exec/cpu-pool.d.ts +33 -36
- package/dist/executors/bounded-exec/cpu-pool.d.ts.map +1 -1
- package/dist/executors/bounded-exec/cpu-pool.js +54 -119
- package/dist/executors/bounded-exec/executor.d.ts +19 -12
- package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
- package/dist/executors/bounded-exec/executor.js +371 -239
- package/dist/executors/bounded-exec/gateway-lease.d.ts +22 -19
- package/dist/executors/bounded-exec/gateway-lease.d.ts.map +1 -1
- package/dist/executors/bounded-exec/gateway-lease.js +81 -28
- package/dist/executors/bounded-exec/hang-diagnostics.d.ts +18 -1
- package/dist/executors/bounded-exec/hang-diagnostics.d.ts.map +1 -1
- package/dist/executors/bounded-exec/hang-diagnostics.js +148 -30
- package/dist/executors/bounded-exec/lease-wait.d.ts +43 -0
- package/dist/executors/bounded-exec/lease-wait.d.ts.map +1 -0
- package/dist/executors/bounded-exec/lease-wait.js +68 -0
- package/dist/executors/bounded-exec/lock-wait.d.ts +51 -0
- package/dist/executors/bounded-exec/lock-wait.d.ts.map +1 -0
- package/dist/executors/bounded-exec/lock-wait.js +108 -0
- package/dist/executors/bounded-exec/owned-subtree.d.ts +84 -0
- package/dist/executors/bounded-exec/owned-subtree.d.ts.map +1 -0
- package/dist/executors/bounded-exec/owned-subtree.js +178 -0
- package/dist/executors/bounded-exec/progress.d.ts +4 -1
- package/dist/executors/bounded-exec/progress.d.ts.map +1 -1
- package/dist/executors/bounded-exec/progress.js +5 -2
- package/dist/executors/bounded-exec/ram-attach.d.ts +19 -0
- package/dist/executors/bounded-exec/ram-attach.d.ts.map +1 -0
- package/dist/executors/bounded-exec/ram-attach.js +207 -0
- package/dist/executors/bounded-exec/ram-detach.d.ts +25 -0
- package/dist/executors/bounded-exec/ram-detach.d.ts.map +1 -0
- package/dist/executors/bounded-exec/ram-detach.js +207 -0
- package/dist/executors/bounded-exec/ram-temp-fixtures.d.ts +76 -0
- package/dist/executors/bounded-exec/ram-temp-fixtures.d.ts.map +1 -1
- package/dist/executors/bounded-exec/ram-temp-fixtures.js +296 -0
- package/dist/executors/bounded-exec/ram-temp.d.ts +388 -88
- package/dist/executors/bounded-exec/ram-temp.d.ts.map +1 -1
- package/dist/executors/bounded-exec/ram-temp.js +1213 -399
- package/dist/executors/bounded-exec/run-cpu-pool.d.ts +4 -4
- package/dist/executors/bounded-exec/run-cpu-pool.d.ts.map +1 -1
- package/dist/executors/bounded-exec/run-cpu-pool.js +20 -30
- package/dist/executors/bounded-exec/runner-hook.js +14 -5
- package/dist/executors/bounded-exec/runner-lifecycle.d.ts +14 -1
- package/dist/executors/bounded-exec/runner-lifecycle.d.ts.map +1 -1
- package/dist/executors/bounded-exec/runner-lifecycle.js +27 -6
- package/dist/executors/bounded-exec/{cpu-tokens.d.ts → runner-sizing.d.ts} +14 -42
- package/dist/executors/bounded-exec/runner-sizing.d.ts.map +1 -0
- package/dist/executors/bounded-exec/{cpu-tokens.js → runner-sizing.js} +5 -35
- package/dist/executors/bounded-exec/runtime-pin.d.ts +73 -0
- package/dist/executors/bounded-exec/runtime-pin.d.ts.map +1 -0
- package/dist/executors/bounded-exec/runtime-pin.js +167 -0
- package/dist/executors/bounded-exec/schema.d.ts +18 -1
- package/dist/executors/bounded-exec/schema.d.ts.map +1 -1
- package/dist/executors/bounded-exec/verdict.d.ts +40 -11
- package/dist/executors/bounded-exec/verdict.d.ts.map +1 -1
- package/dist/executors/bounded-exec/verdict.js +88 -19
- package/dist/executors/cargo-zigbuild/executor.d.ts +21 -0
- package/dist/executors/cargo-zigbuild/executor.d.ts.map +1 -1
- package/dist/executors/cargo-zigbuild/executor.js +67 -12
- package/dist/executors/clean-outputs/executor.js +1 -0
- package/dist/executors/scriptc-native/executor.d.ts +79 -0
- package/dist/executors/scriptc-native/executor.d.ts.map +1 -0
- package/dist/executors/scriptc-native/executor.js +367 -0
- package/dist/executors/scriptc-native/ffi-paths.d.ts +9 -0
- package/dist/executors/scriptc-native/ffi-paths.d.ts.map +1 -0
- package/dist/executors/scriptc-native/ffi-paths.js +25 -0
- package/dist/executors/scriptc-native/schema.d.ts +34 -0
- package/dist/executors/scriptc-native/schema.d.ts.map +1 -0
- package/dist/executors/scriptc-native/schema.js +1 -0
- package/dist/executors/typescript-emit/executor.d.ts +3 -1
- package/dist/executors/typescript-emit/executor.d.ts.map +1 -1
- package/dist/executors/typescript-emit/executor.js +164 -33
- package/dist/forbidden-spelling-policy.d.ts +56 -0
- package/dist/forbidden-spelling-policy.d.ts.map +1 -0
- package/dist/forbidden-spelling-policy.js +176 -0
- package/dist/generators/create-package/generator.d.ts.map +1 -1
- package/dist/generators/create-package/generator.js +3 -4
- package/dist/graph-input-contract.d.ts +14 -0
- package/dist/graph-input-contract.d.ts.map +1 -1
- package/dist/graph-input-contract.js +67 -2
- package/dist/index.d.ts +23 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +676 -215
- package/dist/managed-assets.d.ts +2 -0
- package/dist/managed-assets.d.ts.map +1 -1
- package/dist/managed-files/files.d.ts +3 -3
- package/dist/managed-files/files.d.ts.map +1 -1
- package/dist/managed-files/files.js +28 -3
- package/dist/managed-files/managed-format.d.ts.map +1 -1
- package/dist/managed-files/managed-format.js +1 -0
- package/dist/nextest-code-bound.js +1 -0
- package/dist/nextest-timings.d.ts +35 -0
- package/dist/nextest-timings.d.ts.map +1 -0
- package/dist/nextest-timings.js +168 -0
- package/dist/owned-installation.d.ts +6 -5
- package/dist/owned-installation.d.ts.map +1 -1
- package/dist/owned-installation.js +150 -26
- package/dist/package-target-policy.d.ts.map +1 -1
- package/dist/package-target-policy.js +2 -3
- package/dist/process-children.d.ts +7 -0
- package/dist/process-children.d.ts.map +1 -0
- package/dist/process-children.darwin.d.ts +7 -0
- package/dist/process-children.darwin.d.ts.map +1 -0
- package/dist/process-children.darwin.js +13 -0
- package/dist/process-children.js +14 -0
- package/dist/process-children.linux.d.ts +8 -0
- package/dist/process-children.linux.d.ts.map +1 -0
- package/dist/process-children.linux.js +25 -0
- package/dist/process-group.d.ts +108 -0
- package/dist/process-group.d.ts.map +1 -0
- package/dist/process-group.js +171 -0
- package/dist/process-listing.d.ts +7 -0
- package/dist/process-listing.d.ts.map +1 -0
- package/dist/process-listing.js +51 -0
- package/dist/producer-receipts.d.ts +8 -2
- package/dist/producer-receipts.d.ts.map +1 -1
- package/dist/producer-receipts.js +75 -48
- package/dist/task-graph-policy.d.ts +21 -0
- package/dist/task-graph-policy.d.ts.map +1 -0
- package/dist/task-graph-policy.js +91 -0
- package/dist/test-timings.js +4 -4
- package/dist/test-walk-policy.d.ts +14 -5
- package/dist/test-walk-policy.d.ts.map +1 -1
- package/dist/test-walk-policy.js +8 -2
- package/dist/testing.d.ts +73 -28
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +217 -223
- package/dist/tool-bins.d.ts +33 -0
- package/dist/tool-bins.d.ts.map +1 -0
- package/dist/tool-bins.js +72 -0
- package/dist/typecheck-test-policy.d.ts.map +1 -1
- package/dist/typecheck-test-policy.js +3 -4
- package/dist/wait-why-policy.d.ts +28 -0
- package/dist/wait-why-policy.d.ts.map +1 -0
- package/dist/wait-why-policy.js +223 -0
- package/dist/workspace-config-policy.d.ts +14 -8
- package/dist/workspace-config-policy.d.ts.map +1 -1
- package/dist/workspace-config-policy.js +60 -16
- package/dist/workspace-manifest.d.ts +41 -6
- package/dist/workspace-manifest.d.ts.map +1 -1
- package/dist/workspace-manifest.js +57 -0
- package/executors.json +21 -1
- package/loader.js +2 -0
- package/managed/raw/envrc +11 -0
- package/managed/raw/patches/nx@23.2.1.patch +2840 -199
- package/managed/raw/patches/ttsc@0.34.1.patch +119 -0
- package/managed/raw/tooling/direnv/cargo-fetch-bound.ts +245 -0
- package/managed/raw/tooling/direnv/cargo-fetch-run.ts +299 -0
- package/managed/raw/tooling/direnv/compiler-variables.sh +42 -0
- package/managed/raw/tooling/direnv/developer-links.ts +464 -25
- package/managed/raw/tooling/direnv/devenv.smoo.nix +78 -38
- package/managed/raw/tooling/direnv/github-actions-bootstrap.sh +14 -12
- package/managed/raw/tooling/direnv/installed-bun-links.ts +308 -0
- package/managed/raw/tooling/direnv/linked-snapshots.ts +62 -3
- package/managed/raw/tooling/direnv/nx-socket-dir.sh +56 -17
- package/managed/raw/tooling/direnv/repo-path +68 -6
- package/managed/raw/tooling/direnv/secret-references.ts +13 -4
- package/managed/raw/tooling/direnv/setup-environment.ts +128 -537
- package/managed/raw/tooling/direnv/toolchain-stamp.ts +4 -2
- package/managed/raw/tooling/direnv/ttsc-env.sh +9 -0
- package/managed/raw/tooling/direnv/uv-relocation.ts +227 -0
- package/managed/raw/tooling/git-hooks/commit-msg.sh +2 -1
- package/managed/raw/tooling/git-hooks/pre-commit.sh +2 -1
- package/managed/raw/tooling/git-hooks/pre-push.sh +2 -1
- package/managed/templates/github/actions/cache-ttsc-plugins/action.yml +85 -7
- package/managed/templates/github/actions/save-nix-devenv/action.yml +12 -2
- package/managed/templates/github/actions/setup-devenv/action.yml +2 -0
- package/package.json +77 -13
- package/src/bin/smoo-nx-cargo-toolchain.ts +11 -0
- package/src/bin/smoo-nx-forbidden-spellings.ts +33 -0
- package/src/bin/smoo-nx-nextest-timings.ts +31 -0
- package/src/bounded-test-policy.ts +12 -14
- package/src/build-state-output-policy.ts +458 -34
- package/src/bun-lock-scope.ts +108 -0
- package/src/cargo-build-script-env.ts +265 -0
- package/src/cargo-closure-input.ts +74 -7
- package/src/cargo-retention-hook.ts +94 -0
- package/src/cargo-source-hash.ts +138 -41
- package/src/cargo-toolchain-paths.ts +95 -0
- package/src/cargo-toolchain-policy.ts +49 -5
- package/src/cargo-workspace.ts +72 -123
- package/src/cross-check-policy.ts +12 -10
- package/src/disk-command-policy.ts +1 -0
- package/src/ensure-built-receipt.ts +132 -39
- package/src/ensure-built-witness.ts +62 -10
- package/src/ensure-built.ts +11 -1
- package/src/eslint-config-closure.ts +357 -0
- package/src/executors/all-verdicts/executor.ts +164 -0
- package/src/executors/all-verdicts/schema.json +22 -0
- package/src/executors/all-verdicts/schema.ts +10 -0
- package/src/executors/bounded-exec/bounds.ts +76 -0
- package/src/executors/bounded-exec/cpu-pool.ts +51 -117
- package/src/executors/bounded-exec/executor.ts +423 -259
- package/src/executors/bounded-exec/gateway-lease.ts +82 -33
- package/src/executors/bounded-exec/hang-diagnostics.ts +173 -31
- package/src/executors/bounded-exec/lease-wait.ts +89 -0
- package/src/executors/bounded-exec/lock-wait.ts +141 -0
- package/src/executors/bounded-exec/owned-subtree.ts +235 -0
- package/src/executors/bounded-exec/progress.ts +9 -3
- package/src/executors/bounded-exec/ram-attach.ts +238 -0
- package/src/executors/bounded-exec/ram-detach.ts +226 -0
- package/src/executors/bounded-exec/ram-temp-fixtures.ts +358 -0
- package/src/executors/bounded-exec/ram-temp-registry.txt +440 -0
- package/src/executors/bounded-exec/ram-temp.ts +1497 -460
- package/src/executors/bounded-exec/run-cpu-pool.ts +22 -30
- package/src/executors/bounded-exec/runner-hook.ts +14 -6
- package/src/executors/bounded-exec/runner-lifecycle.ts +31 -8
- package/src/executors/bounded-exec/{cpu-tokens.ts → runner-sizing.ts} +13 -59
- package/src/executors/bounded-exec/runtime-pin.ts +232 -0
- package/src/executors/bounded-exec/schema.json +11 -2
- package/src/executors/bounded-exec/schema.ts +19 -1
- package/src/executors/bounded-exec/verdict.ts +137 -34
- package/src/executors/cargo-zigbuild/executor.ts +82 -8
- package/src/executors/clean-outputs/executor.ts +1 -0
- package/src/executors/scriptc-native/executor.ts +394 -0
- package/src/executors/scriptc-native/ffi-paths.ts +29 -0
- package/src/executors/scriptc-native/schema.json +60 -0
- package/src/executors/scriptc-native/schema.ts +34 -0
- package/src/executors/typescript-emit/executor.ts +205 -38
- package/src/forbidden-spelling-policy.ts +226 -0
- package/src/generators/create-package/generator.ts +7 -7
- package/src/graph-input-contract.ts +61 -2
- package/src/index.ts +792 -225
- package/src/managed-assets.ts +3 -0
- package/src/managed-files/files.ts +28 -3
- package/src/managed-files/managed-format.ts +1 -0
- package/src/nextest-code-bound.ts +1 -0
- package/src/nextest-timings.ts +106 -0
- package/src/owned-installation.ts +150 -23
- package/src/package-target-policy.ts +2 -3
- package/src/process-children.darwin.ts +14 -0
- package/src/process-children.linux.ts +33 -0
- package/src/process-children.ts +22 -0
- package/src/process-group.ts +209 -0
- package/src/process-listing.ts +54 -0
- package/src/producer-receipts.ts +68 -45
- package/src/task-graph-policy.ts +98 -0
- package/src/test-walk-policy.ts +23 -8
- package/src/testing.ts +240 -232
- package/src/tool-bins.ts +108 -0
- package/src/typecheck-test-policy.ts +2 -3
- package/src/wait-why-policy.ts +226 -0
- package/src/workspace-config-policy.ts +63 -15
- package/src/workspace-manifest.ts +89 -6
- package/test-timings.json +123 -98
- package/dist/bin/smoo-nx-failures.d.ts +0 -3
- package/dist/bin/smoo-nx-failures.d.ts.map +0 -1
- package/dist/bin/smoo-nx-failures.js +0 -3
- package/dist/bin/smoo-nx-nextest-extract.d.ts +0 -3
- package/dist/bin/smoo-nx-nextest-extract.d.ts.map +0 -1
- package/dist/bin/smoo-nx-nextest-extract.js +0 -42
- package/dist/executors/bounded-exec/cpu-tokens.d.ts.map +0 -1
- package/dist/failure-summary.d.ts +0 -5
- package/dist/failure-summary.d.ts.map +0 -1
- package/dist/failure-summary.js +0 -118
- package/dist/nextest-extraction.d.ts +0 -117
- package/dist/nextest-extraction.d.ts.map +0 -1
- package/dist/nextest-extraction.js +0 -303
- package/managed/raw/patches/ttsc@0.30.4.patch +0 -2255
- package/src/__tests__/cargo-closure-filesets.ts +0 -94
- package/src/__tests__/cargo-closure-fixture.ts +0 -113
- package/src/__tests__/counted-cargo-process.ts +0 -286
- package/src/__tests__/counted-cargo.ts +0 -713
- package/src/__tests__/directory-change.ts +0 -27
- package/src/__tests__/fixture-cargo-home.ts +0 -36
- package/src/__tests__/fixture-nx-env.ts +0 -193
- package/src/__tests__/owned-installation.ts +0 -13
- package/src/__tests__/past-tick.ts +0 -12
- package/src/__tests__/progress-clock.ts +0 -43
- package/src/__tests__/runtime-input.ts +0 -23
- package/src/bin/smoo-nx-bound-failures.test.ts +0 -127
- package/src/bin/smoo-nx-failures.ts +0 -4
- package/src/bin/smoo-nx-nextest-extract.ts +0 -44
- package/src/bounded-test-policy.test.ts +0 -1029
- package/src/build-state-output-policy.test.ts +0 -115
- package/src/bun-bootstrap.test.ts +0 -102
- package/src/bun-file-packages.test.ts +0 -47
- package/src/cargo-closure-filesets.test.ts +0 -63
- package/src/cargo-closure-input.property.test.ts +0 -50
- package/src/cargo-closure-input.test.ts +0 -506
- package/src/cargo-closure-key.test.ts +0 -240
- package/src/cargo-resolve-cache.test.ts +0 -1181
- package/src/cargo-source-hash.test.ts +0 -707
- package/src/cargo-workspace.test.ts +0 -615
- package/src/cross-check-policy.test.ts +0 -316
- package/src/disk-command-policy.test.ts +0 -61
- package/src/ensure-built-receipt.test.ts +0 -279
- package/src/ensure-built-witness.test.ts +0 -688
- package/src/ensure-built.test.ts +0 -1462
- package/src/executors/bounded-exec/cargo-progress-host.test.ts +0 -332
- package/src/executors/bounded-exec/cpu-pool.test.ts +0 -684
- package/src/executors/bounded-exec/cpu-tokens.test.ts +0 -519
- package/src/executors/bounded-exec/disk-lease.test.ts +0 -219
- package/src/executors/bounded-exec/executor-host.test.ts +0 -800
- package/src/executors/bounded-exec/executor.test.ts +0 -1819
- package/src/executors/bounded-exec/go-progress-host.test.ts +0 -171
- package/src/executors/bounded-exec/hang-diagnostics.test.ts +0 -291
- package/src/executors/bounded-exec/progress.test.ts +0 -139
- package/src/executors/bounded-exec/ram-temp-held.test.ts +0 -264
- package/src/executors/bounded-exec/ram-temp-host.test.ts +0 -635
- package/src/executors/bounded-exec/ram-temp.test.ts +0 -750
- package/src/executors/bounded-exec/run-cpu-pool.test.ts +0 -79
- package/src/executors/bounded-exec/runner-hook.test.ts +0 -193
- package/src/executors/bounded-exec/runner-lifecycle.test.ts +0 -82
- package/src/executors/bounded-exec/verdict.test.ts +0 -545
- package/src/executors/cargo-zigbuild/executor.test.ts +0 -129
- package/src/executors/clean-outputs/executor.test.ts +0 -20
- package/src/executors/typescript-emit/executor.test.ts +0 -83
- package/src/failure-summary.ts +0 -119
- package/src/generators/bounded-test-targets/generator.test.ts +0 -138
- package/src/generators/bun-test-tracing/generator.test.ts +0 -250
- package/src/generators/create-package/generator.test.ts +0 -190
- package/src/generators/make-public/generator.test.ts +0 -137
- package/src/graph-input-contract.test.ts +0 -379
- package/src/host-controller-wiring.test.ts +0 -31
- package/src/index.test.ts +0 -3319
- package/src/linked-snapshots.nx.test.ts +0 -254
- package/src/managed-files/forgejo-artifact.test.ts +0 -395
- package/src/managed-files/generator.test.ts +0 -243
- package/src/managed-files/github-host-cache-isolation.test.ts +0 -86
- package/src/managed-files/json-edit.test.ts +0 -216
- package/src/managed-files/managed-content.test.ts +0 -166
- package/src/managed-files/managed-format-json.test.ts +0 -308
- package/src/managed-files/repo-path.test.ts +0 -172
- package/src/managed-files/setup-devenv-free-disk.test.ts +0 -95
- package/src/managed-files/trace-db-artifact.test.ts +0 -7
- package/src/managed-files/tree-permissions.test.ts +0 -109
- package/src/managed-files/tree.test.ts +0 -123
- package/src/manifest-hash.test.ts +0 -219
- package/src/nextest-code-bound.test.ts +0 -161
- package/src/nextest-extraction.test.ts +0 -216
- package/src/nextest-extraction.ts +0 -371
- package/src/nextest-partitions.test.ts +0 -501
- package/src/nx-cache-bound.test.ts +0 -109
- package/src/nx-cache-restore-mtime.test.ts +0 -170
- package/src/nx-daemon-claim.test.ts +0 -279
- package/src/nx-daemon-idle-cpu.test.ts +0 -80
- package/src/nx-daemon-idle-policy.test.ts +0 -111
- package/src/nx-daemon-ignore-files.test.ts +0 -210
- package/src/nx-daemon-root-normalization.test.ts +0 -105
- package/src/nx-daemon-start-never.test.ts +0 -292
- package/src/nx-daemon-validity.test.ts +0 -1055
- package/src/nx-dot-input-policy.test.ts +0 -353
- package/src/nx-failure-life-cycles.test.ts +0 -207
- package/src/nx-files-archive-racy.test.ts +0 -97
- package/src/nx-foreign-workspace-env.test.ts +0 -329
- package/src/nx-incomplete-run-summary.test.ts +0 -70
- package/src/nx-plugin-load-errors.test.ts +0 -120
- package/src/nx-project-graph-errors.test.ts +0 -70
- package/src/nx-project-resolution-cache.test.ts +0 -176
- package/src/nx-raw-inputs.test.ts +0 -166
- package/src/nx-resident-graph-workers.test.ts +0 -112
- package/src/nx-run-information.test.ts +0 -118
- package/src/nx-skipped-task-exit.test.ts +0 -180
- package/src/nx-state-location.test.ts +0 -63
- package/src/nx-store-resolution.test.ts +0 -81
- package/src/nx-task-graph-cycles.test.ts +0 -148
- package/src/nx-task-output-lease.test.ts +0 -550
- package/src/nx-use-local.test.ts +0 -105
- package/src/owned-installation.test.ts +0 -105
- package/src/package-target-policy.test.ts +0 -1014
- package/src/producer-receipts.test.ts +0 -285
- package/src/release-config-policy.test.ts +0 -311
- package/src/runtime-input.test.ts +0 -393
- package/src/serial-group-wiring.test.ts +0 -326
- package/src/task-history-namespace.test.ts +0 -181
- package/src/task-results.test.ts +0 -228
- package/src/test-clock-policy.test.ts +0 -338
- package/src/test-program.test.ts +0 -303
- package/src/test-timings.test.ts +0 -240
- package/src/test-walk-policy.test.ts +0 -620
- package/src/testing.test.ts +0 -509
- package/src/typecheck-test-policy.test.ts +0 -1468
- package/src/typescript-resolution.test.ts +0 -76
- package/src/version-actions.test.ts +0 -80
- package/src/workspace-config-policy.test.ts +0 -737
|
@@ -179,8 +179,9 @@ type ProducerRecord = Extract<EnsureBuiltProbeResult, { readonly disposition: 'h
|
|
|
179
179
|
const PRODUCER_VERSION = 1;
|
|
180
180
|
|
|
181
181
|
/**
|
|
182
|
-
* A snapshot ID resolves
|
|
183
|
-
* the provider's current state. A refusal names its cause and
|
|
182
|
+
* A snapshot ID resolves from the consumer's store, which imports it from its main checkout's store when it lacks it.
|
|
183
|
+
* A capture declaration instead probes, copies and attests the provider's current state. A refusal names its cause and
|
|
184
|
+
* leaves every binding as it was.
|
|
184
185
|
*/
|
|
185
186
|
export async function snapshotBinding(
|
|
186
187
|
root: string,
|
|
@@ -207,7 +208,7 @@ export async function snapshotBinding(
|
|
|
207
208
|
/** Resolve an explicit content pin, never reading provider bytes or asking its producer to run. */
|
|
208
209
|
export function pinnedSnapshot(root: string, name: string, source: string, id: string): SealedSnapshot {
|
|
209
210
|
if (!/^[0-9a-f]{64}$/.test(id)) throw new SnapshotRefusal(`snapshot pin ${id} must be 64 lowercase hex digits`);
|
|
210
|
-
const sealed =
|
|
211
|
+
const sealed = storedPin(root, id);
|
|
211
212
|
const receipt = verifySnapshot(sealed);
|
|
212
213
|
if (receipt.name !== name) throw new SnapshotRefusal(`snapshot ${id} contains ${receipt.name}, not ${name}`);
|
|
213
214
|
if (!contained(receipt.packagePath))
|
|
@@ -866,6 +867,64 @@ function publish(incoming: string, sealed: string, id: string): void {
|
|
|
866
867
|
}
|
|
867
868
|
}
|
|
868
869
|
|
|
870
|
+
/**
|
|
871
|
+
* The project's main checkout: the anchor of genuine sibling directories (developer-links.ts `declaredTarget`), and
|
|
872
|
+
* the checkout whose store a fork imports a pin from. A cowshed marker names it without reading main's tree.
|
|
873
|
+
*/
|
|
874
|
+
export function linkAnchor(root: string): string {
|
|
875
|
+
let marker: unknown;
|
|
876
|
+
try {
|
|
877
|
+
marker = JSON.parse(readFileSync(path.join(root, '.cowshed', 'workspace.json'), 'utf8'));
|
|
878
|
+
} catch (error) {
|
|
879
|
+
if (error instanceof Error && 'code' in error && error.code === 'ENOENT') {
|
|
880
|
+
return root;
|
|
881
|
+
}
|
|
882
|
+
throw error;
|
|
883
|
+
}
|
|
884
|
+
const projectRoot = typeof marker === 'object' && marker !== null ? Reflect.get(marker, 'projectRoot') : undefined;
|
|
885
|
+
return typeof projectRoot === 'string' && path.isAbsolute(projectRoot) ? projectRoot : root;
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
/**
|
|
889
|
+
* Where pin `id` is sealed in `root`'s store. A store that lacks it imports it from the store of the project's main
|
|
890
|
+
* checkout (`linkAnchor`): a snapshot is content-addressed, so the import copies it into a temporary entry of this
|
|
891
|
+
* store, verifies its census and identity there under its name, and renames it into place. A pin neither store holds
|
|
892
|
+
* refuses, naming both.
|
|
893
|
+
*/
|
|
894
|
+
function storedPin(root: string, id: string): string {
|
|
895
|
+
const sealed = path.resolve(root, SNAPSHOT_STORE, id);
|
|
896
|
+
if (lstatSync(sealed, { throwIfNoEntry: false }) !== undefined) return sealed;
|
|
897
|
+
const main = path.resolve(linkAnchor(root), SNAPSHOT_STORE, id);
|
|
898
|
+
if (main === sealed) throw new SnapshotRefusal(`${path.dirname(sealed)} holds no snapshot ${id}`);
|
|
899
|
+
if (lstatSync(main, { throwIfNoEntry: false }) === undefined) {
|
|
900
|
+
throw new SnapshotRefusal(
|
|
901
|
+
`neither ${path.dirname(sealed)} nor the main checkout's ${path.dirname(main)} holds snapshot ${id}`,
|
|
902
|
+
);
|
|
903
|
+
}
|
|
904
|
+
const incoming = mkdtempSync(path.join(snapshotStore(root), '.incoming-'));
|
|
905
|
+
try {
|
|
906
|
+
const copy = path.join(incoming, id);
|
|
907
|
+
copySealed(main, copy);
|
|
908
|
+
verifySnapshot(copy);
|
|
909
|
+
publish(copy, sealed, id);
|
|
910
|
+
} finally {
|
|
911
|
+
rmSync(incoming, { recursive: true, force: true });
|
|
912
|
+
}
|
|
913
|
+
return sealed;
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
/** `from`'s tree made again at `to`: directories, files cloned with their modes, and links by their text. */
|
|
917
|
+
function copySealed(from: string, to: string): void {
|
|
918
|
+
mkdirSync(to);
|
|
919
|
+
for (const entry of readdirSync(from, { withFileTypes: true })) {
|
|
920
|
+
const source = path.join(from, entry.name);
|
|
921
|
+
const destination = path.join(to, entry.name);
|
|
922
|
+
if (entry.isDirectory()) copySealed(source, destination);
|
|
923
|
+
else if (entry.isSymbolicLink()) symlinkSync(readlinkSync(source), destination);
|
|
924
|
+
else copyFileSync(source, destination, constants.COPYFILE_FICLONE);
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
|
|
869
928
|
/** A sealed snapshot's receipt, or null when `directory` holds none. Its census is not verified here. */
|
|
870
929
|
export function readSealed(directory: string): SnapshotReceipt | null {
|
|
871
930
|
let input: unknown;
|
|
@@ -15,8 +15,18 @@
|
|
|
15
15
|
# cowshed fork entered from a shell that had been in main's checkout did
|
|
16
16
|
# exactly that: its Nx held main's database on main's build volume, and the
|
|
17
17
|
# next land into main could not adopt. The smoo Nx wrappers drop the same
|
|
18
|
-
# keys
|
|
19
|
-
#
|
|
18
|
+
# keys when the caller's root is another workspace (WORKSPACE_STATE_ENV_KEYS).
|
|
19
|
+
#
|
|
20
|
+
# The root is not the only evidence: an environment can carry another
|
|
21
|
+
# workspace's absolute overrides with no root at all, or with a root a
|
|
22
|
+
# launcher rebound to this checkout (an agent session that came from main's
|
|
23
|
+
# shell, through `cowshed exec --host`, kept main's cache and task database
|
|
24
|
+
# and wrote into main's .nx). An override whose path lies inside an Nx
|
|
25
|
+
# workspace, the nearest nx.json at or above it, other than this checkout
|
|
26
|
+
# belongs to that workspace, and the whole set goes with it: the cache moves
|
|
27
|
+
# with the database. An override inside this checkout, inside its build
|
|
28
|
+
# volume, or inside no workspace at all (CI's shared bind) is the caller's
|
|
29
|
+
# own and stays.
|
|
20
30
|
#
|
|
21
31
|
# One socket dir per Nx workspace. DEVENV_RUNTIME is keyed to the devenv ROOT,
|
|
22
32
|
# so every workspace sharing one devenv - a sibling repository, a
|
|
@@ -42,36 +52,65 @@
|
|
|
42
52
|
# the checkout's .cowshed/env at every supervisor start; the shell reads it
|
|
43
53
|
# from there, never re-deriving it, and never from the caller's environment,
|
|
44
54
|
# whose COWSHED_RUNTIME_LINK may be another workspace's. A host shell creates
|
|
45
|
-
# the link when cowshed has not yet, exactly as cowshed would.
|
|
46
|
-
#
|
|
55
|
+
# the link when cowshed has not yet, exactly as cowshed would.
|
|
56
|
+
#
|
|
57
|
+
# In a cowshed workspace (.cowshed/workspace.json marks one) that link is the
|
|
58
|
+
# only socket dir, and anything else fails (cowshed specs/cowshed/04_sandbox.md):
|
|
59
|
+
# a .cowshed/env that names no link is a workspace its supervisor never served
|
|
60
|
+
# (an interrupted fork leaves one, still linking its source's build volume), and
|
|
61
|
+
# a link that leads elsewhere is another checkout's. Either is refused, and the
|
|
62
|
+
# link is left alone; a socket dir of the shell's own would be a second daemon.
|
|
47
63
|
#
|
|
48
|
-
#
|
|
49
|
-
#
|
|
64
|
+
# Outside cowshed, a socket dir that already resolves inside this checkout is
|
|
65
|
+
# the caller's binding for it and stays. An inherited one that resolves
|
|
50
66
|
# elsewhere belongs to another workspace, so the workspace takes its own.
|
|
51
67
|
smoo_nx_checkout="$(pwd -P)"
|
|
68
|
+
smoo_nx_foreign=
|
|
52
69
|
if [ -n "${NX_WORKSPACE_ROOT_PATH:-}" ] &&
|
|
53
70
|
[ "$(cd "$NX_WORKSPACE_ROOT_PATH" >/dev/null 2>&1 && pwd -P)" != "$smoo_nx_checkout" ]; then
|
|
71
|
+
smoo_nx_foreign=1
|
|
72
|
+
fi
|
|
73
|
+
for smoo_nx_state in "${NX_WORKSPACE_DATA_DIRECTORY:-}" "${NX_CACHE_DIRECTORY:-}" "${NX_DAEMON_SOCKET_DIR:-}"; do
|
|
74
|
+
case "$smoo_nx_state" in
|
|
75
|
+
/*) ;;
|
|
76
|
+
*) continue ;;
|
|
77
|
+
esac
|
|
78
|
+
while [ -n "$smoo_nx_state" ] && [ ! -f "$smoo_nx_state/nx.json" ]; do
|
|
79
|
+
smoo_nx_state="${smoo_nx_state%/*}"
|
|
80
|
+
done
|
|
81
|
+
if [ -n "$smoo_nx_state" ] &&
|
|
82
|
+
[ "$(cd "$smoo_nx_state" >/dev/null 2>&1 && pwd -P)" != "$smoo_nx_checkout" ]; then
|
|
83
|
+
smoo_nx_foreign=1
|
|
84
|
+
fi
|
|
85
|
+
done
|
|
86
|
+
if [ -n "$smoo_nx_foreign" ]; then
|
|
54
87
|
unset NX_WORKSPACE_DATA_DIRECTORY NX_CACHE_DIRECTORY NX_DAEMON_SOCKET_DIR
|
|
55
88
|
fi
|
|
89
|
+
unset smoo_nx_foreign smoo_nx_state
|
|
56
90
|
export NX_WORKSPACE_ROOT_PATH="$PWD"
|
|
57
91
|
smoo_nx_socket=""
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
92
|
+
if [ -f .cowshed/workspace.json ]; then
|
|
93
|
+
smoo_nx_link=""
|
|
94
|
+
if [ -f .cowshed/env ]; then
|
|
95
|
+
smoo_nx_link="$(sed -n 's/^export COWSHED_RUNTIME_LINK=\(\/[A-Za-z0-9._\/-]*\)$/\1/p' .cowshed/env)"
|
|
96
|
+
fi
|
|
97
|
+
if [ -z "$smoo_nx_link" ]; then
|
|
98
|
+
echo "devenv: $smoo_nx_checkout/.cowshed/env names no COWSHED_RUNTIME_LINK: cowshed has not served this workspace, so Nx here has no socket dir; tooling/direnv/repo-path names the workspace and its next step" >&2
|
|
99
|
+
unset smoo_nx_checkout smoo_nx_socket smoo_nx_link
|
|
100
|
+
return 1
|
|
101
|
+
fi
|
|
102
|
+
smoo_nx_run="$(cd "$smoo_nx_checkout/.cowshed/run" && pwd -P)" || return $?
|
|
64
103
|
if [ ! -e "$smoo_nx_link" ] && [ ! -L "$smoo_nx_link" ]; then
|
|
65
104
|
ln -s "$smoo_nx_run" "$smoo_nx_link"
|
|
66
105
|
fi
|
|
67
|
-
if [ "$(cd "$smoo_nx_link" >/dev/null 2>&1 && pwd -P)"
|
|
68
|
-
smoo_nx_socket="$smoo_nx_link/nx"
|
|
69
|
-
else
|
|
106
|
+
if [ "$(cd "$smoo_nx_link" >/dev/null 2>&1 && pwd -P)" != "$smoo_nx_run" ]; then
|
|
70
107
|
echo "devenv: $smoo_nx_link does not lead to this checkout's $smoo_nx_run; Nx here cannot reach the workspace's sandboxed daemon" >&2
|
|
108
|
+
unset smoo_nx_checkout smoo_nx_socket smoo_nx_link smoo_nx_run
|
|
109
|
+
return 1
|
|
71
110
|
fi
|
|
111
|
+
smoo_nx_socket="$smoo_nx_link/nx"
|
|
72
112
|
unset smoo_nx_run
|
|
73
|
-
|
|
74
|
-
if [ -z "$smoo_nx_socket" ]; then
|
|
113
|
+
else
|
|
75
114
|
case "$(cd "${NX_SOCKET_DIR:-/nonexistent}" >/dev/null 2>&1 && pwd -P)/" in
|
|
76
115
|
"$smoo_nx_checkout"/*) smoo_nx_socket="$NX_SOCKET_DIR" ;;
|
|
77
116
|
*) smoo_nx_socket="$DEVENV_RUNTIME/nx-$(printf '%s' "$smoo_nx_checkout" | cksum | cut -d' ' -f1)" ;;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# All tooling that sets up PATH must call this instead of hardcoding paths.
|
|
4
4
|
#
|
|
5
5
|
# Usage:
|
|
6
|
-
#
|
|
6
|
+
# PATH="$(tooling/direnv/repo-path)" || exit $? # shell; serves an unserved cowshed workspace, refuses if it cannot
|
|
7
7
|
# tooling/direnv/repo-path --github-path # CI — appends to $GITHUB_PATH
|
|
8
8
|
# tooling/direnv/repo-path --print # debug — one entry per line
|
|
9
9
|
set -euo pipefail
|
|
@@ -46,14 +46,76 @@ case "${1:-}" in
|
|
|
46
46
|
*)
|
|
47
47
|
IFS=:
|
|
48
48
|
export PATH="${entries[*]}:$PATH"
|
|
49
|
-
|
|
49
|
+
# Bash expands `~` to HOME, or with HOME unset to the passwd home of the real uid: a caller that passes
|
|
50
|
+
# only PATH, such as a formatter or a hook under `env -i`, still reaches the installed cowshed.
|
|
51
|
+
home=~
|
|
52
|
+
installed="$home/Library/Application Support/dev.cowshed/bin"
|
|
53
|
+
if [[ -f "$root/.cowshed/workspace.json" ]]; then
|
|
54
|
+
# A cowshed workspace is entered only once its supervisor has served it (specs/cowshed/02_workspaces.md,
|
|
55
|
+
# "Workspace environment"). A mint publishes .cowshed/env without TMPDIR and COWSHED_RUNTIME_LINK; the
|
|
56
|
+
# supervisor start that serves the workspace adds both, after its mount has settled the checkout's build link
|
|
57
|
+
# (16_build_volumes.md, "One link per checkout"). A fork interrupted before that start still links its
|
|
58
|
+
# source's build volume, so Nx entered here writes the source checkout's daemon record and task database, and
|
|
59
|
+
# a TMPDIR or Nx socket dir the caller inherited is the source's too. Both values are therefore read from the
|
|
60
|
+
# file alone, never from the caller. A workspace whose file lacks either is served here, once, by the start an
|
|
61
|
+
# operator would run, and entered on the file that start wrote; it is refused, named, only when that start
|
|
62
|
+
# fails or leaves the file still lacking an entry.
|
|
63
|
+
entered="$PATH"
|
|
64
|
+
read_served() {
|
|
65
|
+
PATH="$entered"
|
|
66
|
+
unset TMPDIR COWSHED_RUNTIME_LINK
|
|
67
|
+
if [[ -f "$root/.cowshed/env" ]]; then
|
|
68
|
+
source "$root/.cowshed/env"
|
|
69
|
+
fi
|
|
70
|
+
missing=()
|
|
71
|
+
[[ "${TMPDIR:-}" == /* ]] || missing+=(TMPDIR)
|
|
72
|
+
[[ "${COWSHED_RUNTIME_LINK:-}" == /* ]] || missing+=(COWSHED_RUNTIME_LINK)
|
|
73
|
+
if ((${#missing[@]} > 0)); then
|
|
74
|
+
printf -v unset_names '%s, ' "${missing[@]}"
|
|
75
|
+
unset_names="${unset_names%, }"
|
|
76
|
+
fi
|
|
77
|
+
}
|
|
78
|
+
read_served
|
|
79
|
+
if ((${#missing[@]} > 0)); then
|
|
80
|
+
named='"workspace": *"([^"]+)"'
|
|
81
|
+
if [[ ! "$(<"$root/.cowshed/workspace.json")" =~ $named ]]; then
|
|
82
|
+
printf 'repo-path: cowshed workspace at %s is not served: its .cowshed/env sets no %s, and its .cowshed/workspace.json names no workspace to serve.\n' \
|
|
83
|
+
"$root" "$unset_names" >&2
|
|
84
|
+
exit 1
|
|
85
|
+
fi
|
|
86
|
+
workspace="${BASH_REMATCH[1]}"
|
|
87
|
+
printf 'repo-path: cowshed workspace %s at %s is not served: its .cowshed/env sets no %s. Serving it: cowshed exec %s -- true\n' \
|
|
88
|
+
"$workspace" "$root" "$unset_names" "$workspace" >&2
|
|
89
|
+
# The installed cowshed's stable name, by its path (05_gateway.md, "The installed cowshed"), never a checkout's
|
|
90
|
+
# launcher, which runs whatever that checkout last built (06_cli.md, "Launcher"): a missing install fails by
|
|
91
|
+
# name rather than finding the launcher this PATH puts first. It gets neither the caller's TMPDIR and runtime
|
|
92
|
+
# link nor the unserved file's, and not the caller's stdin, where pre-push reads its refs. Everything it
|
|
93
|
+
# prints goes to stderr: stdout is this script's PATH.
|
|
94
|
+
serve_status=0
|
|
95
|
+
serve_output="$(
|
|
96
|
+
unset TMPDIR COWSHED_RUNTIME_LINK
|
|
97
|
+
{ cd "$root" && "$installed/cowshed" exec "$workspace" -- true </dev/null; } 2>&1
|
|
98
|
+
)" || serve_status=$?
|
|
99
|
+
if ((serve_status != 0)); then
|
|
100
|
+
printf 'repo-path: serving cowshed workspace %s at %s failed: cowshed exec %s -- true exited %d: %s\nUntil it is served, the checkout may still link the build volume, Nx daemon record and task database of the checkout it was forked from, so it is not entered.\nnext: cowshed exec %s -- true\n' \
|
|
101
|
+
"$workspace" "$root" "$workspace" "$serve_status" "${serve_output:-no output}" "$workspace" >&2
|
|
102
|
+
exit 1
|
|
103
|
+
fi
|
|
104
|
+
if [[ -n "$serve_output" ]]; then
|
|
105
|
+
printf '%s\n' "$serve_output" >&2
|
|
106
|
+
fi
|
|
107
|
+
read_served
|
|
108
|
+
if ((${#missing[@]} > 0)); then
|
|
109
|
+
printf 'repo-path: cowshed exec %s -- true succeeded, but cowshed workspace %s at %s is still not served: its .cowshed/env sets no %s.\n' \
|
|
110
|
+
"$workspace" "$workspace" "$root" "$unset_names" >&2
|
|
111
|
+
exit 1
|
|
112
|
+
fi
|
|
113
|
+
fi
|
|
114
|
+
elif [[ -f "$root/.cowshed/env" ]]; then
|
|
50
115
|
source "$root/.cowshed/env"
|
|
51
116
|
fi
|
|
52
117
|
if [[ -z "${COWSHED_RUNTIME_LINK:-}" ]]; then
|
|
53
|
-
|
|
54
|
-
# only PATH, such as a formatter or a hook under `env -i`, still reaches the installed cowshed.
|
|
55
|
-
home=~
|
|
56
|
-
export PATH="$home/Library/Application Support/dev.cowshed/bin:$PATH"
|
|
118
|
+
export PATH="$installed:$PATH"
|
|
57
119
|
fi
|
|
58
120
|
printf '%s\n' "$PATH" ;;
|
|
59
121
|
esac
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
* provider commands never run there. Missing variables refuse with
|
|
53
53
|
* injected-secret guidance instead of a confusing auth failure later.
|
|
54
54
|
* b. A `registry` variable inside a cowshed workspace
|
|
55
|
-
* (`
|
|
56
|
-
* gateway-enrollment guidance: such a workspace holds no
|
|
57
|
-
* session, and the gateway exists to be the thing that does.
|
|
55
|
+
* (`.cowshed/workspace.json` at the repository root) refuses with
|
|
56
|
+
* names-only gateway-enrollment guidance: such a workspace holds no
|
|
57
|
+
* provider session, and the gateway exists to be the thing that does.
|
|
58
58
|
* 3. A variable outside the requested group is deferred — named in the
|
|
59
59
|
* result, not resolved, and not a failure.
|
|
60
60
|
* 4. Otherwise the command argv executes directly, without a shell; stdout
|
|
@@ -148,6 +148,12 @@ export interface SecretResolutionRequest {
|
|
|
148
148
|
readonly group: SecretGroup;
|
|
149
149
|
/** Environment consulted for existing values and mode flags; read, never written. */
|
|
150
150
|
readonly env: Readonly<Record<string, string | undefined>>;
|
|
151
|
+
/**
|
|
152
|
+
* Whether the repository root is a cowshed workspace: `.cowshed/workspace.json`
|
|
153
|
+
* exists there (specs/cowshed/00_overview.md). A non-secret marker; the
|
|
154
|
+
* workspace token is not exported.
|
|
155
|
+
*/
|
|
156
|
+
readonly cowshedWorkspace: boolean;
|
|
151
157
|
/** Overrides the default direct-argv runner (test seam). */
|
|
152
158
|
readonly runCommand?: SecretCommandRunner;
|
|
153
159
|
}
|
|
@@ -383,6 +389,7 @@ async function routeSecret(
|
|
|
383
389
|
readonly env: Readonly<Record<string, string | undefined>>;
|
|
384
390
|
readonly group: SecretGroup;
|
|
385
391
|
readonly dependsOn: readonly SecretGroup[];
|
|
392
|
+
readonly cowshedWorkspace: boolean;
|
|
386
393
|
readonly run: SecretCommandRunner;
|
|
387
394
|
},
|
|
388
395
|
): Promise<SecretOutcome> {
|
|
@@ -404,7 +411,7 @@ async function routeSecret(
|
|
|
404
411
|
'CI does not run secret provider commands — inject this variable into the job environment from the CI secret store',
|
|
405
412
|
};
|
|
406
413
|
}
|
|
407
|
-
if (group === REGISTRY_GROUP &&
|
|
414
|
+
if (group === REGISTRY_GROUP && context.cowshedWorkspace) {
|
|
408
415
|
return {
|
|
409
416
|
name,
|
|
410
417
|
group,
|
|
@@ -444,6 +451,7 @@ export async function resolveSecrets(request: SecretResolutionRequest): Promise<
|
|
|
444
451
|
env: request.env,
|
|
445
452
|
group: request.group,
|
|
446
453
|
dependsOn: dependentGroups(request.group),
|
|
454
|
+
cowshedWorkspace: request.cowshedWorkspace,
|
|
447
455
|
run: request.runCommand ?? runSecretCommand,
|
|
448
456
|
};
|
|
449
457
|
const outcomes = await Promise.all(request.secrets.map(async (secret) => routeSecret(secret, context)));
|
|
@@ -607,6 +615,7 @@ export async function resolveSecretEnvironment(options: SecretResolutionOptions)
|
|
|
607
615
|
secrets: readSecretGroups(options.root),
|
|
608
616
|
group: options.group,
|
|
609
617
|
env: options.env ?? process.env,
|
|
618
|
+
cowshedWorkspace: existsSync(join(options.root, '.cowshed', 'workspace.json')),
|
|
610
619
|
runCommand: options.runCommand,
|
|
611
620
|
});
|
|
612
621
|
}
|