@invarn/cibuild 2.9.4 → 2.9.7
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/dist/chunk-35SI42CD.mjs +1 -0
- package/dist/chunk-IC45KVLJ.mjs +1 -0
- package/dist/chunk-XDY4V23V.mjs +1 -0
- package/dist/cli.cjs +14 -14
- package/dist/commands.mjs +1 -0
- package/dist/lib.mjs +3934 -0
- package/package.json +6 -10
- package/dist/src/cli.d.ts +0 -3
- package/dist/src/cli.d.ts.map +0 -1
- package/dist/src/cli.js +0 -399
- package/dist/src/commands/a-credential-target-follows-the-flavor-source-set.test.d.ts +0 -38
- package/dist/src/commands/a-credential-target-follows-the-flavor-source-set.test.d.ts.map +0 -1
- package/dist/src/commands/a-credential-target-follows-the-flavor-source-set.test.js +0 -222
- package/dist/src/commands/a-credential-two-workflows-cannot-share-is-declared-per-workflow.test.d.ts +0 -41
- package/dist/src/commands/a-credential-two-workflows-cannot-share-is-declared-per-workflow.test.d.ts.map +0 -1
- package/dist/src/commands/a-credential-two-workflows-cannot-share-is-declared-per-workflow.test.js +0 -324
- package/dist/src/commands/a-properties-stand-in-declares-the-keys-the-build-reads.test.d.ts +0 -2
- package/dist/src/commands/a-properties-stand-in-declares-the-keys-the-build-reads.test.d.ts.map +0 -1
- package/dist/src/commands/a-properties-stand-in-declares-the-keys-the-build-reads.test.js +0 -382
- package/dist/src/commands/an-already-stored-value-does-not-answer-the-target-question.test.d.ts +0 -29
- package/dist/src/commands/an-already-stored-value-does-not-answer-the-target-question.test.d.ts.map +0 -1
- package/dist/src/commands/an-already-stored-value-does-not-answer-the-target-question.test.js +0 -160
- package/dist/src/commands/android-gms-guard.test.d.ts +0 -9
- package/dist/src/commands/android-gms-guard.test.d.ts.map +0 -1
- package/dist/src/commands/android-gms-guard.test.js +0 -78
- package/dist/src/commands/android-java-version.test.d.ts +0 -12
- package/dist/src/commands/android-java-version.test.d.ts.map +0 -1
- package/dist/src/commands/android-java-version.test.js +0 -209
- package/dist/src/commands/android-scanner-java.test.d.ts +0 -2
- package/dist/src/commands/android-scanner-java.test.d.ts.map +0 -1
- package/dist/src/commands/android-scanner-java.test.js +0 -130
- package/dist/src/commands/android-scanner.d.ts +0 -250
- package/dist/src/commands/android-scanner.d.ts.map +0 -1
- package/dist/src/commands/android-scanner.js +0 -1639
- package/dist/src/commands/build.d.ts +0 -215
- package/dist/src/commands/build.d.ts.map +0 -1
- package/dist/src/commands/build.js +0 -1433
- package/dist/src/commands/build.test.d.ts +0 -13
- package/dist/src/commands/build.test.d.ts.map +0 -1
- package/dist/src/commands/build.test.js +0 -121
- package/dist/src/commands/detect-platform.d.ts +0 -13
- package/dist/src/commands/detect-platform.d.ts.map +0 -1
- package/dist/src/commands/detect-platform.js +0 -51
- package/dist/src/commands/detect-project.d.ts +0 -7
- package/dist/src/commands/detect-project.d.ts.map +0 -1
- package/dist/src/commands/detect-project.js +0 -12
- package/dist/src/commands/each-flavor-is-asked-for-its-own-properties-file.test.d.ts +0 -26
- package/dist/src/commands/each-flavor-is-asked-for-its-own-properties-file.test.d.ts.map +0 -1
- package/dist/src/commands/each-flavor-is-asked-for-its-own-properties-file.test.js +0 -196
- package/dist/src/commands/edit.d.ts +0 -12
- package/dist/src/commands/edit.d.ts.map +0 -1
- package/dist/src/commands/edit.js +0 -652
- package/dist/src/commands/edit.test.d.ts +0 -6
- package/dist/src/commands/edit.test.d.ts.map +0 -1
- package/dist/src/commands/edit.test.js +0 -45
- package/dist/src/commands/fidelity-trim.d.ts +0 -13
- package/dist/src/commands/fidelity-trim.d.ts.map +0 -1
- package/dist/src/commands/fidelity-trim.js +0 -21
- package/dist/src/commands/fidelity-trim.test.d.ts +0 -8
- package/dist/src/commands/fidelity-trim.test.d.ts.map +0 -1
- package/dist/src/commands/fidelity-trim.test.js +0 -79
- package/dist/src/commands/file-secret-collector.d.ts +0 -50
- package/dist/src/commands/file-secret-collector.d.ts.map +0 -1
- package/dist/src/commands/file-secret-collector.js +0 -217
- package/dist/src/commands/flavors-a-convention-plugin-creates-are-still-found.test.d.ts +0 -38
- package/dist/src/commands/flavors-a-convention-plugin-creates-are-still-found.test.d.ts.map +0 -1
- package/dist/src/commands/flavors-a-convention-plugin-creates-are-still-found.test.js +0 -300
- package/dist/src/commands/github-workflow.d.ts +0 -5
- package/dist/src/commands/github-workflow.d.ts.map +0 -1
- package/dist/src/commands/github-workflow.js +0 -45
- package/dist/src/commands/index.d.ts +0 -33
- package/dist/src/commands/index.d.ts.map +0 -1
- package/dist/src/commands/index.js +0 -33
- package/dist/src/commands/init.d.ts +0 -20
- package/dist/src/commands/init.d.ts.map +0 -1
- package/dist/src/commands/init.js +0 -264
- package/dist/src/commands/ios-scanner.d.ts +0 -104
- package/dist/src/commands/ios-scanner.d.ts.map +0 -1
- package/dist/src/commands/ios-scanner.js +0 -492
- package/dist/src/commands/ios-scheme-ranking.test.d.ts +0 -2
- package/dist/src/commands/ios-scheme-ranking.test.d.ts.map +0 -1
- package/dist/src/commands/ios-scheme-ranking.test.js +0 -264
- package/dist/src/commands/local-properties-reaches-every-workflow.test.d.ts +0 -30
- package/dist/src/commands/local-properties-reaches-every-workflow.test.d.ts.map +0 -1
- package/dist/src/commands/local-properties-reaches-every-workflow.test.js +0 -146
- package/dist/src/commands/reset.d.ts +0 -7
- package/dist/src/commands/reset.d.ts.map +0 -1
- package/dist/src/commands/reset.js +0 -81
- package/dist/src/commands/run.d.ts +0 -22
- package/dist/src/commands/run.d.ts.map +0 -1
- package/dist/src/commands/run.js +0 -141
- package/dist/src/commands/secrets-sync-workflow.d.ts +0 -15
- package/dist/src/commands/secrets-sync-workflow.d.ts.map +0 -1
- package/dist/src/commands/secrets-sync-workflow.js +0 -255
- package/dist/src/commands/secrets-upload.d.ts +0 -21
- package/dist/src/commands/secrets-upload.d.ts.map +0 -1
- package/dist/src/commands/secrets-upload.js +0 -177
- package/dist/src/commands/secrets-upload.test.d.ts +0 -5
- package/dist/src/commands/secrets-upload.test.d.ts.map +0 -1
- package/dist/src/commands/secrets-upload.test.js +0 -60
- package/dist/src/commands/validate.d.ts +0 -10
- package/dist/src/commands/validate.d.ts.map +0 -1
- package/dist/src/commands/validate.js +0 -46
- package/dist/src/config.d.ts +0 -3
- package/dist/src/config.d.ts.map +0 -1
- package/dist/src/config.js +0 -47
- package/dist/src/envman/cli.d.ts +0 -21
- package/dist/src/envman/cli.d.ts.map +0 -1
- package/dist/src/envman/cli.js +0 -240
- package/dist/src/envman/envman.d.ts +0 -83
- package/dist/src/envman/envman.d.ts.map +0 -1
- package/dist/src/envman/envman.js +0 -361
- package/dist/src/envman/envman.test.d.ts +0 -5
- package/dist/src/envman/envman.test.d.ts.map +0 -1
- package/dist/src/envman/envman.test.js +0 -236
- package/dist/src/envman/envstore-round-trip.test.d.ts +0 -27
- package/dist/src/envman/envstore-round-trip.test.d.ts.map +0 -1
- package/dist/src/envman/envstore-round-trip.test.js +0 -130
- package/dist/src/envman/index.d.ts +0 -23
- package/dist/src/envman/index.d.ts.map +0 -1
- package/dist/src/envman/index.js +0 -23
- package/dist/src/envman/shim.d.ts +0 -16
- package/dist/src/envman/shim.d.ts.map +0 -1
- package/dist/src/envman/shim.js +0 -66
- package/dist/src/envman/types.d.ts +0 -55
- package/dist/src/envman/types.d.ts.map +0 -1
- package/dist/src/envman/types.js +0 -12
- package/dist/src/lib.d.ts +0 -33
- package/dist/src/lib.d.ts.map +0 -1
- package/dist/src/lib.js +0 -37
- package/dist/src/pipeline.d.ts +0 -3
- package/dist/src/pipeline.d.ts.map +0 -1
- package/dist/src/pipeline.js +0 -57
- package/dist/src/runner-node-step.test.d.ts +0 -12
- package/dist/src/runner-node-step.test.d.ts.map +0 -1
- package/dist/src/runner-node-step.test.js +0 -61
- package/dist/src/runner.d.ts +0 -31
- package/dist/src/runner.d.ts.map +0 -1
- package/dist/src/runner.js +0 -240
- package/dist/src/shared/detect-project.d.ts +0 -57
- package/dist/src/shared/detect-project.d.ts.map +0 -1
- package/dist/src/shared/detect-project.js +0 -219
- package/dist/src/shared/detect-project.test.d.ts +0 -2
- package/dist/src/shared/detect-project.test.d.ts.map +0 -1
- package/dist/src/shared/detect-project.test.js +0 -161
- package/dist/src/shared/git.d.ts +0 -25
- package/dist/src/shared/git.d.ts.map +0 -1
- package/dist/src/shared/git.js +0 -53
- package/dist/src/shared/git.test.d.ts +0 -9
- package/dist/src/shared/git.test.d.ts.map +0 -1
- package/dist/src/shared/git.test.js +0 -66
- package/dist/src/shared/gitignore.d.ts +0 -6
- package/dist/src/shared/gitignore.d.ts.map +0 -1
- package/dist/src/shared/gitignore.js +0 -26
- package/dist/src/shared/gradle-settings.d.ts +0 -49
- package/dist/src/shared/gradle-settings.d.ts.map +0 -1
- package/dist/src/shared/gradle-settings.js +0 -138
- package/dist/src/shared/gradle-settings.test.d.ts +0 -2
- package/dist/src/shared/gradle-settings.test.d.ts.map +0 -1
- package/dist/src/shared/gradle-settings.test.js +0 -65
- package/dist/src/shared/prompts.d.ts +0 -30
- package/dist/src/shared/prompts.d.ts.map +0 -1
- package/dist/src/shared/prompts.js +0 -121
- package/dist/src/shared/xcode-container.test.d.ts +0 -2
- package/dist/src/shared/xcode-container.test.d.ts.map +0 -1
- package/dist/src/shared/xcode-container.test.js +0 -123
- package/dist/src/step-marker.d.ts +0 -12
- package/dist/src/step-marker.d.ts.map +0 -1
- package/dist/src/step-marker.js +0 -29
- package/dist/src/step-marker.test.d.ts +0 -11
- package/dist/src/step-marker.test.d.ts.map +0 -1
- package/dist/src/step-marker.test.js +0 -45
- package/dist/src/types.d.ts +0 -58
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js +0 -2
- package/dist/src/yaml/a-cache-path-must-not-swallow-a-credential.test.d.ts +0 -28
- package/dist/src/yaml/a-cache-path-must-not-swallow-a-credential.test.d.ts.map +0 -1
- package/dist/src/yaml/a-cache-path-must-not-swallow-a-credential.test.js +0 -223
- package/dist/src/yaml/a-declared-secret-reaches-the-file-step.test.d.ts +0 -20
- package/dist/src/yaml/a-declared-secret-reaches-the-file-step.test.d.ts.map +0 -1
- package/dist/src/yaml/a-declared-secret-reaches-the-file-step.test.js +0 -201
- package/dist/src/yaml/a-declared-slot-may-name-the-workflow-it-belongs-to.test.d.ts +0 -37
- package/dist/src/yaml/a-declared-slot-may-name-the-workflow-it-belongs-to.test.d.ts.map +0 -1
- package/dist/src/yaml/a-declared-slot-may-name-the-workflow-it-belongs-to.test.js +0 -255
- package/dist/src/yaml/a-missing-credential-is-loud.test.d.ts +0 -32
- package/dist/src/yaml/a-missing-credential-is-loud.test.d.ts.map +0 -1
- package/dist/src/yaml/a-missing-credential-is-loud.test.js +0 -301
- package/dist/src/yaml/a-runtime-requirement-names-a-real-provider.test.d.ts +0 -18
- package/dist/src/yaml/a-runtime-requirement-names-a-real-provider.test.d.ts.map +0 -1
- package/dist/src/yaml/a-runtime-requirement-names-a-real-provider.test.js +0 -66
- package/dist/src/yaml/a-scoped-slot-must-name-a-workflow-the-pipeline-has.test.d.ts +0 -34
- package/dist/src/yaml/a-scoped-slot-must-name-a-workflow-the-pipeline-has.test.d.ts.map +0 -1
- package/dist/src/yaml/a-scoped-slot-must-name-a-workflow-the-pipeline-has.test.js +0 -218
- package/dist/src/yaml/a-value-this-instance-stored-is-a-value-it-has.test.d.ts +0 -27
- package/dist/src/yaml/a-value-this-instance-stored-is-a-value-it-has.test.d.ts.map +0 -1
- package/dist/src/yaml/a-value-this-instance-stored-is-a-value-it-has.test.js +0 -126
- package/dist/src/yaml/bitrise-compat.d.ts +0 -65
- package/dist/src/yaml/bitrise-compat.d.ts.map +0 -1
- package/dist/src/yaml/bitrise-compat.js +0 -206
- package/dist/src/yaml/bitrise-compat.test.d.ts +0 -5
- package/dist/src/yaml/bitrise-compat.test.d.ts.map +0 -1
- package/dist/src/yaml/bitrise-compat.test.js +0 -347
- package/dist/src/yaml/cache-key-missing-file.test.d.ts +0 -12
- package/dist/src/yaml/cache-key-missing-file.test.d.ts.map +0 -1
- package/dist/src/yaml/cache-key-missing-file.test.js +0 -116
- package/dist/src/yaml/converter.d.ts +0 -103
- package/dist/src/yaml/converter.d.ts.map +0 -1
- package/dist/src/yaml/converter.js +0 -420
- package/dist/src/yaml/converter.test.d.ts +0 -5
- package/dist/src/yaml/converter.test.d.ts.map +0 -1
- package/dist/src/yaml/converter.test.js +0 -548
- package/dist/src/yaml/e2e.test.d.ts +0 -6
- package/dist/src/yaml/e2e.test.d.ts.map +0 -1
- package/dist/src/yaml/e2e.test.js +0 -446
- package/dist/src/yaml/env-resolver.d.ts +0 -218
- package/dist/src/yaml/env-resolver.d.ts.map +0 -1
- package/dist/src/yaml/env-resolver.js +0 -591
- package/dist/src/yaml/env-resolver.test.d.ts +0 -5
- package/dist/src/yaml/env-resolver.test.d.ts.map +0 -1
- package/dist/src/yaml/env-resolver.test.js +0 -502
- package/dist/src/yaml/every-build-log-witnesses-the-commit-on-disk.test.d.ts +0 -16
- package/dist/src/yaml/every-build-log-witnesses-the-commit-on-disk.test.d.ts.map +0 -1
- package/dist/src/yaml/every-build-log-witnesses-the-commit-on-disk.test.js +0 -126
- package/dist/src/yaml/fidelity-input-digest.d.ts +0 -37
- package/dist/src/yaml/fidelity-input-digest.d.ts.map +0 -1
- package/dist/src/yaml/fidelity-input-digest.js +0 -208
- package/dist/src/yaml/fidelity-input-digest.test.d.ts +0 -2
- package/dist/src/yaml/fidelity-input-digest.test.d.ts.map +0 -1
- package/dist/src/yaml/fidelity-input-digest.test.js +0 -167
- package/dist/src/yaml/fidelity-manifest.d.ts +0 -126
- package/dist/src/yaml/fidelity-manifest.d.ts.map +0 -1
- package/dist/src/yaml/fidelity-manifest.js +0 -134
- package/dist/src/yaml/fidelity-manifest.test.d.ts +0 -12
- package/dist/src/yaml/fidelity-manifest.test.d.ts.map +0 -1
- package/dist/src/yaml/fidelity-manifest.test.js +0 -251
- package/dist/src/yaml/interactive-prompts.d.ts +0 -71
- package/dist/src/yaml/interactive-prompts.d.ts.map +0 -1
- package/dist/src/yaml/interactive-prompts.js +0 -260
- package/dist/src/yaml/meta-helpers.d.ts +0 -28
- package/dist/src/yaml/meta-helpers.d.ts.map +0 -1
- package/dist/src/yaml/meta-helpers.js +0 -46
- package/dist/src/yaml/missing-env-handler.d.ts +0 -45
- package/dist/src/yaml/missing-env-handler.d.ts.map +0 -1
- package/dist/src/yaml/missing-env-handler.js +0 -64
- package/dist/src/yaml/parser.d.ts +0 -33
- package/dist/src/yaml/parser.d.ts.map +0 -1
- package/dist/src/yaml/parser.js +0 -148
- package/dist/src/yaml/parser.test.d.ts +0 -5
- package/dist/src/yaml/parser.test.d.ts.map +0 -1
- package/dist/src/yaml/parser.test.js +0 -83
- package/dist/src/yaml/pipeline-with-secrets.d.ts +0 -25
- package/dist/src/yaml/pipeline-with-secrets.d.ts.map +0 -1
- package/dist/src/yaml/pipeline-with-secrets.js +0 -76
- package/dist/src/yaml/platform-detector.d.ts +0 -83
- package/dist/src/yaml/platform-detector.d.ts.map +0 -1
- package/dist/src/yaml/platform-detector.js +0 -189
- package/dist/src/yaml/platform-detector.test.d.ts +0 -5
- package/dist/src/yaml/platform-detector.test.d.ts.map +0 -1
- package/dist/src/yaml/platform-detector.test.js +0 -525
- package/dist/src/yaml/preflight-validation.d.ts +0 -29
- package/dist/src/yaml/preflight-validation.d.ts.map +0 -1
- package/dist/src/yaml/preflight-validation.js +0 -21
- package/dist/src/yaml/secrets-manager.d.ts +0 -87
- package/dist/src/yaml/secrets-manager.d.ts.map +0 -1
- package/dist/src/yaml/secrets-manager.js +0 -230
- package/dist/src/yaml/shell-assignments.d.ts +0 -40
- package/dist/src/yaml/shell-assignments.d.ts.map +0 -1
- package/dist/src/yaml/shell-assignments.js +0 -77
- package/dist/src/yaml/step-validator-check-failure.test.d.ts +0 -24
- package/dist/src/yaml/step-validator-check-failure.test.d.ts.map +0 -1
- package/dist/src/yaml/step-validator-check-failure.test.js +0 -130
- package/dist/src/yaml/step-validator-self-assigned.test.d.ts +0 -23
- package/dist/src/yaml/step-validator-self-assigned.test.d.ts.map +0 -1
- package/dist/src/yaml/step-validator-self-assigned.test.js +0 -191
- package/dist/src/yaml/step-validator.d.ts +0 -67
- package/dist/src/yaml/step-validator.d.ts.map +0 -1
- package/dist/src/yaml/step-validator.js +0 -466
- package/dist/src/yaml/step-validator.test.d.ts +0 -18
- package/dist/src/yaml/step-validator.test.d.ts.map +0 -1
- package/dist/src/yaml/step-validator.test.js +0 -140
- package/dist/src/yaml/steps/android-sign.d.ts +0 -35
- package/dist/src/yaml/steps/android-sign.d.ts.map +0 -1
- package/dist/src/yaml/steps/android-sign.js +0 -147
- package/dist/src/yaml/steps/android-variant-resolution.test.d.ts +0 -2
- package/dist/src/yaml/steps/android-variant-resolution.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/android-variant-resolution.test.js +0 -260
- package/dist/src/yaml/steps/android-version.d.ts +0 -26
- package/dist/src/yaml/steps/android-version.d.ts.map +0 -1
- package/dist/src/yaml/steps/android-version.js +0 -128
- package/dist/src/yaml/steps/android-version.test.d.ts +0 -5
- package/dist/src/yaml/steps/android-version.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/android-version.test.js +0 -196
- package/dist/src/yaml/steps/android.d.ts +0 -156
- package/dist/src/yaml/steps/android.d.ts.map +0 -1
- package/dist/src/yaml/steps/android.js +0 -1084
- package/dist/src/yaml/steps/app-store-deploy.d.ts +0 -48
- package/dist/src/yaml/steps/app-store-deploy.d.ts.map +0 -1
- package/dist/src/yaml/steps/app-store-deploy.js +0 -167
- package/dist/src/yaml/steps/base.d.ts +0 -263
- package/dist/src/yaml/steps/base.d.ts.map +0 -1
- package/dist/src/yaml/steps/base.js +0 -380
- package/dist/src/yaml/steps/bitrise-android-tools.d.ts +0 -26
- package/dist/src/yaml/steps/bitrise-android-tools.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-android-tools.js +0 -200
- package/dist/src/yaml/steps/bitrise-android-tools.test.d.ts +0 -5
- package/dist/src/yaml/steps/bitrise-android-tools.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-android-tools.test.js +0 -280
- package/dist/src/yaml/steps/bitrise-apk-info.d.ts +0 -22
- package/dist/src/yaml/steps/bitrise-apk-info.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-apk-info.js +0 -144
- package/dist/src/yaml/steps/bitrise-apk-info.test.d.ts +0 -5
- package/dist/src/yaml/steps/bitrise-apk-info.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-apk-info.test.js +0 -331
- package/dist/src/yaml/steps/bitrise-slack.d.ts +0 -49
- package/dist/src/yaml/steps/bitrise-slack.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-slack.js +0 -280
- package/dist/src/yaml/steps/bitrise-slack.test.d.ts +0 -5
- package/dist/src/yaml/steps/bitrise-slack.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-slack.test.js +0 -484
- package/dist/src/yaml/steps/bitrise-ssh.d.ts +0 -27
- package/dist/src/yaml/steps/bitrise-ssh.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-ssh.js +0 -134
- package/dist/src/yaml/steps/bitrise-ssh.test.d.ts +0 -5
- package/dist/src/yaml/steps/bitrise-ssh.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-ssh.test.js +0 -205
- package/dist/src/yaml/steps/cache-pull-daemon.test.d.ts +0 -27
- package/dist/src/yaml/steps/cache-pull-daemon.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cache-pull-daemon.test.js +0 -212
- package/dist/src/yaml/steps/cache-pull-restore-roots.test.d.ts +0 -42
- package/dist/src/yaml/steps/cache-pull-restore-roots.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cache-pull-restore-roots.test.js +0 -209
- package/dist/src/yaml/steps/cache-push-daemon.test.d.ts +0 -27
- package/dist/src/yaml/steps/cache-push-daemon.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cache-push-daemon.test.js +0 -171
- package/dist/src/yaml/steps/cache.d.ts +0 -59
- package/dist/src/yaml/steps/cache.d.ts.map +0 -1
- package/dist/src/yaml/steps/cache.js +0 -1027
- package/dist/src/yaml/steps/cocoapods-deployment-floor.d.ts +0 -42
- package/dist/src/yaml/steps/cocoapods-deployment-floor.d.ts.map +0 -1
- package/dist/src/yaml/steps/cocoapods-deployment-floor.js +0 -140
- package/dist/src/yaml/steps/cocoapods-deployment-floor.test.d.ts +0 -11
- package/dist/src/yaml/steps/cocoapods-deployment-floor.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cocoapods-deployment-floor.test.js +0 -176
- package/dist/src/yaml/steps/cocoapods-install-emits-valid-bash.test.d.ts +0 -22
- package/dist/src/yaml/steps/cocoapods-install-emits-valid-bash.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cocoapods-install-emits-valid-bash.test.js +0 -97
- package/dist/src/yaml/steps/cocoapods-locked-bundler.test.d.ts +0 -17
- package/dist/src/yaml/steps/cocoapods-locked-bundler.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cocoapods-locked-bundler.test.js +0 -282
- package/dist/src/yaml/steps/cocoapods-skip-if-absent.test.d.ts +0 -17
- package/dist/src/yaml/steps/cocoapods-skip-if-absent.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cocoapods-skip-if-absent.test.js +0 -132
- package/dist/src/yaml/steps/envstore-loader.test.d.ts +0 -15
- package/dist/src/yaml/steps/envstore-loader.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/envstore-loader.test.js +0 -143
- package/dist/src/yaml/steps/fastlane.d.ts +0 -27
- package/dist/src/yaml/steps/fastlane.d.ts.map +0 -1
- package/dist/src/yaml/steps/fastlane.js +0 -79
- package/dist/src/yaml/steps/fidelity-aspect-guard.d.ts +0 -53
- package/dist/src/yaml/steps/fidelity-aspect-guard.d.ts.map +0 -1
- package/dist/src/yaml/steps/fidelity-aspect-guard.js +0 -72
- package/dist/src/yaml/steps/fidelity-aspect-guard.test.d.ts +0 -11
- package/dist/src/yaml/steps/fidelity-aspect-guard.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/fidelity-aspect-guard.test.js +0 -50
- package/dist/src/yaml/steps/fidelity-reference-provenance.d.ts +0 -87
- package/dist/src/yaml/steps/fidelity-reference-provenance.d.ts.map +0 -1
- package/dist/src/yaml/steps/fidelity-reference-provenance.js +0 -111
- package/dist/src/yaml/steps/fidelity-reference-provenance.test.d.ts +0 -22
- package/dist/src/yaml/steps/fidelity-reference-provenance.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/fidelity-reference-provenance.test.js +0 -118
- package/dist/src/yaml/steps/file.d.ts +0 -52
- package/dist/src/yaml/steps/file.d.ts.map +0 -1
- package/dist/src/yaml/steps/file.js +0 -108
- package/dist/src/yaml/steps/flutter.d.ts +0 -63
- package/dist/src/yaml/steps/flutter.d.ts.map +0 -1
- package/dist/src/yaml/steps/flutter.js +0 -215
- package/dist/src/yaml/steps/git-clone-names-the-inputs-it-ignores.test.d.ts +0 -16
- package/dist/src/yaml/steps/git-clone-names-the-inputs-it-ignores.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/git-clone-names-the-inputs-it-ignores.test.js +0 -127
- package/dist/src/yaml/steps/git-clone.d.ts +0 -32
- package/dist/src/yaml/steps/git-clone.d.ts.map +0 -1
- package/dist/src/yaml/steps/git-clone.js +0 -171
- package/dist/src/yaml/steps/git-fetch-retry-exec.test.d.ts +0 -10
- package/dist/src/yaml/steps/git-fetch-retry-exec.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/git-fetch-retry-exec.test.js +0 -162
- package/dist/src/yaml/steps/git-fetch-retry.d.ts +0 -62
- package/dist/src/yaml/steps/git-fetch-retry.d.ts.map +0 -1
- package/dist/src/yaml/steps/git-fetch-retry.js +0 -155
- package/dist/src/yaml/steps/git-fetch-retry.test.d.ts +0 -5
- package/dist/src/yaml/steps/git-fetch-retry.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/git-fetch-retry.test.js +0 -86
- package/dist/src/yaml/steps/google-play-deploy.d.ts +0 -37
- package/dist/src/yaml/steps/google-play-deploy.d.ts.map +0 -1
- package/dist/src/yaml/steps/google-play-deploy.js +0 -193
- package/dist/src/yaml/steps/google-play-deploy.test.d.ts +0 -5
- package/dist/src/yaml/steps/google-play-deploy.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/google-play-deploy.test.js +0 -310
- package/dist/src/yaml/steps/gradle-memory.d.ts +0 -61
- package/dist/src/yaml/steps/gradle-memory.d.ts.map +0 -1
- package/dist/src/yaml/steps/gradle-memory.js +0 -311
- package/dist/src/yaml/steps/gradle-memory.test.d.ts +0 -2
- package/dist/src/yaml/steps/gradle-memory.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/gradle-memory.test.js +0 -297
- package/dist/src/yaml/steps/gradle-sdk-cmake.d.ts +0 -28
- package/dist/src/yaml/steps/gradle-sdk-cmake.d.ts.map +0 -1
- package/dist/src/yaml/steps/gradle-sdk-cmake.js +0 -107
- package/dist/src/yaml/steps/gradle-sdk-cmake.test.d.ts +0 -2
- package/dist/src/yaml/steps/gradle-sdk-cmake.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/gradle-sdk-cmake.test.js +0 -183
- package/dist/src/yaml/steps/index.d.ts +0 -10
- package/dist/src/yaml/steps/index.d.ts.map +0 -1
- package/dist/src/yaml/steps/index.js +0 -1461
- package/dist/src/yaml/steps/ios-deps.d.ts +0 -78
- package/dist/src/yaml/steps/ios-deps.d.ts.map +0 -1
- package/dist/src/yaml/steps/ios-deps.js +0 -279
- package/dist/src/yaml/steps/ios-deps.test.d.ts +0 -5
- package/dist/src/yaml/steps/ios-deps.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/ios-deps.test.js +0 -90
- package/dist/src/yaml/steps/ios-signing.d.ts +0 -31
- package/dist/src/yaml/steps/ios-signing.d.ts.map +0 -1
- package/dist/src/yaml/steps/ios-signing.js +0 -144
- package/dist/src/yaml/steps/ios-version.d.ts +0 -47
- package/dist/src/yaml/steps/ios-version.d.ts.map +0 -1
- package/dist/src/yaml/steps/ios-version.js +0 -151
- package/dist/src/yaml/steps/java-home-version-spec.test.d.ts +0 -10
- package/dist/src/yaml/steps/java-home-version-spec.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/java-home-version-spec.test.js +0 -58
- package/dist/src/yaml/steps/linting.d.ts +0 -47
- package/dist/src/yaml/steps/linting.d.ts.map +0 -1
- package/dist/src/yaml/steps/linting.js +0 -148
- package/dist/src/yaml/steps/phase2.test.d.ts +0 -6
- package/dist/src/yaml/steps/phase2.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/phase2.test.js +0 -197
- package/dist/src/yaml/steps/phase3.test.d.ts +0 -5
- package/dist/src/yaml/steps/phase3.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/phase3.test.js +0 -144
- package/dist/src/yaml/steps/phase4.test.d.ts +0 -5
- package/dist/src/yaml/steps/phase4.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/phase4.test.js +0 -166
- package/dist/src/yaml/steps/phase5.test.d.ts +0 -6
- package/dist/src/yaml/steps/phase5.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/phase5.test.js +0 -263
- package/dist/src/yaml/steps/registry.d.ts +0 -88
- package/dist/src/yaml/steps/registry.d.ts.map +0 -1
- package/dist/src/yaml/steps/registry.js +0 -125
- package/dist/src/yaml/steps/registry.test.d.ts +0 -5
- package/dist/src/yaml/steps/registry.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/registry.test.js +0 -235
- package/dist/src/yaml/steps/release.d.ts +0 -50
- package/dist/src/yaml/steps/release.d.ts.map +0 -1
- package/dist/src/yaml/steps/release.js +0 -154
- package/dist/src/yaml/steps/render-post-processor.d.ts +0 -100
- package/dist/src/yaml/steps/render-post-processor.d.ts.map +0 -1
- package/dist/src/yaml/steps/render-post-processor.js +0 -270
- package/dist/src/yaml/steps/render-post-processor.test.d.ts +0 -13
- package/dist/src/yaml/steps/render-post-processor.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/render-post-processor.test.js +0 -220
- package/dist/src/yaml/steps/script.d.ts +0 -23
- package/dist/src/yaml/steps/script.d.ts.map +0 -1
- package/dist/src/yaml/steps/script.js +0 -63
- package/dist/src/yaml/steps/spec-validation.test.d.ts +0 -6
- package/dist/src/yaml/steps/spec-validation.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/spec-validation.test.js +0 -130
- package/dist/src/yaml/steps/steps.test.d.ts +0 -6
- package/dist/src/yaml/steps/steps.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/steps.test.js +0 -881
- package/dist/src/yaml/steps/structural-facts.d.ts +0 -992
- package/dist/src/yaml/steps/structural-facts.d.ts.map +0 -1
- package/dist/src/yaml/steps/structural-facts.js +0 -3276
- package/dist/src/yaml/steps/structural-facts.test.d.ts +0 -12
- package/dist/src/yaml/steps/structural-facts.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/structural-facts.test.js +0 -3039
- package/dist/src/yaml/steps/test-config.d.ts +0 -5
- package/dist/src/yaml/steps/test-config.d.ts.map +0 -1
- package/dist/src/yaml/steps/test-config.js +0 -25
- package/dist/src/yaml/steps/trim-align-corpus.test.d.ts +0 -28
- package/dist/src/yaml/steps/trim-align-corpus.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/trim-align-corpus.test.js +0 -383
- package/dist/src/yaml/steps/trim-align.d.ts +0 -87
- package/dist/src/yaml/steps/trim-align.d.ts.map +0 -1
- package/dist/src/yaml/steps/trim-align.js +0 -367
- package/dist/src/yaml/steps/trim-align.test.d.ts +0 -11
- package/dist/src/yaml/steps/trim-align.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/trim-align.test.js +0 -261
- package/dist/src/yaml/steps/ui-fidelity-preview-android.d.ts +0 -66
- package/dist/src/yaml/steps/ui-fidelity-preview-android.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-preview-android.js +0 -251
- package/dist/src/yaml/steps/ui-fidelity-preview-android.test.d.ts +0 -13
- package/dist/src/yaml/steps/ui-fidelity-preview-android.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-preview-android.test.js +0 -302
- package/dist/src/yaml/steps/ui-fidelity-preview.d.ts +0 -134
- package/dist/src/yaml/steps/ui-fidelity-preview.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-preview.js +0 -173
- package/dist/src/yaml/steps/ui-fidelity-preview.test.d.ts +0 -11
- package/dist/src/yaml/steps/ui-fidelity-preview.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-preview.test.js +0 -210
- package/dist/src/yaml/steps/ui-fidelity-render-android.d.ts +0 -155
- package/dist/src/yaml/steps/ui-fidelity-render-android.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-render-android.js +0 -1389
- package/dist/src/yaml/steps/ui-fidelity-render-android.test.d.ts +0 -2
- package/dist/src/yaml/steps/ui-fidelity-render-android.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-render-android.test.js +0 -1106
- package/dist/src/yaml/steps/ui-fidelity-render.d.ts +0 -230
- package/dist/src/yaml/steps/ui-fidelity-render.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-render.js +0 -1597
- package/dist/src/yaml/steps/ui-fidelity-render.test.d.ts +0 -18
- package/dist/src/yaml/steps/ui-fidelity-render.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-render.test.js +0 -1871
- package/dist/src/yaml/steps/xcode-app-product.d.ts +0 -90
- package/dist/src/yaml/steps/xcode-app-product.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-app-product.js +0 -247
- package/dist/src/yaml/steps/xcode-app-product.test.d.ts +0 -2
- package/dist/src/yaml/steps/xcode-app-product.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-app-product.test.js +0 -202
- package/dist/src/yaml/steps/xcode-derived-data.test.d.ts +0 -30
- package/dist/src/yaml/steps/xcode-derived-data.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-derived-data.test.js +0 -253
- package/dist/src/yaml/steps/xcode-destination.d.ts +0 -47
- package/dist/src/yaml/steps/xcode-destination.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-destination.js +0 -202
- package/dist/src/yaml/steps/xcode-destination.test.d.ts +0 -9
- package/dist/src/yaml/steps/xcode-destination.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-destination.test.js +0 -227
- package/dist/src/yaml/steps/xcode-new.test.d.ts +0 -5
- package/dist/src/yaml/steps/xcode-new.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-new.test.js +0 -211
- package/dist/src/yaml/steps/xcode-resolve-retry.test.d.ts +0 -9
- package/dist/src/yaml/steps/xcode-resolve-retry.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-resolve-retry.test.js +0 -146
- package/dist/src/yaml/steps/xcode-simulator-archs.d.ts +0 -53
- package/dist/src/yaml/steps/xcode-simulator-archs.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-simulator-archs.js +0 -98
- package/dist/src/yaml/steps/xcode-simulator-archs.test.d.ts +0 -21
- package/dist/src/yaml/steps/xcode-simulator-archs.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-simulator-archs.test.js +0 -155
- package/dist/src/yaml/steps/xcode.d.ts +0 -230
- package/dist/src/yaml/steps/xcode.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode.js +0 -1340
- package/dist/src/yaml/types.d.ts +0 -76
- package/dist/src/yaml/types.d.ts.map +0 -1
- package/dist/src/yaml/types.js +0 -5
- package/dist/src/yaml/validation-types.d.ts +0 -102
- package/dist/src/yaml/validation-types.d.ts.map +0 -1
- package/dist/src/yaml/validation-types.js +0 -8
- package/dist/src/yaml/yaml-updater.d.ts +0 -24
- package/dist/src/yaml/yaml-updater.d.ts.map +0 -1
- package/dist/src/yaml/yaml-updater.js +0 -128
|
@@ -1,502 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unit tests for environment variable resolution
|
|
3
|
-
*/
|
|
4
|
-
import { describe, test, expect, beforeEach, afterEach } from '@jest/globals';
|
|
5
|
-
import { EnvResolver, MissingEnvironmentVariableError, createEnvResolver } from './env-resolver.js';
|
|
6
|
-
import * as fs from 'fs';
|
|
7
|
-
describe('EnvResolver', () => {
|
|
8
|
-
let originalEnv;
|
|
9
|
-
beforeEach(() => {
|
|
10
|
-
// Save original environment
|
|
11
|
-
originalEnv = { ...process.env };
|
|
12
|
-
});
|
|
13
|
-
afterEach(() => {
|
|
14
|
-
// Restore original environment
|
|
15
|
-
process.env = originalEnv;
|
|
16
|
-
});
|
|
17
|
-
describe('Built-in environment variables', () => {
|
|
18
|
-
test('should add common built-in variables', () => {
|
|
19
|
-
const pipeline = {
|
|
20
|
-
format_version: '4',
|
|
21
|
-
workflows: { primary: { steps: [] } },
|
|
22
|
-
};
|
|
23
|
-
const workflow = pipeline.workflows.primary;
|
|
24
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
25
|
-
expect(resolver.get('CIBUILD_SOURCE_DIR')).toBe(process.cwd());
|
|
26
|
-
expect(resolver.get('CIBUILD_BUILD_NUMBER')).toBe('1');
|
|
27
|
-
expect(resolver.get('CIBUILD_GIT_BRANCH')).toBeDefined();
|
|
28
|
-
expect(resolver.get('CIBUILD_GIT_COMMIT')).toBeDefined();
|
|
29
|
-
expect(resolver.get('CIBUILD_TRIGGERED_WORKFLOW_ID')).toBe('primary');
|
|
30
|
-
});
|
|
31
|
-
test('should add macOS platform-specific variables', () => {
|
|
32
|
-
const pipeline = {
|
|
33
|
-
format_version: '4',
|
|
34
|
-
workflows: { primary: { steps: [] } },
|
|
35
|
-
};
|
|
36
|
-
const workflow = pipeline.workflows.primary;
|
|
37
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'macos', 'macos-ventura-xcode-15.1');
|
|
38
|
-
expect(resolver.get('CIBUILD_STACK')).toBe('macos-ventura-xcode-15.1');
|
|
39
|
-
expect(resolver.get('CIBUILD_XCODE_VERSION')).toBe('15.1');
|
|
40
|
-
expect(resolver.get('CIBUILD_SCHEME')).toBeDefined();
|
|
41
|
-
});
|
|
42
|
-
test('should add Linux platform-specific variables', () => {
|
|
43
|
-
const pipeline = {
|
|
44
|
-
format_version: '4',
|
|
45
|
-
workflows: { primary: { steps: [] } },
|
|
46
|
-
};
|
|
47
|
-
const workflow = pipeline.workflows.primary;
|
|
48
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux', 'linux-docker-android-22.04');
|
|
49
|
-
expect(resolver.get('CIBUILD_STACK')).toBe('linux-docker-android-22.04');
|
|
50
|
-
expect(resolver.get('CIBUILD_GRADLE_VERSION')).toBeDefined();
|
|
51
|
-
expect(resolver.get('JAVA_HOME')).toBeDefined();
|
|
52
|
-
});
|
|
53
|
-
test('should extract Xcode version from stack', () => {
|
|
54
|
-
const pipeline = {
|
|
55
|
-
format_version: '4',
|
|
56
|
-
workflows: { primary: { steps: [] } },
|
|
57
|
-
};
|
|
58
|
-
const workflow = pipeline.workflows.primary;
|
|
59
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'macos', 'macos-sonoma-xcode-15.0');
|
|
60
|
-
expect(resolver.get('CIBUILD_XCODE_VERSION')).toBe('15.0');
|
|
61
|
-
});
|
|
62
|
-
test('should use process.env values when available', () => {
|
|
63
|
-
process.env.BUILD_NUMBER = '42';
|
|
64
|
-
process.env.GIT_BRANCH = 'feature/test';
|
|
65
|
-
process.env.GIT_COMMIT = 'abc123';
|
|
66
|
-
const pipeline = {
|
|
67
|
-
format_version: '4',
|
|
68
|
-
workflows: { primary: { steps: [] } },
|
|
69
|
-
};
|
|
70
|
-
const workflow = pipeline.workflows.primary;
|
|
71
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
72
|
-
expect(resolver.get('CIBUILD_BUILD_NUMBER')).toBe('42');
|
|
73
|
-
expect(resolver.get('CIBUILD_GIT_BRANCH')).toBe('feature/test');
|
|
74
|
-
expect(resolver.get('CIBUILD_GIT_COMMIT')).toBe('abc123');
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
describe('Environment variable merging', () => {
|
|
78
|
-
test('should merge global environment variables', () => {
|
|
79
|
-
const pipeline = {
|
|
80
|
-
format_version: '4',
|
|
81
|
-
app: {
|
|
82
|
-
envs: [
|
|
83
|
-
{ GLOBAL_VAR1: 'value1' },
|
|
84
|
-
{ GLOBAL_VAR2: 'value2' },
|
|
85
|
-
],
|
|
86
|
-
},
|
|
87
|
-
workflows: { primary: { steps: [] } },
|
|
88
|
-
};
|
|
89
|
-
const workflow = pipeline.workflows.primary;
|
|
90
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
91
|
-
expect(resolver.get('GLOBAL_VAR1')).toBe('value1');
|
|
92
|
-
expect(resolver.get('GLOBAL_VAR2')).toBe('value2');
|
|
93
|
-
});
|
|
94
|
-
test('should merge workflow-level environment variables', () => {
|
|
95
|
-
const pipeline = {
|
|
96
|
-
format_version: '4',
|
|
97
|
-
workflows: {
|
|
98
|
-
primary: {
|
|
99
|
-
envs: [
|
|
100
|
-
{ WORKFLOW_VAR1: 'wf_value1' },
|
|
101
|
-
{ WORKFLOW_VAR2: 'wf_value2' },
|
|
102
|
-
],
|
|
103
|
-
steps: [],
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
};
|
|
107
|
-
const workflow = pipeline.workflows.primary;
|
|
108
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
109
|
-
expect(resolver.get('WORKFLOW_VAR1')).toBe('wf_value1');
|
|
110
|
-
expect(resolver.get('WORKFLOW_VAR2')).toBe('wf_value2');
|
|
111
|
-
});
|
|
112
|
-
test('should override global variables with workflow variables', () => {
|
|
113
|
-
const pipeline = {
|
|
114
|
-
format_version: '4',
|
|
115
|
-
app: {
|
|
116
|
-
envs: [{ BUILD_TYPE: 'debug' }],
|
|
117
|
-
},
|
|
118
|
-
workflows: {
|
|
119
|
-
primary: {
|
|
120
|
-
envs: [{ BUILD_TYPE: 'release' }],
|
|
121
|
-
steps: [],
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
};
|
|
125
|
-
const workflow = pipeline.workflows.primary;
|
|
126
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
127
|
-
expect(resolver.get('BUILD_TYPE')).toBe('release');
|
|
128
|
-
});
|
|
129
|
-
test('should handle empty env arrays', () => {
|
|
130
|
-
const pipeline = {
|
|
131
|
-
format_version: '4',
|
|
132
|
-
app: { envs: [] },
|
|
133
|
-
workflows: {
|
|
134
|
-
primary: {
|
|
135
|
-
envs: [],
|
|
136
|
-
steps: [],
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
};
|
|
140
|
-
const workflow = pipeline.workflows.primary;
|
|
141
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
142
|
-
// Should still have built-in variables
|
|
143
|
-
expect(resolver.get('CIBUILD_SOURCE_DIR')).toBeDefined();
|
|
144
|
-
});
|
|
145
|
-
});
|
|
146
|
-
describe('Variable interpolation', () => {
|
|
147
|
-
test('should interpolate $VAR format', () => {
|
|
148
|
-
const pipeline = {
|
|
149
|
-
format_version: '4',
|
|
150
|
-
app: {
|
|
151
|
-
envs: [{ MY_VAR: 'hello' }],
|
|
152
|
-
},
|
|
153
|
-
workflows: { primary: { steps: [] } },
|
|
154
|
-
};
|
|
155
|
-
const workflow = pipeline.workflows.primary;
|
|
156
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
157
|
-
const result = resolver.interpolate('Value is $MY_VAR world');
|
|
158
|
-
expect(result).toBe('Value is hello world');
|
|
159
|
-
});
|
|
160
|
-
test('should interpolate ${VAR} format', () => {
|
|
161
|
-
const pipeline = {
|
|
162
|
-
format_version: '4',
|
|
163
|
-
app: {
|
|
164
|
-
envs: [{ MY_VAR: 'hello' }],
|
|
165
|
-
},
|
|
166
|
-
workflows: { primary: { steps: [] } },
|
|
167
|
-
};
|
|
168
|
-
const workflow = pipeline.workflows.primary;
|
|
169
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
170
|
-
const result = resolver.interpolate('Value is ${MY_VAR} world');
|
|
171
|
-
expect(result).toBe('Value is hello world');
|
|
172
|
-
});
|
|
173
|
-
test('should interpolate {{getenv "VAR"}} format', () => {
|
|
174
|
-
const pipeline = {
|
|
175
|
-
format_version: '4',
|
|
176
|
-
app: {
|
|
177
|
-
envs: [{ MY_VAR: 'hello' }],
|
|
178
|
-
},
|
|
179
|
-
workflows: { primary: { steps: [] } },
|
|
180
|
-
};
|
|
181
|
-
const workflow = pipeline.workflows.primary;
|
|
182
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
183
|
-
const result = resolver.interpolate('Value is {{getenv "MY_VAR"}} world');
|
|
184
|
-
expect(result).toBe('Value is hello world');
|
|
185
|
-
});
|
|
186
|
-
test('should interpolate {{checksum "file"}} format', () => {
|
|
187
|
-
// Create a test file
|
|
188
|
-
const testFile = 'test-checksum-file.txt';
|
|
189
|
-
fs.writeFileSync(testFile, 'test content');
|
|
190
|
-
try {
|
|
191
|
-
const pipeline = {
|
|
192
|
-
format_version: '4',
|
|
193
|
-
workflows: { primary: { steps: [] } },
|
|
194
|
-
};
|
|
195
|
-
const workflow = pipeline.workflows.primary;
|
|
196
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
197
|
-
const result = resolver.interpolate(`checksum-{{checksum "${testFile}"}}`);
|
|
198
|
-
// MD5 hash of "test content" is 9473fdd0d880a43c21b7778d34872157
|
|
199
|
-
expect(result).toBe('checksum-9473fdd0d880a43c21b7778d34872157');
|
|
200
|
-
}
|
|
201
|
-
finally {
|
|
202
|
-
// Cleanup
|
|
203
|
-
if (fs.existsSync(testFile)) {
|
|
204
|
-
fs.unlinkSync(testFile);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
test('should throw error for non-existent file in checksum', () => {
|
|
209
|
-
const pipeline = {
|
|
210
|
-
format_version: '4',
|
|
211
|
-
workflows: { primary: { steps: [] } },
|
|
212
|
-
};
|
|
213
|
-
const workflow = pipeline.workflows.primary;
|
|
214
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
215
|
-
expect(() => {
|
|
216
|
-
resolver.interpolate('{{checksum "non-existent-file.txt"}}');
|
|
217
|
-
}).toThrow('File not found: non-existent-file.txt');
|
|
218
|
-
});
|
|
219
|
-
test('should interpolate multiple variables in one string', () => {
|
|
220
|
-
const pipeline = {
|
|
221
|
-
format_version: '4',
|
|
222
|
-
app: {
|
|
223
|
-
envs: [
|
|
224
|
-
{ VAR1: 'hello' },
|
|
225
|
-
{ VAR2: 'world' },
|
|
226
|
-
],
|
|
227
|
-
},
|
|
228
|
-
workflows: { primary: { steps: [] } },
|
|
229
|
-
};
|
|
230
|
-
const workflow = pipeline.workflows.primary;
|
|
231
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
232
|
-
const result = resolver.interpolate('$VAR1 ${VAR2} {{getenv "VAR1"}}');
|
|
233
|
-
expect(result).toBe('hello world hello');
|
|
234
|
-
});
|
|
235
|
-
test('should interpolate variables in nested objects', () => {
|
|
236
|
-
const pipeline = {
|
|
237
|
-
format_version: '4',
|
|
238
|
-
app: {
|
|
239
|
-
envs: [{ PROJECT_PATH: './MyApp' }],
|
|
240
|
-
},
|
|
241
|
-
workflows: { primary: { steps: [] } },
|
|
242
|
-
};
|
|
243
|
-
const workflow = pipeline.workflows.primary;
|
|
244
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
245
|
-
const obj = {
|
|
246
|
-
path: '$PROJECT_PATH',
|
|
247
|
-
nested: {
|
|
248
|
-
value: '${PROJECT_PATH}/sub',
|
|
249
|
-
},
|
|
250
|
-
};
|
|
251
|
-
const result = resolver.interpolateObject(obj);
|
|
252
|
-
expect(result.path).toBe('./MyApp');
|
|
253
|
-
expect(result.nested.value).toBe('./MyApp/sub');
|
|
254
|
-
});
|
|
255
|
-
test('should interpolate variables in arrays', () => {
|
|
256
|
-
const pipeline = {
|
|
257
|
-
format_version: '4',
|
|
258
|
-
app: {
|
|
259
|
-
envs: [{ DIR: '/path' }],
|
|
260
|
-
},
|
|
261
|
-
workflows: { primary: { steps: [] } },
|
|
262
|
-
};
|
|
263
|
-
const workflow = pipeline.workflows.primary;
|
|
264
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
265
|
-
const arr = ['$DIR/file1', '${DIR}/file2'];
|
|
266
|
-
const result = resolver.interpolateObject(arr);
|
|
267
|
-
expect(result[0]).toBe('/path/file1');
|
|
268
|
-
expect(result[1]).toBe('/path/file2');
|
|
269
|
-
});
|
|
270
|
-
test('should support env vars referencing other env vars', () => {
|
|
271
|
-
const pipeline = {
|
|
272
|
-
format_version: '4',
|
|
273
|
-
app: {
|
|
274
|
-
envs: [
|
|
275
|
-
{ BASE_DIR: '/home/user' },
|
|
276
|
-
{ PROJECT_DIR: '$BASE_DIR/project' },
|
|
277
|
-
],
|
|
278
|
-
},
|
|
279
|
-
workflows: { primary: { steps: [] } },
|
|
280
|
-
};
|
|
281
|
-
const workflow = pipeline.workflows.primary;
|
|
282
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
283
|
-
expect(resolver.get('PROJECT_DIR')).toContain('/home/user/project');
|
|
284
|
-
});
|
|
285
|
-
});
|
|
286
|
-
describe('Missing variable detection', () => {
|
|
287
|
-
test('should throw error for missing variable in interpolation', () => {
|
|
288
|
-
const pipeline = {
|
|
289
|
-
format_version: '4',
|
|
290
|
-
workflows: { primary: { steps: [] } },
|
|
291
|
-
};
|
|
292
|
-
const workflow = pipeline.workflows.primary;
|
|
293
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
294
|
-
expect(() => resolver.interpolate('Value is $MISSING_VAR')).toThrow(MissingEnvironmentVariableError);
|
|
295
|
-
});
|
|
296
|
-
test('should include variable name in error message', () => {
|
|
297
|
-
const pipeline = {
|
|
298
|
-
format_version: '4',
|
|
299
|
-
workflows: { primary: { steps: [] } },
|
|
300
|
-
};
|
|
301
|
-
const workflow = pipeline.workflows.primary;
|
|
302
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
303
|
-
expect(() => resolver.interpolate('${MISSING_VAR}')).toThrow(/MISSING_VAR/);
|
|
304
|
-
});
|
|
305
|
-
test('should include step name in error message when provided', () => {
|
|
306
|
-
const pipeline = {
|
|
307
|
-
format_version: '4',
|
|
308
|
-
workflows: { primary: { steps: [] } },
|
|
309
|
-
};
|
|
310
|
-
const workflow = pipeline.workflows.primary;
|
|
311
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
312
|
-
expect(() => resolver.interpolate('${MISSING_VAR}', 'my-step')).toThrow(/my-step/);
|
|
313
|
-
});
|
|
314
|
-
test('should detect missing variables in nested objects', () => {
|
|
315
|
-
const pipeline = {
|
|
316
|
-
format_version: '4',
|
|
317
|
-
workflows: { primary: { steps: [] } },
|
|
318
|
-
};
|
|
319
|
-
const workflow = pipeline.workflows.primary;
|
|
320
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
321
|
-
const obj = {
|
|
322
|
-
nested: {
|
|
323
|
-
value: '$MISSING_VAR',
|
|
324
|
-
},
|
|
325
|
-
};
|
|
326
|
-
expect(() => resolver.interpolateObject(obj)).toThrow(MissingEnvironmentVariableError);
|
|
327
|
-
});
|
|
328
|
-
});
|
|
329
|
-
describe('Helper methods', () => {
|
|
330
|
-
test('has() should check variable existence', () => {
|
|
331
|
-
const pipeline = {
|
|
332
|
-
format_version: '4',
|
|
333
|
-
app: {
|
|
334
|
-
envs: [{ MY_VAR: 'value' }],
|
|
335
|
-
},
|
|
336
|
-
workflows: { primary: { steps: [] } },
|
|
337
|
-
};
|
|
338
|
-
const workflow = pipeline.workflows.primary;
|
|
339
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
340
|
-
expect(resolver.has('MY_VAR')).toBe(true);
|
|
341
|
-
expect(resolver.has('NONEXISTENT_VAR')).toBe(false);
|
|
342
|
-
});
|
|
343
|
-
test('getAll() should return all variables', () => {
|
|
344
|
-
const pipeline = {
|
|
345
|
-
format_version: '4',
|
|
346
|
-
app: {
|
|
347
|
-
envs: [{ VAR1: 'value1' }, { VAR2: 'value2' }],
|
|
348
|
-
},
|
|
349
|
-
workflows: { primary: { steps: [] } },
|
|
350
|
-
};
|
|
351
|
-
const workflow = pipeline.workflows.primary;
|
|
352
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
353
|
-
const allVars = resolver.getAll();
|
|
354
|
-
expect(allVars.VAR1).toBe('value1');
|
|
355
|
-
expect(allVars.VAR2).toBe('value2');
|
|
356
|
-
expect(allVars.CIBUILD_SOURCE_DIR).toBeDefined();
|
|
357
|
-
});
|
|
358
|
-
});
|
|
359
|
-
describe('createEnvResolver helper', () => {
|
|
360
|
-
test('should create resolver for valid workflow', () => {
|
|
361
|
-
const pipeline = {
|
|
362
|
-
format_version: '4',
|
|
363
|
-
workflows: { primary: { steps: [] } },
|
|
364
|
-
};
|
|
365
|
-
const resolver = createEnvResolver(pipeline, 'primary', 'linux');
|
|
366
|
-
expect(resolver).toBeInstanceOf(EnvResolver);
|
|
367
|
-
});
|
|
368
|
-
test('should throw error for non-existent workflow', () => {
|
|
369
|
-
const pipeline = {
|
|
370
|
-
format_version: '4',
|
|
371
|
-
workflows: { primary: { steps: [] } },
|
|
372
|
-
};
|
|
373
|
-
expect(() => createEnvResolver(pipeline, 'nonexistent', 'linux')).toThrow(/not found/);
|
|
374
|
-
});
|
|
375
|
-
test('should pass stack to resolver', () => {
|
|
376
|
-
const pipeline = {
|
|
377
|
-
format_version: '4',
|
|
378
|
-
workflows: { primary: { steps: [] } },
|
|
379
|
-
};
|
|
380
|
-
const resolver = createEnvResolver(pipeline, 'primary', 'macos', 'macos-ventura-xcode-15.1');
|
|
381
|
-
expect(resolver.get('CIBUILD_STACK')).toBe('macos-ventura-xcode-15.1');
|
|
382
|
-
});
|
|
383
|
-
});
|
|
384
|
-
describe('Bitrise variable mapping (FR-9.2)', () => {
|
|
385
|
-
test('should add CIBUILD_BUILD_NUMBER built-in variable', () => {
|
|
386
|
-
const pipeline = {
|
|
387
|
-
format_version: '4',
|
|
388
|
-
workflows: { primary: { steps: [] } },
|
|
389
|
-
};
|
|
390
|
-
const workflow = pipeline.workflows.primary;
|
|
391
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
392
|
-
expect(resolver.get('CIBUILD_BUILD_NUMBER')).toBe('1');
|
|
393
|
-
});
|
|
394
|
-
test('should add CIBUILD_BUILD_URL built-in variable', () => {
|
|
395
|
-
const pipeline = {
|
|
396
|
-
format_version: '4',
|
|
397
|
-
workflows: { primary: { steps: [] } },
|
|
398
|
-
};
|
|
399
|
-
const workflow = pipeline.workflows.primary;
|
|
400
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
401
|
-
expect(resolver.get('CIBUILD_BUILD_URL')).toBe('https://cibuild.io/builds/1');
|
|
402
|
-
});
|
|
403
|
-
test('should add CIBUILD_APP_TITLE built-in variable', () => {
|
|
404
|
-
const pipeline = {
|
|
405
|
-
format_version: '4',
|
|
406
|
-
workflows: { primary: { steps: [] } },
|
|
407
|
-
};
|
|
408
|
-
const workflow = pipeline.workflows.primary;
|
|
409
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
410
|
-
expect(resolver.get('CIBUILD_APP_TITLE')).toBe('CI Build Build');
|
|
411
|
-
});
|
|
412
|
-
test('should use process.env.BUILD_NUMBER for CIBUILD_BUILD_NUMBER', () => {
|
|
413
|
-
process.env.BUILD_NUMBER = '123';
|
|
414
|
-
const pipeline = {
|
|
415
|
-
format_version: '4',
|
|
416
|
-
workflows: { primary: { steps: [] } },
|
|
417
|
-
};
|
|
418
|
-
const workflow = pipeline.workflows.primary;
|
|
419
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
420
|
-
expect(resolver.get('CIBUILD_BUILD_NUMBER')).toBe('123');
|
|
421
|
-
});
|
|
422
|
-
test('should use process.env.BUILD_URL for CIBUILD_BUILD_URL', () => {
|
|
423
|
-
process.env.BUILD_URL = 'https://my-ci.com/build/456';
|
|
424
|
-
const pipeline = {
|
|
425
|
-
format_version: '4',
|
|
426
|
-
workflows: { primary: { steps: [] } },
|
|
427
|
-
};
|
|
428
|
-
const workflow = pipeline.workflows.primary;
|
|
429
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
430
|
-
expect(resolver.get('CIBUILD_BUILD_URL')).toBe('https://my-ci.com/build/456');
|
|
431
|
-
});
|
|
432
|
-
test('should use process.env.APP_TITLE for CIBUILD_APP_TITLE', () => {
|
|
433
|
-
process.env.APP_TITLE = 'My Awesome App';
|
|
434
|
-
const pipeline = {
|
|
435
|
-
format_version: '4',
|
|
436
|
-
workflows: { primary: { steps: [] } },
|
|
437
|
-
};
|
|
438
|
-
const workflow = pipeline.workflows.primary;
|
|
439
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
440
|
-
expect(resolver.get('CIBUILD_APP_TITLE')).toBe('My Awesome App');
|
|
441
|
-
});
|
|
442
|
-
test('should interpolate CIBUILD_BUILD_NUMBER in strings', () => {
|
|
443
|
-
process.env.BUILD_NUMBER = '999';
|
|
444
|
-
const pipeline = {
|
|
445
|
-
format_version: '4',
|
|
446
|
-
workflows: { primary: { steps: [] } },
|
|
447
|
-
};
|
|
448
|
-
const workflow = pipeline.workflows.primary;
|
|
449
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
450
|
-
const result = resolver.interpolate('Build number: $CIBUILD_BUILD_NUMBER');
|
|
451
|
-
expect(result).toBe('Build number: 999');
|
|
452
|
-
});
|
|
453
|
-
test('should support CIBUILD_GIT_REPOSITORY_URL built-in variable', () => {
|
|
454
|
-
process.env.GIT_REPOSITORY_URL = 'https://github.com/user/repo.git';
|
|
455
|
-
const pipeline = {
|
|
456
|
-
format_version: '4',
|
|
457
|
-
workflows: { primary: { steps: [] } },
|
|
458
|
-
};
|
|
459
|
-
const workflow = pipeline.workflows.primary;
|
|
460
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
461
|
-
expect(resolver.get('CIBUILD_GIT_REPOSITORY_URL')).toBe('https://github.com/user/repo.git');
|
|
462
|
-
});
|
|
463
|
-
test('should allow YAML to reference CIBUILD variables naturally', () => {
|
|
464
|
-
process.env.BUILD_NUMBER = '1001';
|
|
465
|
-
const pipeline = {
|
|
466
|
-
format_version: '4',
|
|
467
|
-
workflows: {
|
|
468
|
-
primary: {
|
|
469
|
-
envs: [
|
|
470
|
-
{ MESSAGE: 'Build $CIBUILD_BUILD_NUMBER completed at $CIBUILD_BUILD_URL' },
|
|
471
|
-
],
|
|
472
|
-
steps: [],
|
|
473
|
-
},
|
|
474
|
-
},
|
|
475
|
-
};
|
|
476
|
-
const workflow = pipeline.workflows.primary;
|
|
477
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
478
|
-
expect(resolver.get('MESSAGE')).toContain('Build 1001 completed at');
|
|
479
|
-
expect(resolver.get('MESSAGE')).toContain('https://cibuild.io/builds/1');
|
|
480
|
-
});
|
|
481
|
-
test('should handle CIBUILD variables in complex objects', () => {
|
|
482
|
-
process.env.BUILD_NUMBER = '2020';
|
|
483
|
-
process.env.APP_TITLE = 'Test App';
|
|
484
|
-
const pipeline = {
|
|
485
|
-
format_version: '4',
|
|
486
|
-
workflows: { primary: { steps: [] } },
|
|
487
|
-
};
|
|
488
|
-
const workflow = pipeline.workflows.primary;
|
|
489
|
-
const resolver = new EnvResolver(pipeline, workflow, 'primary', 'linux');
|
|
490
|
-
const obj = {
|
|
491
|
-
cibuild: {
|
|
492
|
-
build: '$CIBUILD_BUILD_NUMBER',
|
|
493
|
-
app: '$CIBUILD_APP_TITLE',
|
|
494
|
-
},
|
|
495
|
-
};
|
|
496
|
-
const result = resolver.interpolateObject(obj);
|
|
497
|
-
expect(result.cibuild.build).toBe('2020');
|
|
498
|
-
expect(result.cibuild.app).toBe('Test App');
|
|
499
|
-
});
|
|
500
|
-
});
|
|
501
|
-
});
|
|
502
|
-
//# sourceMappingURL=env-resolver.test.js.map
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Every build log says which commit was on disk.
|
|
3
|
-
*
|
|
4
|
-
* The dashboard's sha is the one that was *dispatched*. The only in-log
|
|
5
|
-
* evidence of what was actually compiled was `git-clone`'s echo of
|
|
6
|
-
* `Commit:` / `Author:` / `Message:` — and that step is optional, does not
|
|
7
|
-
* appear in a `ci init` pipeline or a protocol pipeline, and is being taken
|
|
8
|
-
* out of the curated templates. A pipeline written after that would have
|
|
9
|
-
* carried no witness at all.
|
|
10
|
-
*
|
|
11
|
-
* The run banner now carries it, from the values `EnvResolver` already read
|
|
12
|
-
* off the same checkout, so it does not depend on which steps a workflow
|
|
13
|
-
* declares.
|
|
14
|
-
*/
|
|
15
|
-
import './steps/index.js';
|
|
16
|
-
//# sourceMappingURL=every-build-log-witnesses-the-commit-on-disk.test.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"every-build-log-witnesses-the-commit-on-disk.test.d.ts","sourceRoot":"","sources":["../../../src/yaml/every-build-log-witnesses-the-commit-on-disk.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH,OAAO,kBAAkB,CAAC"}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Every build log says which commit was on disk.
|
|
3
|
-
*
|
|
4
|
-
* The dashboard's sha is the one that was *dispatched*. The only in-log
|
|
5
|
-
* evidence of what was actually compiled was `git-clone`'s echo of
|
|
6
|
-
* `Commit:` / `Author:` / `Message:` — and that step is optional, does not
|
|
7
|
-
* appear in a `ci init` pipeline or a protocol pipeline, and is being taken
|
|
8
|
-
* out of the curated templates. A pipeline written after that would have
|
|
9
|
-
* carried no witness at all.
|
|
10
|
-
*
|
|
11
|
-
* The run banner now carries it, from the values `EnvResolver` already read
|
|
12
|
-
* off the same checkout, so it does not depend on which steps a workflow
|
|
13
|
-
* declares.
|
|
14
|
-
*/
|
|
15
|
-
import { describe, test, expect } from '@jest/globals';
|
|
16
|
-
import { execFileSync } from 'node:child_process';
|
|
17
|
-
import { mkdtempSync, rmSync } from 'node:fs';
|
|
18
|
-
import { tmpdir } from 'node:os';
|
|
19
|
-
import { join } from 'node:path';
|
|
20
|
-
import './steps/index.js';
|
|
21
|
-
import { convertYAMLToPipelineDef } from './converter.js';
|
|
22
|
-
import { PipelineRunner } from '../runner.js';
|
|
23
|
-
import { loadConfig } from '../config.js';
|
|
24
|
-
const config = loadConfig();
|
|
25
|
-
/** The three marker contracts Invarn's log parser reads. */
|
|
26
|
-
const STEP_MARKER = /▸ INVARN_STEP:(\d+):(.+)/;
|
|
27
|
-
const PHASE_MARKER = /▸ INVARN_PHASE:([a-z0-9_-]+):(start|ok|fail)\b/;
|
|
28
|
-
const STEP_HEADING = /^\[step_\d+\] Running: /;
|
|
29
|
-
function pipelineWith(steps) {
|
|
30
|
-
return {
|
|
31
|
-
format_version: '1',
|
|
32
|
-
meta: { invarn: { stack: 'macos-xcode-26.4' } },
|
|
33
|
-
workflows: { primary: { steps } },
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
/** What `git` says, asked directly rather than through the resolver. */
|
|
37
|
-
function git(...args) {
|
|
38
|
-
return execFileSync('git', args, { encoding: 'utf8' }).trim();
|
|
39
|
-
}
|
|
40
|
-
/** Everything `runPipeline` printed, for a workflow with no steps. */
|
|
41
|
-
async function bannerOf(checkout) {
|
|
42
|
-
const lines = [];
|
|
43
|
-
const original = console.log;
|
|
44
|
-
const cwd = process.cwd();
|
|
45
|
-
// `runPipeline` creates `.ci/` beside the working directory for the
|
|
46
|
-
// envstore. Somewhere disposable, so a test never leaves one in the repo.
|
|
47
|
-
const scratch = mkdtempSync(join(tmpdir(), 'cibuild-banner-'));
|
|
48
|
-
console.log = (...args) => {
|
|
49
|
-
lines.push(args.map(String).join(' '));
|
|
50
|
-
};
|
|
51
|
-
try {
|
|
52
|
-
process.chdir(scratch);
|
|
53
|
-
const runner = new PipelineRunner(config);
|
|
54
|
-
await runner.runPipeline({ name: 'primary (YAML)', artifacts: [], steps: [], stepsOrder: [] }, undefined, undefined, checkout);
|
|
55
|
-
}
|
|
56
|
-
finally {
|
|
57
|
-
console.log = original;
|
|
58
|
-
process.chdir(cwd);
|
|
59
|
-
rmSync(scratch, { recursive: true, force: true });
|
|
60
|
-
}
|
|
61
|
-
return lines;
|
|
62
|
-
}
|
|
63
|
-
const witness = {
|
|
64
|
-
commit: '0123456789abcdef0123456789abcdef01234567',
|
|
65
|
-
author: 'Ada Lovelace <ada@example.com>',
|
|
66
|
-
subject: 'the subject line',
|
|
67
|
-
};
|
|
68
|
-
describe('every build log witnesses the commit on disk', () => {
|
|
69
|
-
test('the conversion carries the commit that is on disk', async () => {
|
|
70
|
-
const result = await convertYAMLToPipelineDef(pipelineWith([{ 'git-clone@1.0.0': {} }]), config, 'primary');
|
|
71
|
-
expect(result.checkout).toBeDefined();
|
|
72
|
-
expect(result.checkout.commit).toBe(git('rev-parse', 'HEAD'));
|
|
73
|
-
expect(result.checkout.subject).toBe(git('log', '-1', '--format=%s'));
|
|
74
|
-
expect(result.checkout.author).toBe(`${git('log', '-1', '--format=%an')} <${git('log', '-1', '--format=%ae')}>`);
|
|
75
|
-
});
|
|
76
|
-
test('a workflow with no git-clone step carries it just the same', async () => {
|
|
77
|
-
// The whole point: the witness must not depend on a declared step.
|
|
78
|
-
const result = await convertYAMLToPipelineDef(pipelineWith([{ 'script@1.0.0': { inputs: { content: 'true' } } }]), config, 'primary');
|
|
79
|
-
expect(result.checkout?.commit).toBe(git('rev-parse', 'HEAD'));
|
|
80
|
-
});
|
|
81
|
-
test('the banner prints hash, author and subject exactly once', async () => {
|
|
82
|
-
const lines = await bannerOf(witness);
|
|
83
|
-
expect(lines.filter((l) => l.includes(witness.commit))).toHaveLength(1);
|
|
84
|
-
expect(lines.filter((l) => l.includes(witness.author))).toHaveLength(1);
|
|
85
|
-
expect(lines.filter((l) => l.includes(witness.subject))).toHaveLength(1);
|
|
86
|
-
});
|
|
87
|
-
test('the banner is at the top, before anything a step prints', async () => {
|
|
88
|
-
const lines = await bannerOf(witness);
|
|
89
|
-
const pipelineLine = lines.findIndex((l) => l.includes('Pipeline:'));
|
|
90
|
-
const commitLine = lines.findIndex((l) => l.includes(witness.commit));
|
|
91
|
-
expect(pipelineLine).toBeGreaterThanOrEqual(0);
|
|
92
|
-
expect(commitLine).toBeGreaterThan(pipelineLine);
|
|
93
|
-
});
|
|
94
|
-
test('a run with no witness prints no empty Commit line', async () => {
|
|
95
|
-
// `EnvResolver` falls back to the literal `HEAD`, so a plain directory
|
|
96
|
-
// would otherwise produce `Commit: HEAD` — worse than saying nothing.
|
|
97
|
-
const lines = await bannerOf(undefined);
|
|
98
|
-
expect(lines.filter((l) => l.startsWith('Commit:'))).toHaveLength(0);
|
|
99
|
-
expect(lines.filter((l) => l.startsWith('Author:'))).toHaveLength(0);
|
|
100
|
-
});
|
|
101
|
-
test('an author or subject git could not read is left out', async () => {
|
|
102
|
-
const lines = await bannerOf({ commit: witness.commit, author: '', subject: '' });
|
|
103
|
-
expect(lines.filter((l) => l.startsWith('Commit:'))).toHaveLength(1);
|
|
104
|
-
expect(lines.filter((l) => l.startsWith('Author:'))).toHaveLength(0);
|
|
105
|
-
expect(lines.filter((l) => l.startsWith('Message:'))).toHaveLength(0);
|
|
106
|
-
});
|
|
107
|
-
test('no line of the banner can be read as a marker or a step heading', async () => {
|
|
108
|
-
// Invarn's step-progress parser splits a build log on these. A banner line
|
|
109
|
-
// that matched one would invent a step or move a boundary.
|
|
110
|
-
for (const line of await bannerOf(witness)) {
|
|
111
|
-
expect(line).not.toMatch(STEP_MARKER);
|
|
112
|
-
expect(line).not.toMatch(PHASE_MARKER);
|
|
113
|
-
expect(line).not.toMatch(STEP_HEADING);
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
test('the banner and git-clone read the same commit', async () => {
|
|
117
|
-
// Where both appear they must agree. The step echoes `git rev-parse HEAD`
|
|
118
|
-
// from the shell; the banner reports what the resolver read from the same
|
|
119
|
-
// checkout in the same directory.
|
|
120
|
-
const result = await convertYAMLToPipelineDef(pipelineWith([{ 'git-clone@1.0.0': {} }]), config, 'primary');
|
|
121
|
-
const step = result.pipeline.steps.find((s) => s.name === 'git-clone');
|
|
122
|
-
expect(step.script).toContain('COMMIT_HASH="$(git rev-parse HEAD)"');
|
|
123
|
-
expect(result.checkout.commit).toBe(git('rev-parse', 'HEAD'));
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
//# sourceMappingURL=every-build-log-witnesses-the-commit-on-disk.test.js.map
|