@simplysf/simply-cicd 0.23.0 → 0.24.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 +40 -39
- package/lib/commands/simply/cicd/build/check-permission-sets.d.ts +1 -1
- package/lib/commands/simply/cicd/build/check-permission-sets.js +1 -1
- package/lib/commands/simply/cicd/build/check-permission-sets.js.map +1 -1
- package/lib/commands/simply/cicd/build/cleanup-scratch-orgs.js +1 -2
- package/lib/commands/simply/cicd/build/cleanup-scratch-orgs.js.map +1 -1
- package/lib/commands/simply/cicd/build/create-fallback-tag.d.ts +1 -1
- package/lib/commands/simply/cicd/build/create-fallback-tag.js +1 -3
- package/lib/commands/simply/cicd/build/create-fallback-tag.js.map +1 -1
- package/lib/commands/simply/cicd/build/create-package-version.js +1 -3
- package/lib/commands/simply/cicd/build/create-package-version.js.map +1 -1
- package/lib/commands/simply/cicd/build/create-scratch.d.ts +1 -1
- package/lib/commands/simply/cicd/build/create-scratch.js +1 -3
- package/lib/commands/simply/cicd/build/create-scratch.js.map +1 -1
- package/lib/commands/simply/cicd/build/delete-scratch.js +1 -3
- package/lib/commands/simply/cicd/build/delete-scratch.js.map +1 -1
- package/lib/commands/simply/cicd/build/determine-package-changes.js +1 -2
- package/lib/commands/simply/cicd/build/determine-package-changes.js.map +1 -1
- package/lib/commands/simply/cicd/build/generate-flexipage-diff.d.ts +1 -1
- package/lib/commands/simply/cicd/build/generate-flexipage-diff.js +1 -1
- package/lib/commands/simply/cicd/build/generate-flexipage-diff.js.map +1 -1
- package/lib/commands/simply/cicd/build/generate-flow-diff.d.ts +1 -1
- package/lib/commands/simply/cicd/build/generate-flow-diff.js +1 -1
- package/lib/commands/simply/cicd/build/generate-flow-diff.js.map +1 -1
- package/lib/commands/simply/cicd/build/install-dependencies.js +1 -3
- package/lib/commands/simply/cicd/build/install-dependencies.js.map +1 -1
- package/lib/commands/simply/cicd/build/lwc-jest.d.ts +1 -1
- package/lib/commands/simply/cicd/build/lwc-jest.js +1 -1
- package/lib/commands/simply/cicd/build/lwc-jest.js.map +1 -1
- package/lib/commands/simply/cicd/build/publish-utam-page-objects.d.ts +1 -1
- package/lib/commands/simply/cicd/build/publish-utam-page-objects.js +1 -1
- package/lib/commands/simply/cicd/build/publish-utam-page-objects.js.map +1 -1
- package/lib/commands/simply/cicd/build/push-scratch.js +1 -3
- package/lib/commands/simply/cicd/build/push-scratch.js.map +1 -1
- package/lib/commands/simply/cicd/build/test-scratch.js +1 -3
- package/lib/commands/simply/cicd/build/test-scratch.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/happy-soup/deploy-unpackaged.js +2 -2
- package/lib/commands/simply/cicd/deploy/happy-soup/deploy-unpackaged.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/happy-soup/deployment-close-out.js +1 -1
- package/lib/commands/simply/cicd/deploy/happy-soup/deployment-close-out.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/happy-soup/install-packaged.js +1 -1
- package/lib/commands/simply/cicd/deploy/happy-soup/install-packaged.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/happy-soup/post-deploy.js +2 -2
- package/lib/commands/simply/cicd/deploy/happy-soup/post-deploy.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/happy-soup/post-destructive.js +2 -2
- package/lib/commands/simply/cicd/deploy/happy-soup/post-destructive.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/happy-soup/pre-destructive.js +2 -2
- package/lib/commands/simply/cicd/deploy/happy-soup/pre-destructive.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/happy-soup/tag-deployment.js +1 -1
- package/lib/commands/simply/cicd/deploy/happy-soup/tag-deployment.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/happy-soup/validate.js +1 -1
- package/lib/commands/simply/cicd/deploy/happy-soup/validate.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/project/deploy-unpackaged.js +2 -2
- package/lib/commands/simply/cicd/deploy/project/deploy-unpackaged.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/project/install-packaged.js +1 -1
- package/lib/commands/simply/cicd/deploy/project/install-packaged.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/project/post-deploy.js +2 -2
- package/lib/commands/simply/cicd/deploy/project/post-deploy.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/project/post-destructive.js +2 -2
- package/lib/commands/simply/cicd/deploy/project/post-destructive.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/project/pre-destructive.js +2 -2
- package/lib/commands/simply/cicd/deploy/project/pre-destructive.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/project/run-apex-tests.js +1 -1
- package/lib/commands/simply/cicd/deploy/project/run-apex-tests.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/project/validate.js +1 -1
- package/lib/commands/simply/cicd/deploy/project/validate.js.map +1 -1
- package/lib/commands/simply/cicd/deploy/validate.js +1 -1
- package/lib/commands/simply/cicd/deploy/validate.js.map +1 -1
- package/lib/commands/simply/cicd/notify/build.d.ts +2 -3
- package/lib/commands/simply/cicd/notify/build.js +1 -3
- package/lib/commands/simply/cicd/notify/build.js.map +1 -1
- package/lib/commands/simply/cicd/notify/happy-soup.d.ts +2 -3
- package/lib/commands/simply/cicd/notify/happy-soup.js +4 -6
- package/lib/commands/simply/cicd/notify/happy-soup.js.map +1 -1
- package/lib/commands/simply/cicd/notify/project.d.ts +1 -2
- package/lib/commands/simply/cicd/notify/project.js +3 -5
- package/lib/commands/simply/cicd/notify/project.js.map +1 -1
- package/lib/commands/simply/cicd/notify/teams.js +1 -2
- package/lib/commands/simply/cicd/notify/teams.js.map +1 -1
- package/lib/commands/simply/cicd/sfdx-dependabot.d.ts +1 -2
- package/lib/commands/simply/cicd/sfdx-dependabot.js +1 -4
- package/lib/commands/simply/cicd/sfdx-dependabot.js.map +1 -1
- package/lib/common/deploy/stageCommand.d.ts +0 -49
- package/lib/common/deploy/stageCommand.js +0 -54
- package/lib/common/deploy/stageCommand.js.map +1 -1
- package/messages/simply.cicd.build.create-scratch.md +1 -1
- package/oclif.manifest.json +2 -2
- package/package.json +3 -12
- package/lib/common/build/checkPermissionSets.d.ts +0 -22
- package/lib/common/build/checkPermissionSets.js +0 -102
- package/lib/common/build/checkPermissionSets.js.map +0 -1
- package/lib/common/build/cleanupScratchOrgs.d.ts +0 -6
- package/lib/common/build/cleanupScratchOrgs.js +0 -91
- package/lib/common/build/cleanupScratchOrgs.js.map +0 -1
- package/lib/common/build/createFallbackTag.d.ts +0 -24
- package/lib/common/build/createFallbackTag.js +0 -147
- package/lib/common/build/createFallbackTag.js.map +0 -1
- package/lib/common/build/createPackageVersion.d.ts +0 -42
- package/lib/common/build/createPackageVersion.js +0 -198
- package/lib/common/build/createPackageVersion.js.map +0 -1
- package/lib/common/build/createScratchOrg.d.ts +0 -14
- package/lib/common/build/createScratchOrg.js +0 -192
- package/lib/common/build/createScratchOrg.js.map +0 -1
- package/lib/common/build/deleteScratchOrg.d.ts +0 -13
- package/lib/common/build/deleteScratchOrg.js +0 -62
- package/lib/common/build/deleteScratchOrg.js.map +0 -1
- package/lib/common/build/deltaRunner.d.ts +0 -73
- package/lib/common/build/deltaRunner.js +0 -109
- package/lib/common/build/deltaRunner.js.map +0 -1
- package/lib/common/build/determinePackageChanges.d.ts +0 -11
- package/lib/common/build/determinePackageChanges.js +0 -90
- package/lib/common/build/determinePackageChanges.js.map +0 -1
- package/lib/common/build/devHubs.d.ts +0 -12
- package/lib/common/build/devHubs.js +0 -42
- package/lib/common/build/devHubs.js.map +0 -1
- package/lib/common/build/flexipageDelta.d.ts +0 -18
- package/lib/common/build/flexipageDelta.js +0 -35
- package/lib/common/build/flexipageDelta.js.map +0 -1
- package/lib/common/build/flowDelta.d.ts +0 -17
- package/lib/common/build/flowDelta.js +0 -34
- package/lib/common/build/flowDelta.js.map +0 -1
- package/lib/common/build/installDependencies.d.ts +0 -10
- package/lib/common/build/installDependencies.js +0 -39
- package/lib/common/build/installDependencies.js.map +0 -1
- package/lib/common/build/lwcJest.d.ts +0 -25
- package/lib/common/build/lwcJest.js +0 -126
- package/lib/common/build/lwcJest.js.map +0 -1
- package/lib/common/build/publishUtamPageObjects.d.ts +0 -50
- package/lib/common/build/publishUtamPageObjects.js +0 -283
- package/lib/common/build/publishUtamPageObjects.js.map +0 -1
- package/lib/common/build/pushScratch.d.ts +0 -9
- package/lib/common/build/pushScratch.js +0 -60
- package/lib/common/build/pushScratch.js.map +0 -1
- package/lib/common/build/scratchOrgAuth.d.ts +0 -18
- package/lib/common/build/scratchOrgAuth.js +0 -52
- package/lib/common/build/scratchOrgAuth.js.map +0 -1
- package/lib/common/build/scratchOrgInfo.d.ts +0 -14
- package/lib/common/build/scratchOrgInfo.js +0 -21
- package/lib/common/build/scratchOrgInfo.js.map +0 -1
- package/lib/common/build/skipGuard.d.ts +0 -8
- package/lib/common/build/skipGuard.js +0 -42
- package/lib/common/build/skipGuard.js.map +0 -1
- package/lib/common/build/testScratch.d.ts +0 -15
- package/lib/common/build/testScratch.js +0 -42
- package/lib/common/build/testScratch.js.map +0 -1
- package/lib/common/build/utamPageObjects.d.ts +0 -143
- package/lib/common/build/utamPageObjects.js +0 -245
- package/lib/common/build/utamPageObjects.js.map +0 -1
- package/lib/common/build/versionTagFormat.d.ts +0 -57
- package/lib/common/build/versionTagFormat.js +0 -194
- package/lib/common/build/versionTagFormat.js.map +0 -1
- package/lib/common/deploy/deployCommon.d.ts +0 -105
- package/lib/common/deploy/deployCommon.js +0 -358
- package/lib/common/deploy/deployCommon.js.map +0 -1
- package/lib/common/deploy/deployHappySoup.d.ts +0 -56
- package/lib/common/deploy/deployHappySoup.js +0 -160
- package/lib/common/deploy/deployHappySoup.js.map +0 -1
- package/lib/common/deploy/deployProject.d.ts +0 -27
- package/lib/common/deploy/deployProject.js +0 -114
- package/lib/common/deploy/deployProject.js.map +0 -1
- package/lib/common/deploy/runDeployStage.d.ts +0 -16
- package/lib/common/deploy/runDeployStage.js +0 -65
- package/lib/common/deploy/runDeployStage.js.map +0 -1
- package/lib/common/deploy/validate.d.ts +0 -11
- package/lib/common/deploy/validate.js +0 -54
- package/lib/common/deploy/validate.js.map +0 -1
- package/lib/common/env.d.ts +0 -9
- package/lib/common/env.js +0 -47
- package/lib/common/env.js.map +0 -1
- package/lib/common/exec/sfCli.d.ts +0 -27
- package/lib/common/exec/sfCli.js +0 -50
- package/lib/common/exec/sfCli.js.map +0 -1
- package/lib/common/flags/env.d.ts +0 -44
- package/lib/common/flags/env.js +0 -81
- package/lib/common/flags/env.js.map +0 -1
- package/lib/common/git.d.ts +0 -32
- package/lib/common/git.js +0 -106
- package/lib/common/git.js.map +0 -1
- package/lib/common/happySoup/resolveOriginProject.d.ts +0 -22
- package/lib/common/happySoup/resolveOriginProject.js +0 -61
- package/lib/common/happySoup/resolveOriginProject.js.map +0 -1
- package/lib/common/logger.d.ts +0 -10
- package/lib/common/logger.js +0 -33
- package/lib/common/logger.js.map +0 -1
- package/lib/common/notify/buildNotification.d.ts +0 -53
- package/lib/common/notify/buildNotification.js +0 -176
- package/lib/common/notify/buildNotification.js.map +0 -1
- package/lib/common/notify/getCommitStories.d.ts +0 -30
- package/lib/common/notify/getCommitStories.js +0 -70
- package/lib/common/notify/getCommitStories.js.map +0 -1
- package/lib/common/notify/getRemoteCommitStories.d.ts +0 -10
- package/lib/common/notify/getRemoteCommitStories.js +0 -45
- package/lib/common/notify/getRemoteCommitStories.js.map +0 -1
- package/lib/common/notify/happySoupNotification.d.ts +0 -26
- package/lib/common/notify/happySoupNotification.js +0 -139
- package/lib/common/notify/happySoupNotification.js.map +0 -1
- package/lib/common/notify/projectNotification.d.ts +0 -46
- package/lib/common/notify/projectNotification.js +0 -177
- package/lib/common/notify/projectNotification.js.map +0 -1
- package/lib/common/notify/renderTemplate.d.ts +0 -3
- package/lib/common/notify/renderTemplate.js +0 -24
- package/lib/common/notify/renderTemplate.js.map +0 -1
- package/lib/common/notify/sendNotification.d.ts +0 -2
- package/lib/common/notify/sendNotification.js +0 -50
- package/lib/common/notify/sendNotification.js.map +0 -1
- package/lib/common/notify/templates.d.ts +0 -13
- package/lib/common/notify/templates.js +0 -118
- package/lib/common/notify/templates.js.map +0 -1
- package/lib/common/schemas/deployConfig.d.ts +0 -25
- package/lib/common/schemas/deployConfig.js +0 -55
- package/lib/common/schemas/deployConfig.js.map +0 -1
- package/lib/common/schemas/deployProgress.d.ts +0 -33
- package/lib/common/schemas/deployProgress.js +0 -46
- package/lib/common/schemas/deployProgress.js.map +0 -1
- package/lib/common/schemas/deployRules.d.ts +0 -34
- package/lib/common/schemas/deployRules.js +0 -40
- package/lib/common/schemas/deployRules.js.map +0 -1
- package/lib/common/sfApex.d.ts +0 -22
- package/lib/common/sfApex.js +0 -169
- package/lib/common/sfApex.js.map +0 -1
- package/lib/common/sfAuth.d.ts +0 -19
- package/lib/common/sfAuth.js +0 -78
- package/lib/common/sfAuth.js.map +0 -1
- package/lib/common/sfConfig.d.ts +0 -23
- package/lib/common/sfConfig.js +0 -82
- package/lib/common/sfConfig.js.map +0 -1
- package/lib/common/sfPackages.d.ts +0 -31
- package/lib/common/sfPackages.js +0 -143
- package/lib/common/sfPackages.js.map +0 -1
- package/lib/common/sfPlugins.d.ts +0 -11
- package/lib/common/sfPlugins.js +0 -134
- package/lib/common/sfPlugins.js.map +0 -1
- package/lib/common/sfdxDependabot/dependabotRun.d.ts +0 -95
- package/lib/common/sfdxDependabot/dependabotRun.js +0 -287
- package/lib/common/sfdxDependabot/dependabotRun.js.map +0 -1
- package/lib/common/sfdxDependabot/updater.d.ts +0 -14
- package/lib/common/sfdxDependabot/updater.js +0 -94
- package/lib/common/sfdxDependabot/updater.js.map +0 -1
- package/lib/config/defaultDeploymentPlugins.d.ts +0 -2
- package/lib/config/defaultDeploymentPlugins.js +0 -18
- package/lib/config/defaultDeploymentPlugins.js.map +0 -1
- package/lib/config/trustedPlugins.d.ts +0 -2
- package/lib/config/trustedPlugins.js +0 -18
- package/lib/config/trustedPlugins.js.map +0 -1
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Coerce a string or boolean to a boolean. `'true'`/`'false'` are recognised
|
|
3
|
-
* case- and whitespace-insensitively; anything else is `false`.
|
|
4
|
-
*
|
|
5
|
-
* Environment variables are always strings, unlike the boolean flags oclif parses natively, so
|
|
6
|
-
* any flag with an env-var fallback needs this on the env side.
|
|
7
|
-
*
|
|
8
|
-
* @param value - The raw flag or environment value.
|
|
9
|
-
* @returns The coerced boolean.
|
|
10
|
-
*/
|
|
11
|
-
export declare function parseBooleanString(value: string | boolean): boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Resolve a string setting with CLI flag > environment variable > fallback precedence.
|
|
14
|
-
*
|
|
15
|
-
* Several settings accept more than one environment variable — a `SIMPLY_CICD_`-prefixed name of
|
|
16
|
-
* our own plus whatever the CI provider already exports — so the env side takes a list, tried in
|
|
17
|
-
* order.
|
|
18
|
-
*
|
|
19
|
-
* @param flagValue - The parsed CLI flag, if the caller passed one.
|
|
20
|
-
* @param envVars - Candidate environment values, most specific first.
|
|
21
|
-
* @param fallback - Used when neither the flag nor any environment variable is set.
|
|
22
|
-
* @returns The resolved value.
|
|
23
|
-
*/
|
|
24
|
-
export declare function resolveString(flagValue: string | undefined, envVars: Array<string | undefined>, fallback?: string): string;
|
|
25
|
-
/**
|
|
26
|
-
* {@link resolveString} for settings with no default, where "unset" is meaningful.
|
|
27
|
-
*
|
|
28
|
-
* @param flagValue - The parsed CLI flag, if the caller passed one.
|
|
29
|
-
* @param envVars - Candidate environment values, most specific first.
|
|
30
|
-
* @returns The resolved value, or `undefined` if nothing supplied one.
|
|
31
|
-
*/
|
|
32
|
-
export declare function resolveOptionalString(flagValue: string | undefined, envVars: Array<string | undefined>): string | undefined;
|
|
33
|
-
/**
|
|
34
|
-
* Resolve a boolean setting with CLI flag > environment variable > fallback precedence.
|
|
35
|
-
*
|
|
36
|
-
* The flag is checked for `undefined` rather than falsiness, so an explicit `--no-…` stays
|
|
37
|
-
* distinguishable from an unset flag and still beats the environment.
|
|
38
|
-
*
|
|
39
|
-
* @param flagValue - The parsed CLI flag, if the caller passed one.
|
|
40
|
-
* @param envVar - The environment value, coerced via {@link parseBooleanString}.
|
|
41
|
-
* @param fallback - Used when neither the flag nor the environment variable is set.
|
|
42
|
-
* @returns The resolved boolean.
|
|
43
|
-
*/
|
|
44
|
-
export declare function resolveBoolean(flagValue: boolean | undefined, envVar: string | undefined, fallback: boolean): boolean;
|
package/lib/common/flags/env.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2026, SimplySF.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* Coerce a string or boolean to a boolean. `'true'`/`'false'` are recognised
|
|
18
|
-
* case- and whitespace-insensitively; anything else is `false`.
|
|
19
|
-
*
|
|
20
|
-
* Environment variables are always strings, unlike the boolean flags oclif parses natively, so
|
|
21
|
-
* any flag with an env-var fallback needs this on the env side.
|
|
22
|
-
*
|
|
23
|
-
* @param value - The raw flag or environment value.
|
|
24
|
-
* @returns The coerced boolean.
|
|
25
|
-
*/
|
|
26
|
-
export function parseBooleanString(value) {
|
|
27
|
-
if (typeof value === 'boolean') {
|
|
28
|
-
return value;
|
|
29
|
-
}
|
|
30
|
-
const normalized = value.trim().toLowerCase();
|
|
31
|
-
if (normalized === 'true') {
|
|
32
|
-
return true;
|
|
33
|
-
}
|
|
34
|
-
if (normalized === 'false') {
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Resolve a string setting with CLI flag > environment variable > fallback precedence.
|
|
41
|
-
*
|
|
42
|
-
* Several settings accept more than one environment variable — a `SIMPLY_CICD_`-prefixed name of
|
|
43
|
-
* our own plus whatever the CI provider already exports — so the env side takes a list, tried in
|
|
44
|
-
* order.
|
|
45
|
-
*
|
|
46
|
-
* @param flagValue - The parsed CLI flag, if the caller passed one.
|
|
47
|
-
* @param envVars - Candidate environment values, most specific first.
|
|
48
|
-
* @param fallback - Used when neither the flag nor any environment variable is set.
|
|
49
|
-
* @returns The resolved value.
|
|
50
|
-
*/
|
|
51
|
-
export function resolveString(flagValue, envVars, fallback = '') {
|
|
52
|
-
return flagValue ?? envVars.find((value) => value !== undefined) ?? fallback;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* {@link resolveString} for settings with no default, where "unset" is meaningful.
|
|
56
|
-
*
|
|
57
|
-
* @param flagValue - The parsed CLI flag, if the caller passed one.
|
|
58
|
-
* @param envVars - Candidate environment values, most specific first.
|
|
59
|
-
* @returns The resolved value, or `undefined` if nothing supplied one.
|
|
60
|
-
*/
|
|
61
|
-
export function resolveOptionalString(flagValue, envVars) {
|
|
62
|
-
return flagValue ?? envVars.find((value) => value !== undefined);
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Resolve a boolean setting with CLI flag > environment variable > fallback precedence.
|
|
66
|
-
*
|
|
67
|
-
* The flag is checked for `undefined` rather than falsiness, so an explicit `--no-…` stays
|
|
68
|
-
* distinguishable from an unset flag and still beats the environment.
|
|
69
|
-
*
|
|
70
|
-
* @param flagValue - The parsed CLI flag, if the caller passed one.
|
|
71
|
-
* @param envVar - The environment value, coerced via {@link parseBooleanString}.
|
|
72
|
-
* @param fallback - Used when neither the flag nor the environment variable is set.
|
|
73
|
-
* @returns The resolved boolean.
|
|
74
|
-
*/
|
|
75
|
-
export function resolveBoolean(flagValue, envVar, fallback) {
|
|
76
|
-
if (flagValue !== undefined) {
|
|
77
|
-
return flagValue;
|
|
78
|
-
}
|
|
79
|
-
return envVar !== undefined ? parseBooleanString(envVar) : fallback;
|
|
80
|
-
}
|
|
81
|
-
//# sourceMappingURL=env.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../../src/common/flags/env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAuB;IACxD,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAE9C,IAAI,UAAU,KAAK,MAAM,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,UAAU,KAAK,OAAO,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAC3B,SAA6B,EAC7B,OAAkC,EAClC,QAAQ,GAAG,EAAE;IAEb,OAAO,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,IAAI,QAAQ,CAAC;AAC/E,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CACnC,SAA6B,EAC7B,OAAkC;IAElC,OAAO,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;AACnE,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,cAAc,CAAC,SAA8B,EAAE,MAA0B,EAAE,QAAiB;IAC1G,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;AACtE,CAAC"}
|
package/lib/common/git.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { VcsProvider } from '@simplysf/simply-cicd-core';
|
|
2
|
-
import { VersionTagFormat } from './build/versionTagFormat.js';
|
|
3
|
-
export type Deployment = {
|
|
4
|
-
name: string;
|
|
5
|
-
slug: string;
|
|
6
|
-
ref?: string;
|
|
7
|
-
};
|
|
8
|
-
export type CloneRepoOptions = {
|
|
9
|
-
ciJobToken: string;
|
|
10
|
-
vcsProvider: VcsProvider;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* The git tag a dependency pinned at `versionPart` was recorded under. `1.2.3-4` and `1.2.3.4` are
|
|
14
|
-
* rendered through the project's version tag format, on the assumption that dependencies share the
|
|
15
|
-
* project's tag convention (a deployment's explicit `ref` covers one that doesn't). Anything else,
|
|
16
|
-
* e.g. `1.2.3-LATEST`, keeps the original `v<pin>` reading.
|
|
17
|
-
*/
|
|
18
|
-
export declare function toDependencyRef(versionPart: string, versionTagFormat: VersionTagFormat): string;
|
|
19
|
-
/**
|
|
20
|
-
* Clones a repository based on deployment metadata and options. If a specific branch or tag
|
|
21
|
-
* (ref) is not specified, it attempts to deduce the ref from package dependencies in
|
|
22
|
-
* `sfdx-project.json` in the current working directory.
|
|
23
|
-
*/
|
|
24
|
-
export declare function cloneRepo(deployment: Deployment, options: CloneRepoOptions): Promise<string>;
|
|
25
|
-
/**
|
|
26
|
-
* Adds a temporary authenticated git remote for CI push/tag operations. Returns the remote's alias.
|
|
27
|
-
*
|
|
28
|
-
* The alias is keyed on the pipeline ID, so a retried job, or a later job in the same pipeline that
|
|
29
|
-
* lands on a runner reusing the working copy (`GIT_STRATEGY: fetch`), finds it already present. In
|
|
30
|
-
* that case the existing remote's URL is overwritten instead, which also refreshes the token.
|
|
31
|
-
*/
|
|
32
|
-
export declare function addGitRemote(ciPipelineId: string, accessToken: string, ciProjectPath: string, vcsProvider: VcsProvider): Promise<string>;
|
package/lib/common/git.js
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2026, SimplySF.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { promises as fs } from 'node:fs';
|
|
17
|
-
import path from 'node:path';
|
|
18
|
-
import { execa } from 'execa';
|
|
19
|
-
import { getDefaultPackageDirectory, readSfdxProject } from '@simplysf/simply-core';
|
|
20
|
-
import { logger } from './logger.js';
|
|
21
|
-
import { VersionTagFormat, VersionTagFormatError } from './build/versionTagFormat.js';
|
|
22
|
-
/**
|
|
23
|
-
* The git tag a dependency pinned at `versionPart` was recorded under. `1.2.3-4` and `1.2.3.4` are
|
|
24
|
-
* rendered through the project's version tag format, on the assumption that dependencies share the
|
|
25
|
-
* project's tag convention (a deployment's explicit `ref` covers one that doesn't). Anything else,
|
|
26
|
-
* e.g. `1.2.3-LATEST`, keeps the original `v<pin>` reading.
|
|
27
|
-
*/
|
|
28
|
-
export function toDependencyRef(versionPart, versionTagFormat) {
|
|
29
|
-
const match = /^(?<version>\d+\.\d+\.\d+)[-.](?<build>\d+)$/.exec(versionPart);
|
|
30
|
-
if (match?.groups) {
|
|
31
|
-
return versionTagFormat.render(`${match.groups.version}.${match.groups.build}`);
|
|
32
|
-
}
|
|
33
|
-
return `v${versionPart}`;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Clones a repository based on deployment metadata and options. If a specific branch or tag
|
|
37
|
-
* (ref) is not specified, it attempts to deduce the ref from package dependencies in
|
|
38
|
-
* `sfdx-project.json` in the current working directory.
|
|
39
|
-
*/
|
|
40
|
-
export async function cloneRepo(deployment, options) {
|
|
41
|
-
const { name, slug } = deployment;
|
|
42
|
-
let { ref } = deployment;
|
|
43
|
-
if (!ref) {
|
|
44
|
-
try {
|
|
45
|
-
const project = await readSfdxProject();
|
|
46
|
-
const defaultPackageDir = getDefaultPackageDirectory(project);
|
|
47
|
-
if (defaultPackageDir?.dependencies) {
|
|
48
|
-
const dependency = defaultPackageDir.dependencies.find((dep) => dep.package?.startsWith(`${name}@`));
|
|
49
|
-
if (dependency?.package) {
|
|
50
|
-
const versionPart = dependency.package.split('@')[1];
|
|
51
|
-
if (versionPart) {
|
|
52
|
-
ref = toDependencyRef(versionPart, VersionTagFormat.fromProject(project));
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
catch (e) {
|
|
58
|
-
// A misconfigured format is the project's error to fix, not a reason to quietly clone the
|
|
59
|
-
// dependency's default branch instead.
|
|
60
|
-
if (e instanceof VersionTagFormatError) {
|
|
61
|
-
throw e;
|
|
62
|
-
}
|
|
63
|
-
const err = e;
|
|
64
|
-
if (err.code !== 'ENOENT') {
|
|
65
|
-
logger.warn(`Could not deduce ref from sfdx-project.json for ${name}: ${err.message}`);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
const repoUrl = options.vcsProvider.buildCiCloneUrl(options.ciJobToken, slug);
|
|
70
|
-
const targetDir = path.join(process.cwd(), name);
|
|
71
|
-
await fs.rm(targetDir, { recursive: true, force: true });
|
|
72
|
-
const refMessage = ref ? `#${ref}` : ' (default branch)';
|
|
73
|
-
logger.info(`Cloning ${slug}${refMessage} into ${name}`);
|
|
74
|
-
try {
|
|
75
|
-
const cloneArgs = ['clone', '--depth', '1'];
|
|
76
|
-
if (ref) {
|
|
77
|
-
cloneArgs.push('-b', ref);
|
|
78
|
-
}
|
|
79
|
-
cloneArgs.push(repoUrl, name);
|
|
80
|
-
await execa('git', cloneArgs);
|
|
81
|
-
return targetDir;
|
|
82
|
-
}
|
|
83
|
-
catch (e) {
|
|
84
|
-
logger.error(`Failed to clone ${slug}${refMessage}.`);
|
|
85
|
-
throw e;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Adds a temporary authenticated git remote for CI push/tag operations. Returns the remote's alias.
|
|
90
|
-
*
|
|
91
|
-
* The alias is keyed on the pipeline ID, so a retried job, or a later job in the same pipeline that
|
|
92
|
-
* lands on a runner reusing the working copy (`GIT_STRATEGY: fetch`), finds it already present. In
|
|
93
|
-
* that case the existing remote's URL is overwritten instead, which also refreshes the token.
|
|
94
|
-
*/
|
|
95
|
-
export async function addGitRemote(ciPipelineId, accessToken, ciProjectPath, vcsProvider) {
|
|
96
|
-
if (!accessToken) {
|
|
97
|
-
throw new Error('accessToken is required for Git remote operations.');
|
|
98
|
-
}
|
|
99
|
-
const remoteAlias = `GITREMOTE${ciPipelineId}`;
|
|
100
|
-
const remoteUrl = vcsProvider.buildAuthenticatedRemoteUrl(accessToken, ciProjectPath);
|
|
101
|
-
const { stdout: existingRemotes } = await execa('git', ['remote']);
|
|
102
|
-
const remoteExists = existingRemotes.split(/\r?\n/).includes(remoteAlias);
|
|
103
|
-
await execa('git', ['remote', remoteExists ? 'set-url' : 'add', remoteAlias, remoteUrl]);
|
|
104
|
-
return remoteAlias;
|
|
105
|
-
}
|
|
106
|
-
//# sourceMappingURL=git.js.map
|
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AC,KAAK,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;IACzF,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type VcsProviderKind } from '@simplysf/simply-cicd-core';
|
|
2
|
-
/** Where a packaged dependency's source lives, resolved for a happy-soup story lookup. */
|
|
3
|
-
export type ResolvedOriginProject = {
|
|
4
|
-
vcsProvider: VcsProviderKind;
|
|
5
|
-
host: string;
|
|
6
|
-
projectPath: string;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Parses a CI pipeline URL — as stored in `sf package version report`'s `Description` field by
|
|
10
|
-
* `createPackageVersion` at build time — into the VCS project that built it. Recognizes GitLab
|
|
11
|
-
* pipeline URLs and GitHub Actions run URLs. Returns `undefined` if the URL doesn't match either
|
|
12
|
-
* shape (or isn't a URL at all), e.g. for a package version created outside this pipeline.
|
|
13
|
-
*/
|
|
14
|
-
export declare function parseOriginPipelineUrl(pipelineUrl: string): ResolvedOriginProject | undefined;
|
|
15
|
-
/**
|
|
16
|
-
* Resolves which VCS project a packaged dependency's source lives in, for a happy-soup story
|
|
17
|
-
* lookup. Checks `.sfdevrc.json`'s `packageOriginOverrides` first (for packages whose origin can't
|
|
18
|
-
* be parsed, e.g. externally-vendored ones), then falls back to parsing the target version's
|
|
19
|
-
* origin pipeline URL. Returns `undefined` (never throws) if neither resolves — callers must treat
|
|
20
|
-
* that package's stories as unavailable and continue, not fail the notification.
|
|
21
|
-
*/
|
|
22
|
-
export declare function resolvePackageOrigin(packageName: string, targetDescription: string | undefined): ResolvedOriginProject | undefined;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2026, SimplySF.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { GitHubProvider, GitLabProvider } from '@simplysf/simply-cicd-core';
|
|
17
|
-
import { getPackageOriginOverride } from '../sfConfig.js';
|
|
18
|
-
/** Matches a GitLab CI pipeline URL, e.g. `https://gitlab.com/group/subgroup/project/-/pipelines/12345`. */
|
|
19
|
-
const GITLAB_PIPELINE_PATH = /^\/(?<projectPath>.+)\/-\/pipelines\/\d+/;
|
|
20
|
-
/** Matches a GitHub Actions run URL, e.g. `https://github.com/owner/repo/actions/runs/12345`. */
|
|
21
|
-
const GITHUB_RUN_PATH = /^\/(?<projectPath>[^/]+\/[^/]+)\/actions\/runs\/\d+/;
|
|
22
|
-
/**
|
|
23
|
-
* Parses a CI pipeline URL — as stored in `sf package version report`'s `Description` field by
|
|
24
|
-
* `createPackageVersion` at build time — into the VCS project that built it. Recognizes GitLab
|
|
25
|
-
* pipeline URLs and GitHub Actions run URLs. Returns `undefined` if the URL doesn't match either
|
|
26
|
-
* shape (or isn't a URL at all), e.g. for a package version created outside this pipeline.
|
|
27
|
-
*/
|
|
28
|
-
export function parseOriginPipelineUrl(pipelineUrl) {
|
|
29
|
-
let url;
|
|
30
|
-
try {
|
|
31
|
-
url = new URL(pipelineUrl);
|
|
32
|
-
}
|
|
33
|
-
catch {
|
|
34
|
-
return undefined;
|
|
35
|
-
}
|
|
36
|
-
const gitlabMatch = GITLAB_PIPELINE_PATH.exec(url.pathname);
|
|
37
|
-
if (gitlabMatch?.groups?.projectPath) {
|
|
38
|
-
return { vcsProvider: 'gitlab', host: url.host, projectPath: gitlabMatch.groups.projectPath };
|
|
39
|
-
}
|
|
40
|
-
const githubMatch = GITHUB_RUN_PATH.exec(url.pathname);
|
|
41
|
-
if (githubMatch?.groups?.projectPath) {
|
|
42
|
-
return { vcsProvider: 'github', host: url.host, projectPath: githubMatch.groups.projectPath };
|
|
43
|
-
}
|
|
44
|
-
return undefined;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Resolves which VCS project a packaged dependency's source lives in, for a happy-soup story
|
|
48
|
-
* lookup. Checks `.sfdevrc.json`'s `packageOriginOverrides` first (for packages whose origin can't
|
|
49
|
-
* be parsed, e.g. externally-vendored ones), then falls back to parsing the target version's
|
|
50
|
-
* origin pipeline URL. Returns `undefined` (never throws) if neither resolves — callers must treat
|
|
51
|
-
* that package's stories as unavailable and continue, not fail the notification.
|
|
52
|
-
*/
|
|
53
|
-
export function resolvePackageOrigin(packageName, targetDescription) {
|
|
54
|
-
const override = getPackageOriginOverride(packageName);
|
|
55
|
-
if (override) {
|
|
56
|
-
const defaultHost = override.vcsProvider === 'gitlab' ? GitLabProvider.defaultHost : GitHubProvider.defaultHost;
|
|
57
|
-
return { vcsProvider: override.vcsProvider, host: override.host ?? defaultHost, projectPath: override.projectPath };
|
|
58
|
-
}
|
|
59
|
-
return targetDescription ? parseOriginPipelineUrl(targetDescription) : undefined;
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=resolveOriginProject.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveOriginProject.js","sourceRoot":"","sources":["../../../src/common/happySoup/resolveOriginProject.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAwB,MAAM,4BAA4B,CAAC;AAClG,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAS1D,4GAA4G;AAC5G,MAAM,oBAAoB,GAAG,0CAA0C,CAAC;AAExE,iGAAiG;AACjG,MAAM,eAAe,GAAG,qDAAqD,CAAC;AAE9E;;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EAAE,CAAC;IACtH,CAAC;IAED,OAAO,iBAAiB,CAAC,CAAC,CAAC,sBAAsB,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACnF,CAAC"}
|
package/lib/common/logger.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/** A logger utility for consistent logging across the simply-cicd package's shared modules. */
|
|
2
|
-
export declare const logger: {
|
|
3
|
-
debug: (message: string, ...args: unknown[]) => void;
|
|
4
|
-
info: (message: string, ...args: unknown[]) => void;
|
|
5
|
-
success: (message: string, ...args: unknown[]) => void;
|
|
6
|
-
warn: (message: string, ...args: unknown[]) => void;
|
|
7
|
-
error: (message: string, ...args: unknown[]) => void;
|
|
8
|
-
log: (message: string, ...args: unknown[]) => void;
|
|
9
|
-
raw: (...args: unknown[]) => void;
|
|
10
|
-
};
|
package/lib/common/logger.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2026, SimplySF.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
/* eslint-disable no-console -- this module is the sole intended console output surface for simply-cicd's shared modules */
|
|
17
|
-
import chalk from 'chalk';
|
|
18
|
-
import logSymbols from 'log-symbols';
|
|
19
|
-
chalk.level = 1;
|
|
20
|
-
const debugPrefix = chalk.yellow('[DEBUG]');
|
|
21
|
-
const logPrefix = chalk.yellow('[SIMPLY-CICD]');
|
|
22
|
-
const format = (message) => `${logPrefix} ${message}`;
|
|
23
|
-
/** A logger utility for consistent logging across the simply-cicd package's shared modules. */
|
|
24
|
-
export const logger = {
|
|
25
|
-
debug: (message, ...args) => console.log(`${logPrefix} ${debugPrefix} ${message}`, ...args),
|
|
26
|
-
info: (message, ...args) => console.log(logSymbols.info, format(message), ...args),
|
|
27
|
-
success: (message, ...args) => console.log(logSymbols.success, format(message), ...args),
|
|
28
|
-
warn: (message, ...args) => console.warn(logSymbols.warning, format(message), ...args),
|
|
29
|
-
error: (message, ...args) => console.error(logSymbols.error, format(message), ...args),
|
|
30
|
-
log: (message, ...args) => console.log(format(message), ...args),
|
|
31
|
-
raw: (...args) => console.log(...args),
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=logger.js.map
|
package/lib/common/logger.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/common/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,2HAA2H;AAE3H,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC;AAEhB,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;AAEhD,MAAM,MAAM,GAAG,CAAC,OAAe,EAAU,EAAE,CAAC,GAAG,SAAS,IAAI,OAAO,EAAE,CAAC;AAEtE,+FAA+F;AAC/F,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,KAAK,EAAE,CAAC,OAAe,EAAE,GAAG,IAAe,EAAQ,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,SAAS,IAAI,WAAW,IAAI,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC;IACpH,IAAI,EAAE,CAAC,OAAe,EAAE,GAAG,IAAe,EAAQ,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC;IAC3G,OAAO,EAAE,CAAC,OAAe,EAAE,GAAG,IAAe,EAAQ,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC;IACjH,IAAI,EAAE,CAAC,OAAe,EAAE,GAAG,IAAe,EAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC;IAC/G,KAAK,EAAE,CAAC,OAAe,EAAE,GAAG,IAAe,EAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC;IAC/G,GAAG,EAAE,CAAC,OAAe,EAAE,GAAG,IAAe,EAAQ,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC;IACzF,GAAG,EAAE,CAAC,GAAG,IAAe,EAAQ,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;CACxD,CAAC"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { type AlmProviderKind } from '@simplysf/simply-cicd-core';
|
|
2
|
-
import { type CommitStories } from './getCommitStories.js';
|
|
3
|
-
/** The file `build create-package-version` writes the new version's `04t` ID to. */
|
|
4
|
-
export declare const SUBSCRIBER_PACKAGE_VERSION_ID_FILE = "subscriberPackageVersionId.env";
|
|
5
|
-
export type NotifyBuildResult = {
|
|
6
|
-
sent: boolean;
|
|
7
|
-
};
|
|
8
|
-
export type NotifyBuildOptions = {
|
|
9
|
-
ciCommitRefName?: string;
|
|
10
|
-
ciJobName?: string;
|
|
11
|
-
ciJobStage?: string;
|
|
12
|
-
ciJobStatus?: string;
|
|
13
|
-
ciPipelineId?: string;
|
|
14
|
-
ciPipelineUrl?: string;
|
|
15
|
-
ciProjectTitle?: string;
|
|
16
|
-
subscriberPackageVersionId?: string;
|
|
17
|
-
almBaseUrl?: string;
|
|
18
|
-
almProjectKey?: string;
|
|
19
|
-
almProvider?: AlmProviderKind;
|
|
20
|
-
teamsWebhookUrl?: string[];
|
|
21
|
-
debug: boolean;
|
|
22
|
-
};
|
|
23
|
-
/** The new package version's git tag and the issue references since the previous one. */
|
|
24
|
-
export type PackageVersionHistory = CommitStories & {
|
|
25
|
-
versionTag: string;
|
|
26
|
-
previousVersionTag: string;
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* The `04t` ID of a package version created in this job: the explicit value if given, otherwise the
|
|
30
|
-
* one `build create-package-version` wrote to {@link SUBSCRIBER_PACKAGE_VERSION_ID_FILE}. `undefined`
|
|
31
|
-
* when the job created none.
|
|
32
|
-
*/
|
|
33
|
-
export declare function resolveSubscriberPackageVersionId(explicit?: string): Promise<string | undefined>;
|
|
34
|
-
/** Fetches the tags, and the full history when the CI clone is shallow, so tags can be described and diffed. */
|
|
35
|
-
export declare function fetchVersionHistory(): Promise<void>;
|
|
36
|
-
/**
|
|
37
|
-
* The tag at `HEAD` that `build create-package-version` annotated with `subscriberPackageVersionId`.
|
|
38
|
-
* Matching on the annotation rather than the name works for any version tag format or suffix.
|
|
39
|
-
*/
|
|
40
|
-
export declare function findPackageVersionTag(subscriberPackageVersionId: string): Promise<string | undefined>;
|
|
41
|
-
/** The nearest version tag, in the project's format, before `versionTag`. `undefined` for a package's first version. */
|
|
42
|
-
export declare function findPreviousVersionTag(versionTag: string): Promise<string | undefined>;
|
|
43
|
-
/**
|
|
44
|
-
* Resolves the new version's tag, the previous version's tag, and the issue references in between.
|
|
45
|
-
* Never throws: anything it can't resolve comes back as `N/A`, because a notification shouldn't be
|
|
46
|
-
* what fails a build.
|
|
47
|
-
*/
|
|
48
|
-
export declare function getPackageVersionHistory(subscriberPackageVersionId: string, options: Pick<NotifyBuildOptions, 'almBaseUrl' | 'almProjectKey' | 'almProvider' | 'debug'>): Promise<PackageVersionHistory>;
|
|
49
|
-
/**
|
|
50
|
-
* Posts a failure card for a failed build job, or a package version card for a successful job that
|
|
51
|
-
* created a package version. Any other job result sends nothing.
|
|
52
|
-
*/
|
|
53
|
-
export declare function sendBuildNotification(options: NotifyBuildOptions): Promise<NotifyBuildResult>;
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2026, SimplySF.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { promises as fs } from 'node:fs';
|
|
17
|
-
import { execa } from 'execa';
|
|
18
|
-
import { isSubscriberPackageVersionId, readSfdxProject } from '@simplysf/simply-core';
|
|
19
|
-
import { createAlmProvider } from '@simplysf/simply-cicd-core';
|
|
20
|
-
import { VersionTagFormat } from '../build/versionTagFormat.js';
|
|
21
|
-
import { logger } from '../logger.js';
|
|
22
|
-
import { NOT_AVAILABLE, renderIssuesFromCommitLog } from './getCommitStories.js';
|
|
23
|
-
import { renderNotifyTemplate } from './renderTemplate.js';
|
|
24
|
-
import { sendNotification } from './sendNotification.js';
|
|
25
|
-
/** The file `build create-package-version` writes the new version's `04t` ID to. */
|
|
26
|
-
export const SUBSCRIBER_PACKAGE_VERSION_ID_FILE = 'subscriberPackageVersionId.env';
|
|
27
|
-
/**
|
|
28
|
-
* The `04t` ID of a package version created in this job: the explicit value if given, otherwise the
|
|
29
|
-
* one `build create-package-version` wrote to {@link SUBSCRIBER_PACKAGE_VERSION_ID_FILE}. `undefined`
|
|
30
|
-
* when the job created none.
|
|
31
|
-
*/
|
|
32
|
-
export async function resolveSubscriberPackageVersionId(explicit) {
|
|
33
|
-
if (explicit) {
|
|
34
|
-
return explicit;
|
|
35
|
-
}
|
|
36
|
-
let content;
|
|
37
|
-
try {
|
|
38
|
-
content = await fs.readFile(SUBSCRIBER_PACKAGE_VERSION_ID_FILE, 'utf8');
|
|
39
|
-
}
|
|
40
|
-
catch {
|
|
41
|
-
return undefined;
|
|
42
|
-
}
|
|
43
|
-
const value = /^SUBSCRIBER_PACKAGE_VERSION_ID=(?<id>\S+)\s*$/m.exec(content)?.groups?.id;
|
|
44
|
-
return value && isSubscriberPackageVersionId(value) ? value : undefined;
|
|
45
|
-
}
|
|
46
|
-
/** Fetches the tags, and the full history when the CI clone is shallow, so tags can be described and diffed. */
|
|
47
|
-
export async function fetchVersionHistory() {
|
|
48
|
-
const { stdout } = await execa('git', ['rev-parse', '--is-shallow-repository']);
|
|
49
|
-
const unshallow = stdout.trim() === 'true' ? ['--unshallow'] : [];
|
|
50
|
-
await execa('git', ['fetch', ...unshallow, '--tags', '--quiet']);
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* The tag at `HEAD` that `build create-package-version` annotated with `subscriberPackageVersionId`.
|
|
54
|
-
* Matching on the annotation rather than the name works for any version tag format or suffix.
|
|
55
|
-
*/
|
|
56
|
-
export async function findPackageVersionTag(subscriberPackageVersionId) {
|
|
57
|
-
const { stdout } = await execa('git', [
|
|
58
|
-
'tag',
|
|
59
|
-
'--points-at',
|
|
60
|
-
'HEAD',
|
|
61
|
-
'--format=%(refname:short)%09%(contents:subject)',
|
|
62
|
-
]);
|
|
63
|
-
return stdout
|
|
64
|
-
.split(/\r?\n/)
|
|
65
|
-
.map((line) => line.split('\t'))
|
|
66
|
-
.find(([, subject]) => subject?.trim() === subscriberPackageVersionId)?.[0];
|
|
67
|
-
}
|
|
68
|
-
/** The nearest version tag, in the project's format, before `versionTag`. `undefined` for a package's first version. */
|
|
69
|
-
export async function findPreviousVersionTag(versionTag) {
|
|
70
|
-
const project = await readSfdxProject().catch(() => undefined);
|
|
71
|
-
const glob = VersionTagFormat.fromProject(project).matchPattern();
|
|
72
|
-
try {
|
|
73
|
-
const { stdout } = await execa('git', ['describe', '--tags', '--abbrev=0', '--match', glob, `${versionTag}^`]);
|
|
74
|
-
return stdout.trim() || undefined;
|
|
75
|
-
}
|
|
76
|
-
catch {
|
|
77
|
-
return undefined;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Resolves the new version's tag, the previous version's tag, and the issue references in between.
|
|
82
|
-
* Never throws: anything it can't resolve comes back as `N/A`, because a notification shouldn't be
|
|
83
|
-
* what fails a build.
|
|
84
|
-
*/
|
|
85
|
-
export async function getPackageVersionHistory(subscriberPackageVersionId, options) {
|
|
86
|
-
const history = { ...NOT_AVAILABLE, versionTag: 'N/A', previousVersionTag: 'N/A' };
|
|
87
|
-
try {
|
|
88
|
-
await fetchVersionHistory();
|
|
89
|
-
const versionTag = await findPackageVersionTag(subscriberPackageVersionId);
|
|
90
|
-
if (!versionTag) {
|
|
91
|
-
logger.warn(`No tag at HEAD is annotated with ${subscriberPackageVersionId}.`);
|
|
92
|
-
return history;
|
|
93
|
-
}
|
|
94
|
-
history.versionTag = versionTag;
|
|
95
|
-
const previousVersionTag = await findPreviousVersionTag(versionTag);
|
|
96
|
-
if (!previousVersionTag) {
|
|
97
|
-
logger.info(`No version tag before ${versionTag}. Skipping stories.`);
|
|
98
|
-
return history;
|
|
99
|
-
}
|
|
100
|
-
history.previousVersionTag = previousVersionTag;
|
|
101
|
-
const { stdout: commits } = await execa('git', ['log', '--pretty=oneline', `${previousVersionTag}..${versionTag}`]);
|
|
102
|
-
if (commits) {
|
|
103
|
-
Object.assign(history, renderIssuesFromCommitLog(commits, options.almProjectKey, {
|
|
104
|
-
almBaseUrl: options.almBaseUrl,
|
|
105
|
-
almProvider: createAlmProvider(options.almProvider ?? 'jira'),
|
|
106
|
-
}));
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
catch (error) {
|
|
110
|
-
logger.warn(`Could not resolve package version history: ${error.message}`);
|
|
111
|
-
if (options.debug) {
|
|
112
|
-
logger.error(String(error));
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
return history;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Posts a failure card for a failed build job, or a package version card for a successful job that
|
|
119
|
-
* created a package version. Any other job result sends nothing.
|
|
120
|
-
*/
|
|
121
|
-
export async function sendBuildNotification(options) {
|
|
122
|
-
const { ciJobStatus } = options;
|
|
123
|
-
const templateData = {
|
|
124
|
-
refName: options.ciCommitRefName,
|
|
125
|
-
pipelineUrl: options.ciPipelineUrl,
|
|
126
|
-
pipelineId: options.ciPipelineId,
|
|
127
|
-
projectTitle: options.ciProjectTitle,
|
|
128
|
-
jobName: options.ciJobName,
|
|
129
|
-
stage: options.ciJobStage,
|
|
130
|
-
stories: 'N/A',
|
|
131
|
-
storiesLinked: 'N/A',
|
|
132
|
-
};
|
|
133
|
-
let templateName;
|
|
134
|
-
if (ciJobStatus === 'failed') {
|
|
135
|
-
templateName = 'build-failure-notification';
|
|
136
|
-
}
|
|
137
|
-
else if (ciJobStatus === 'success') {
|
|
138
|
-
const subscriberPackageVersionId = await resolveSubscriberPackageVersionId(options.subscriberPackageVersionId);
|
|
139
|
-
if (!subscriberPackageVersionId) {
|
|
140
|
-
logger.info('No package version was created in this job. Skipping notification.');
|
|
141
|
-
return { sent: false };
|
|
142
|
-
}
|
|
143
|
-
templateName = 'build-package-version-notification';
|
|
144
|
-
logger.info(`Gathering stories for package version ${subscriberPackageVersionId}...`);
|
|
145
|
-
const history = await getPackageVersionHistory(subscriberPackageVersionId, options);
|
|
146
|
-
Object.assign(templateData, {
|
|
147
|
-
subscriberPackageVersionId,
|
|
148
|
-
packageVersion: history.versionTag,
|
|
149
|
-
packageVersionPrevious: history.previousVersionTag,
|
|
150
|
-
stories: history.stories,
|
|
151
|
-
storiesLinked: history.storiesWithUrl,
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
else {
|
|
155
|
-
logger.info(`No notification logic for job status: ${ciJobStatus ?? 'unknown'}`);
|
|
156
|
-
return { sent: false };
|
|
157
|
-
}
|
|
158
|
-
const payload = {
|
|
159
|
-
content: renderNotifyTemplate(templateName, templateData),
|
|
160
|
-
refName: options.ciCommitRefName,
|
|
161
|
-
pipelineId: options.ciPipelineId,
|
|
162
|
-
pipelineUrl: options.ciPipelineUrl,
|
|
163
|
-
projectTitle: options.ciProjectTitle,
|
|
164
|
-
jobName: options.ciJobName,
|
|
165
|
-
jobStage: options.ciJobStage,
|
|
166
|
-
jobStatus: ciJobStatus,
|
|
167
|
-
stories: templateData.stories,
|
|
168
|
-
storiesLinked: templateData.storiesLinked,
|
|
169
|
-
packageVersionPrevious: templateData.packageVersionPrevious,
|
|
170
|
-
packageVersion: templateData.packageVersion,
|
|
171
|
-
subscriberPackageVersionId: templateData.subscriberPackageVersionId,
|
|
172
|
-
};
|
|
173
|
-
await sendNotification(options.teamsWebhookUrl, payload);
|
|
174
|
-
return { sent: true };
|
|
175
|
-
}
|
|
176
|
-
//# sourceMappingURL=buildNotification.js.map
|