@simplysf/simply-cicd-core 0.2.2 → 0.4.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 +32 -3
- package/lib/build/checkPermissionSets.d.ts +22 -0
- package/lib/build/checkPermissionSets.js +102 -0
- package/lib/build/checkPermissionSets.js.map +1 -0
- package/lib/build/cleanupScratchOrgs.d.ts +6 -0
- package/lib/build/cleanupScratchOrgs.js +91 -0
- package/lib/build/cleanupScratchOrgs.js.map +1 -0
- package/lib/build/createFallbackTag.d.ts +24 -0
- package/lib/build/createFallbackTag.js +147 -0
- package/lib/build/createFallbackTag.js.map +1 -0
- package/lib/build/createPackageVersion.d.ts +42 -0
- package/lib/build/createPackageVersion.js +191 -0
- package/lib/build/createPackageVersion.js.map +1 -0
- package/lib/build/createScratchOrg.d.ts +14 -0
- package/lib/build/createScratchOrg.js +182 -0
- package/lib/build/createScratchOrg.js.map +1 -0
- package/lib/build/deleteScratchOrg.d.ts +13 -0
- package/lib/build/deleteScratchOrg.js +62 -0
- package/lib/build/deleteScratchOrg.js.map +1 -0
- package/lib/build/deltaRunner.d.ts +73 -0
- package/lib/build/deltaRunner.js +109 -0
- package/lib/build/deltaRunner.js.map +1 -0
- package/lib/build/determinePackageChanges.d.ts +11 -0
- package/lib/build/determinePackageChanges.js +90 -0
- package/lib/build/determinePackageChanges.js.map +1 -0
- package/lib/build/devHubs.d.ts +12 -0
- package/lib/build/devHubs.js +42 -0
- package/lib/build/devHubs.js.map +1 -0
- package/lib/build/flexipageDelta.d.ts +18 -0
- package/lib/build/flexipageDelta.js +35 -0
- package/lib/build/flexipageDelta.js.map +1 -0
- package/lib/build/flowDelta.d.ts +17 -0
- package/lib/build/flowDelta.js +34 -0
- package/lib/build/flowDelta.js.map +1 -0
- package/lib/build/installDependencies.d.ts +10 -0
- package/lib/build/installDependencies.js +39 -0
- package/lib/build/installDependencies.js.map +1 -0
- package/lib/build/lwcJest.d.ts +25 -0
- package/lib/build/lwcJest.js +126 -0
- package/lib/build/lwcJest.js.map +1 -0
- package/lib/build/publishUtamPageObjects.d.ts +50 -0
- package/lib/build/publishUtamPageObjects.js +274 -0
- package/lib/build/publishUtamPageObjects.js.map +1 -0
- package/lib/build/pushScratch.d.ts +9 -0
- package/lib/build/pushScratch.js +60 -0
- package/lib/build/pushScratch.js.map +1 -0
- package/lib/build/scratchOrgAuth.d.ts +18 -0
- package/lib/build/scratchOrgAuth.js +52 -0
- package/lib/build/scratchOrgAuth.js.map +1 -0
- package/lib/build/scratchOrgInfo.d.ts +14 -0
- package/lib/build/scratchOrgInfo.js +21 -0
- package/lib/build/scratchOrgInfo.js.map +1 -0
- package/lib/build/skipGuard.d.ts +8 -0
- package/lib/build/skipGuard.js +42 -0
- package/lib/build/skipGuard.js.map +1 -0
- package/lib/build/testScratch.d.ts +15 -0
- package/lib/build/testScratch.js +42 -0
- package/lib/build/testScratch.js.map +1 -0
- package/lib/build/utamPageObjects.d.ts +143 -0
- package/lib/build/utamPageObjects.js +258 -0
- package/lib/build/utamPageObjects.js.map +1 -0
- package/lib/build/versionTagFormat.d.ts +57 -0
- package/lib/build/versionTagFormat.js +194 -0
- package/lib/build/versionTagFormat.js.map +1 -0
- package/lib/config/defaultDeploymentPlugins.d.ts +2 -0
- package/lib/config/defaultDeploymentPlugins.js +18 -0
- package/lib/config/defaultDeploymentPlugins.js.map +1 -0
- package/lib/config/trustedPlugins.d.ts +2 -0
- package/lib/config/trustedPlugins.js +18 -0
- package/lib/config/trustedPlugins.js.map +1 -0
- package/lib/deploy/deployCommon.d.ts +105 -0
- package/lib/deploy/deployCommon.js +358 -0
- package/lib/deploy/deployCommon.js.map +1 -0
- package/lib/deploy/deployHappySoup.d.ts +56 -0
- package/lib/deploy/deployHappySoup.js +159 -0
- package/lib/deploy/deployHappySoup.js.map +1 -0
- package/lib/deploy/deployProject.d.ts +27 -0
- package/lib/deploy/deployProject.js +114 -0
- package/lib/deploy/deployProject.js.map +1 -0
- package/lib/deploy/runDeployStage.d.ts +16 -0
- package/lib/deploy/runDeployStage.js +65 -0
- package/lib/deploy/runDeployStage.js.map +1 -0
- package/lib/deploy/stageOptions.d.ts +49 -0
- package/lib/deploy/stageOptions.js +70 -0
- package/lib/deploy/stageOptions.js.map +1 -0
- package/lib/deploy/validate.d.ts +11 -0
- package/lib/deploy/validate.js +54 -0
- package/lib/deploy/validate.js.map +1 -0
- package/lib/env.d.ts +9 -0
- package/lib/env.js +47 -0
- package/lib/env.js.map +1 -0
- package/lib/exec/sfCli.d.ts +27 -0
- package/lib/exec/sfCli.js +50 -0
- package/lib/exec/sfCli.js.map +1 -0
- package/lib/flags/env.d.ts +44 -0
- package/lib/flags/env.js +81 -0
- package/lib/flags/env.js.map +1 -0
- package/lib/git.d.ts +32 -0
- package/lib/git.js +106 -0
- package/lib/git.js.map +1 -0
- package/lib/happySoup/resolveOriginProject.d.ts +22 -0
- package/lib/happySoup/resolveOriginProject.js +61 -0
- package/lib/happySoup/resolveOriginProject.js.map +1 -0
- package/lib/index.d.ts +52 -0
- package/lib/index.js +64 -2
- package/lib/index.js.map +1 -1
- package/lib/logger.d.ts +10 -0
- package/lib/logger.js +33 -0
- package/lib/logger.js.map +1 -0
- package/lib/notify/buildNotification.d.ts +53 -0
- package/lib/notify/buildNotification.js +176 -0
- package/lib/notify/buildNotification.js.map +1 -0
- package/lib/notify/getCommitStories.d.ts +30 -0
- package/lib/notify/getCommitStories.js +70 -0
- package/lib/notify/getCommitStories.js.map +1 -0
- package/lib/notify/getRemoteCommitStories.d.ts +10 -0
- package/lib/notify/getRemoteCommitStories.js +45 -0
- package/lib/notify/getRemoteCommitStories.js.map +1 -0
- package/lib/notify/happySoupNotification.d.ts +26 -0
- package/lib/notify/happySoupNotification.js +140 -0
- package/lib/notify/happySoupNotification.js.map +1 -0
- package/lib/notify/projectNotification.d.ts +46 -0
- package/lib/notify/projectNotification.js +167 -0
- package/lib/notify/projectNotification.js.map +1 -0
- package/lib/notify/renderTemplate.d.ts +3 -0
- package/lib/notify/renderTemplate.js +24 -0
- package/lib/notify/renderTemplate.js.map +1 -0
- package/lib/notify/sendNotification.d.ts +2 -0
- package/lib/notify/sendNotification.js +50 -0
- package/lib/notify/sendNotification.js.map +1 -0
- package/lib/notify/templates.d.ts +13 -0
- package/lib/notify/templates.js +118 -0
- package/lib/notify/templates.js.map +1 -0
- package/lib/schemas/deployConfig.d.ts +25 -0
- package/lib/schemas/deployConfig.js +55 -0
- package/lib/schemas/deployConfig.js.map +1 -0
- package/lib/schemas/deployProgress.d.ts +33 -0
- package/lib/schemas/deployProgress.js +46 -0
- package/lib/schemas/deployProgress.js.map +1 -0
- package/lib/schemas/deployRules.d.ts +34 -0
- package/lib/schemas/deployRules.js +40 -0
- package/lib/schemas/deployRules.js.map +1 -0
- package/lib/sfApex.d.ts +22 -0
- package/lib/sfApex.js +169 -0
- package/lib/sfApex.js.map +1 -0
- package/lib/sfAuth.d.ts +19 -0
- package/lib/sfAuth.js +78 -0
- package/lib/sfAuth.js.map +1 -0
- package/lib/sfConfig.d.ts +23 -0
- package/lib/sfConfig.js +82 -0
- package/lib/sfConfig.js.map +1 -0
- package/lib/sfOrg.d.ts +13 -0
- package/lib/sfOrg.js +39 -0
- package/lib/sfOrg.js.map +1 -0
- package/lib/sfPackages.d.ts +63 -0
- package/lib/sfPackages.js +185 -0
- package/lib/sfPackages.js.map +1 -0
- package/lib/sfPlugins.d.ts +11 -0
- package/lib/sfPlugins.js +134 -0
- package/lib/sfPlugins.js.map +1 -0
- package/lib/sfdxDependabot/dependabotRun.d.ts +95 -0
- package/lib/sfdxDependabot/dependabotRun.js +287 -0
- package/lib/sfdxDependabot/dependabotRun.js.map +1 -0
- package/lib/sfdxDependabot/updater.d.ts +14 -0
- package/lib/sfdxDependabot/updater.js +94 -0
- package/lib/sfdxDependabot/updater.js.map +1 -0
- package/package.json +16 -4
|
@@ -0,0 +1,176 @@
|
|
|
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 '../alm/index.js';
|
|
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 resolveBuiltSubscriberPackageVersionId(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 resolveBuiltSubscriberPackageVersionId(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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildNotification.js","sourceRoot":"","sources":["../../src/notify/buildNotification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,4BAA4B,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAwB,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,yBAAyB,EAAsB,MAAM,uBAAuB,CAAC;AACrG,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD,oFAAoF;AACpF,MAAM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AAO,EAAE,OAAO,CAAC,eAAe;QAChC,UAAU,EAAE,OAAO,CAAC,YAAY;QAChC,WAAW,EAAE,OAAO,CAAC,aAAa;QAClC,YAAY,EAAE,OAAO,CAAC,cAAc;QACpC,OAAO,EAAE,OAAO,CAAC,SAAS;QAC1B,QAAQ,EAAE,OAAO,CAAC,UAAU;QAC5B,SAAS,EAAE,WAAW;QACtB,OAAO,EAAE,YAAY,CAAC,OAAO;QAC7B,aAAa,EAAE,YAAY,CAAC,aAAa;QACzC,sBAAsB,EAAE,YAAY,CAAC,sBAAsB;QAC3D,cAAc,EAAE,YAAY,CAAC,cAAc;QAC3C,0BAA0B,EAAE,YAAY,CAAC,0BAA0B;KACpE,CAAC;IAEF,MAAM,gBAAgB,CAAC,OAAO,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;IACzD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type AlmProvider } from '../alm/index.js';
|
|
2
|
+
export type CommitStories = {
|
|
3
|
+
stories: string;
|
|
4
|
+
storiesWithUrl: string;
|
|
5
|
+
};
|
|
6
|
+
export type GetCommitStoriesOptions = {
|
|
7
|
+
debug?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Base URL the issue reference is appended to, e.g. `https://jira.example.com/browse` for Jira or
|
|
10
|
+
* `https://gitlab.com/group/project/-/issues` for GitLab Issues. Links are omitted if not provided.
|
|
11
|
+
*/
|
|
12
|
+
almBaseUrl?: string;
|
|
13
|
+
/** The tracker to recognize references for. Defaults to Jira. */
|
|
14
|
+
almProvider?: AlmProvider;
|
|
15
|
+
};
|
|
16
|
+
export declare const NOT_AVAILABLE: CommitStories;
|
|
17
|
+
/**
|
|
18
|
+
* Hands a commit log to the configured `AlmProvider` to recognize its own reference format, and
|
|
19
|
+
* returns both a plain string and (if `almBaseUrl` is provided) an HTML list with hyperlinks.
|
|
20
|
+
* Shared by the local-git (`getCommitStories`) and remote-API (`getRemoteCommitStories`) lookups so
|
|
21
|
+
* the ALM-provider glue isn't duplicated between them.
|
|
22
|
+
*/
|
|
23
|
+
export declare function renderIssuesFromCommitLog(commitLog: string, almProjectKey: string | undefined, options?: GetCommitStoriesOptions): CommitStories;
|
|
24
|
+
/**
|
|
25
|
+
* Retrieves issue references from the commit logs between two tags/commits. Fetches the git
|
|
26
|
+
* history, hands the commit messages to the configured `AlmProvider` to recognize and render its
|
|
27
|
+
* own reference format, and returns both a plain string and (if `almBaseUrl` is provided) an HTML
|
|
28
|
+
* list with hyperlinks.
|
|
29
|
+
*/
|
|
30
|
+
export declare function getCommitStories(previousVersion: string | undefined, targetVersion: string | undefined, almProjectKey: string | undefined, options?: GetCommitStoriesOptions): Promise<CommitStories>;
|
|
@@ -0,0 +1,70 @@
|
|
|
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 { execa } from 'execa';
|
|
17
|
+
import { createAlmProvider } from '../alm/index.js';
|
|
18
|
+
import { getAlmProjectKeys } from '../sfConfig.js';
|
|
19
|
+
import { logger } from '../logger.js';
|
|
20
|
+
export const NOT_AVAILABLE = { stories: 'N/A', storiesWithUrl: 'N/A' };
|
|
21
|
+
/**
|
|
22
|
+
* Hands a commit log to the configured `AlmProvider` to recognize its own reference format, and
|
|
23
|
+
* returns both a plain string and (if `almBaseUrl` is provided) an HTML list with hyperlinks.
|
|
24
|
+
* Shared by the local-git (`getCommitStories`) and remote-API (`getRemoteCommitStories`) lookups so
|
|
25
|
+
* the ALM-provider glue isn't duplicated between them.
|
|
26
|
+
*/
|
|
27
|
+
export function renderIssuesFromCommitLog(commitLog, almProjectKey, options) {
|
|
28
|
+
const almProvider = options?.almProvider ?? createAlmProvider('jira');
|
|
29
|
+
const issues = almProvider.extractIssues(commitLog, getAlmProjectKeys(almProjectKey));
|
|
30
|
+
if (issues.length === 0) {
|
|
31
|
+
return NOT_AVAILABLE;
|
|
32
|
+
}
|
|
33
|
+
const { plain, html } = almProvider.render(issues, options?.almBaseUrl);
|
|
34
|
+
return { stories: plain, storiesWithUrl: html };
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Retrieves issue references from the commit logs between two tags/commits. Fetches the git
|
|
38
|
+
* history, hands the commit messages to the configured `AlmProvider` to recognize and render its
|
|
39
|
+
* own reference format, and returns both a plain string and (if `almBaseUrl` is provided) an HTML
|
|
40
|
+
* list with hyperlinks.
|
|
41
|
+
*/
|
|
42
|
+
export async function getCommitStories(previousVersion, targetVersion, almProjectKey, options) {
|
|
43
|
+
if (!previousVersion ||
|
|
44
|
+
!targetVersion ||
|
|
45
|
+
previousVersion === 'N/A' ||
|
|
46
|
+
targetVersion === 'N/A' ||
|
|
47
|
+
previousVersion === targetVersion) {
|
|
48
|
+
return NOT_AVAILABLE;
|
|
49
|
+
}
|
|
50
|
+
try {
|
|
51
|
+
await execa('git', ['fetch', '--unshallow', '--prune', '--tags', '--quiet']);
|
|
52
|
+
const { stdout: commits } = await execa('git', [
|
|
53
|
+
'log',
|
|
54
|
+
'--pretty=oneline',
|
|
55
|
+
`${previousVersion}...${targetVersion}`,
|
|
56
|
+
]);
|
|
57
|
+
if (!commits) {
|
|
58
|
+
return NOT_AVAILABLE;
|
|
59
|
+
}
|
|
60
|
+
return renderIssuesFromCommitLog(commits, almProjectKey, options);
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
logger.error(`Error getting commit stories: ${error.message}`);
|
|
64
|
+
if (options?.debug) {
|
|
65
|
+
logger.error(String(error));
|
|
66
|
+
}
|
|
67
|
+
return NOT_AVAILABLE;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=getCommitStories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCommitStories.js","sourceRoot":"","sources":["../../src/notify/getCommitStories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAoB,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAetC,MAAM,CAAC,MAAM,aAAa,GAAkB,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC;AAEtF;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CACvC,SAAiB,EACjB,aAAiC,EACjC,OAAiC;IAEjC,MAAM,WAAW,GAAG,OAAO,EAAE,WAAW,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACtE,MAAM,MAAM,GAAG,WAAW,CAAC,aAAa,CAAC,SAAS,EAAE,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAC;IAEtF,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IACxE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;AAClD,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,eAAmC,EACnC,aAAiC,EACjC,aAAiC,EACjC,OAAiC;IAEjC,IACE,CAAC,eAAe;QAChB,CAAC,aAAa;QACd,eAAe,KAAK,KAAK;QACzB,aAAa,KAAK,KAAK;QACvB,eAAe,KAAK,aAAa,EACjC,CAAC;QACD,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,IAAI,CAAC;QACH,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;QAC7E,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,KAAK,CAAC,KAAK,EAAE;YAC7C,KAAK;YACL,kBAAkB;YAClB,GAAG,eAAe,MAAM,aAAa,EAAE;SACxC,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,aAAa,CAAC;QACvB,CAAC;QAED,OAAO,yBAAyB,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,KAAK,CAAC,iCAAkC,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;QAC1E,IAAI,OAAO,EAAE,KAAK,EAAE,CAAC;YACnB,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC9B,CAAC;QACD,OAAO,aAAa,CAAC;IACvB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { VcsProjectRef, VcsProvider } from '../vcs/index.js';
|
|
2
|
+
import { type CommitStories, type GetCommitStoriesOptions } from './getCommitStories.js';
|
|
3
|
+
/**
|
|
4
|
+
* Retrieves issue references from the commit log between two refs in a *remote* VCS project —
|
|
5
|
+
* the happy-soup equivalent of `getCommitStories`, for packaged dependencies whose source isn't
|
|
6
|
+
* the current pipeline's own repo, so there's no local git history to read. Fetches the commit
|
|
7
|
+
* log via `vcsProvider.compareRefs`, then hands it to the same `AlmProvider` rendering used by the
|
|
8
|
+
* local-git lookup.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getRemoteCommitStories(vcsProvider: VcsProvider, project: VcsProjectRef, prevTag: string | undefined, targetTag: string | undefined, almProjectKey: string | undefined, options?: GetCommitStoriesOptions): Promise<CommitStories>;
|
|
@@ -0,0 +1,45 @@
|
|
|
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 { logger } from '../logger.js';
|
|
17
|
+
import { NOT_AVAILABLE, renderIssuesFromCommitLog, } from './getCommitStories.js';
|
|
18
|
+
/**
|
|
19
|
+
* Retrieves issue references from the commit log between two refs in a *remote* VCS project —
|
|
20
|
+
* the happy-soup equivalent of `getCommitStories`, for packaged dependencies whose source isn't
|
|
21
|
+
* the current pipeline's own repo, so there's no local git history to read. Fetches the commit
|
|
22
|
+
* log via `vcsProvider.compareRefs`, then hands it to the same `AlmProvider` rendering used by the
|
|
23
|
+
* local-git lookup.
|
|
24
|
+
*/
|
|
25
|
+
export async function getRemoteCommitStories(vcsProvider, project, prevTag, targetTag, almProjectKey, options) {
|
|
26
|
+
if (!prevTag || !targetTag || prevTag === targetTag) {
|
|
27
|
+
return NOT_AVAILABLE;
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
const commits = await vcsProvider.compareRefs(project, prevTag, targetTag);
|
|
31
|
+
if (commits.length === 0) {
|
|
32
|
+
return NOT_AVAILABLE;
|
|
33
|
+
}
|
|
34
|
+
const commitLog = commits.map((commit) => commit.message).join('\n');
|
|
35
|
+
return renderIssuesFromCommitLog(commitLog, almProjectKey, options);
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
logger.error(`Error getting remote commit stories: ${error.message}`);
|
|
39
|
+
if (options?.debug) {
|
|
40
|
+
logger.error(String(error));
|
|
41
|
+
}
|
|
42
|
+
return NOT_AVAILABLE;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=getRemoteCommitStories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getRemoteCommitStories.js","sourceRoot":"","sources":["../../src/notify/getRemoteCommitStories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EACL,aAAa,EACb,yBAAyB,GAG1B,MAAM,uBAAuB,CAAC;AAE/B;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,WAAwB,EACxB,OAAsB,EACtB,OAA2B,EAC3B,SAA6B,EAC7B,aAAiC,EACjC,OAAiC;IAEjC,IAAI,CAAC,OAAO,IAAI,CAAC,SAAS,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QACpD,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;QAE3E,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,aAAa,CAAC;QACvB,CAAC;QAED,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrE,OAAO,yBAAyB,CAAC,SAAS,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,KAAK,CAAC,wCAAyC,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;QACjF,IAAI,OAAO,EAAE,KAAK,EAAE,CAAC;YACnB,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC9B,CAAC;QACD,OAAO,aAAa,CAAC;IACvB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type AlmProviderKind } from '../alm/index.js';
|
|
2
|
+
export type NotifyHappySoupResult = {
|
|
3
|
+
sent: boolean;
|
|
4
|
+
};
|
|
5
|
+
export type NotifyHappySoupOptions = {
|
|
6
|
+
ciCommitRefName?: string;
|
|
7
|
+
ciEnvironmentName?: string;
|
|
8
|
+
ciJobName?: string;
|
|
9
|
+
ciJobStage?: string;
|
|
10
|
+
ciJobStatus?: string;
|
|
11
|
+
ciPipelineId?: string;
|
|
12
|
+
ciPipelineUrl?: string;
|
|
13
|
+
teamsWebhookUrl?: string[];
|
|
14
|
+
notifyOnCompletion: boolean;
|
|
15
|
+
deployProgressFile?: string;
|
|
16
|
+
almBaseUrl?: string;
|
|
17
|
+
almProjectKey?: string;
|
|
18
|
+
almProvider?: AlmProviderKind;
|
|
19
|
+
ciJobToken?: string;
|
|
20
|
+
projectAccessToken?: string;
|
|
21
|
+
debug?: boolean;
|
|
22
|
+
};
|
|
23
|
+
/** Posts a "starting stage" card to Teams. */
|
|
24
|
+
export declare function happySoupNotifyBeforeScript(options: NotifyHappySoupOptions): Promise<NotifyHappySoupResult>;
|
|
25
|
+
/** Posts a stage (or final) success/failure card to Teams, depending on `--notify-on-completion`. */
|
|
26
|
+
export declare function happySoupNotifyAfterScript(options: NotifyHappySoupOptions): Promise<NotifyHappySoupResult>;
|
|
@@ -0,0 +1,140 @@
|
|
|
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 { createAlmProvider } from '../alm/index.js';
|
|
17
|
+
import { createVcsProvider } from '../vcs/index.js';
|
|
18
|
+
import { loadProgress } from '../deploy/deployCommon.js';
|
|
19
|
+
import { resolvePackageOrigin } from '../happySoup/resolveOriginProject.js';
|
|
20
|
+
import { logger } from '../logger.js';
|
|
21
|
+
import { NOT_AVAILABLE } from './getCommitStories.js';
|
|
22
|
+
/** Compares by value rather than by reference, so a mocked/reconstructed `NOT_AVAILABLE` still counts. */
|
|
23
|
+
function isNotAvailable(result) {
|
|
24
|
+
return result.stories === NOT_AVAILABLE.stories && result.storiesWithUrl === NOT_AVAILABLE.storiesWithUrl;
|
|
25
|
+
}
|
|
26
|
+
import { getRemoteCommitStories } from './getRemoteCommitStories.js';
|
|
27
|
+
import { renderNotifyTemplate } from './renderTemplate.js';
|
|
28
|
+
import { sendNotification } from './sendNotification.js';
|
|
29
|
+
/**
|
|
30
|
+
* Resolves stories for one upgraded package: tries the CI job token first, falling back to a
|
|
31
|
+
* personal/project access token if the job token can't read the origin repo (a job token is
|
|
32
|
+
* typically scoped to its own project only, unless the target project has explicitly allowlisted
|
|
33
|
+
* it). Since a "no stories found" result is indistinguishable from "couldn't read the repo" once
|
|
34
|
+
* `getRemoteCommitStories` has swallowed the error, any non-`NOT_AVAILABLE` result from either
|
|
35
|
+
* attempt wins; if both come back `NOT_AVAILABLE`, that's the final answer either way.
|
|
36
|
+
*/
|
|
37
|
+
async function resolvePackageStories(upgradedPackage, options, almProvider) {
|
|
38
|
+
const origin = resolvePackageOrigin(upgradedPackage.packageName, upgradedPackage.targetDescription);
|
|
39
|
+
if (!origin) {
|
|
40
|
+
if (options.debug) {
|
|
41
|
+
logger.debug(`Could not resolve the origin repo for package ${upgradedPackage.packageName}.`);
|
|
42
|
+
}
|
|
43
|
+
return NOT_AVAILABLE;
|
|
44
|
+
}
|
|
45
|
+
const tokens = [];
|
|
46
|
+
if (options.ciJobToken) {
|
|
47
|
+
tokens.push({ token: options.ciJobToken, tokenKind: 'job' });
|
|
48
|
+
}
|
|
49
|
+
if (options.projectAccessToken) {
|
|
50
|
+
tokens.push({ token: options.projectAccessToken, tokenKind: 'personal' });
|
|
51
|
+
}
|
|
52
|
+
let result = NOT_AVAILABLE;
|
|
53
|
+
for (const { token, tokenKind } of tokens) {
|
|
54
|
+
const vcsProvider = createVcsProvider(origin.vcsProvider, { host: origin.host, token, tokenKind });
|
|
55
|
+
// eslint-disable-next-line no-await-in-loop -- try the job token first; only fall back to a personal/project access token if it came back empty
|
|
56
|
+
result = await getRemoteCommitStories(vcsProvider, origin.projectPath, upgradedPackage.prevTag, upgradedPackage.targetTag, options.almProjectKey, { almProvider, almBaseUrl: options.almBaseUrl, debug: options.debug });
|
|
57
|
+
if (!isNotAvailable(result)) {
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
/** Resolves stories for every upgraded package recorded in the deploy progress file. */
|
|
64
|
+
async function resolveUpgradedPackageStories(options) {
|
|
65
|
+
const deployProgressFile = options.deployProgressFile ?? 'DEPLOY_PROGRESS.json';
|
|
66
|
+
const progress = await loadProgress(deployProgressFile);
|
|
67
|
+
const upgradedPackages = progress.upgradedPackages ?? [];
|
|
68
|
+
if (upgradedPackages.length === 0) {
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
const almProvider = createAlmProvider(options.almProvider ?? 'jira');
|
|
72
|
+
const results = [];
|
|
73
|
+
for (const upgradedPackage of upgradedPackages) {
|
|
74
|
+
// eslint-disable-next-line no-await-in-loop -- each package's origin repo may require a separate token/provider; resolving one at a time keeps the fallback logic simple
|
|
75
|
+
const { storiesWithUrl } = await resolvePackageStories(upgradedPackage, options, almProvider);
|
|
76
|
+
results.push({ packageName: upgradedPackage.packageName, storiesLinked: storiesWithUrl });
|
|
77
|
+
}
|
|
78
|
+
return results;
|
|
79
|
+
}
|
|
80
|
+
/** Posts a "starting stage" card to Teams. */
|
|
81
|
+
export async function happySoupNotifyBeforeScript(options) {
|
|
82
|
+
const stage = options.ciJobStage ?? 'N/A';
|
|
83
|
+
const templateData = {
|
|
84
|
+
stage,
|
|
85
|
+
environmentName: options.ciEnvironmentName ?? 'N/A',
|
|
86
|
+
refName: options.ciCommitRefName ?? 'N/A',
|
|
87
|
+
pipelineUrl: options.ciPipelineUrl ?? '#',
|
|
88
|
+
pipelineId: options.ciPipelineId ?? 'N/A',
|
|
89
|
+
};
|
|
90
|
+
const message = renderNotifyTemplate('happy-soup-starting-stage-notification', templateData);
|
|
91
|
+
const payload = {
|
|
92
|
+
content: message,
|
|
93
|
+
environmentName: options.ciEnvironmentName,
|
|
94
|
+
refName: options.ciCommitRefName,
|
|
95
|
+
pipelineId: options.ciPipelineId,
|
|
96
|
+
pipelineUrl: options.ciPipelineUrl,
|
|
97
|
+
jobName: options.ciJobName,
|
|
98
|
+
jobStage: stage,
|
|
99
|
+
jobStatus: options.ciJobStatus ?? 'running',
|
|
100
|
+
};
|
|
101
|
+
await sendNotification(options.teamsWebhookUrl, payload);
|
|
102
|
+
return { sent: true };
|
|
103
|
+
}
|
|
104
|
+
/** Posts a stage (or final) success/failure card to Teams, depending on `--notify-on-completion`. */
|
|
105
|
+
export async function happySoupNotifyAfterScript(options) {
|
|
106
|
+
const stage = options.ciJobStage ?? 'N/A';
|
|
107
|
+
const failed = options.ciJobStatus === 'failed';
|
|
108
|
+
const templateData = {
|
|
109
|
+
stage,
|
|
110
|
+
environmentName: options.ciEnvironmentName ?? 'N/A',
|
|
111
|
+
refName: options.ciCommitRefName ?? 'N/A',
|
|
112
|
+
pipelineUrl: options.ciPipelineUrl ?? '#',
|
|
113
|
+
pipelineId: options.ciPipelineId ?? 'N/A',
|
|
114
|
+
};
|
|
115
|
+
if (!failed) {
|
|
116
|
+
templateData.upgradedPackages = await resolveUpgradedPackageStories(options);
|
|
117
|
+
}
|
|
118
|
+
const templateName = options.notifyOnCompletion
|
|
119
|
+
? failed
|
|
120
|
+
? 'happy-soup-final-failure-notification'
|
|
121
|
+
: 'happy-soup-final-success-notification'
|
|
122
|
+
: failed
|
|
123
|
+
? 'happy-soup-failure-notification'
|
|
124
|
+
: 'happy-soup-success-notification';
|
|
125
|
+
const message = renderNotifyTemplate(templateName, templateData);
|
|
126
|
+
const payload = {
|
|
127
|
+
content: message,
|
|
128
|
+
environmentName: options.ciEnvironmentName,
|
|
129
|
+
refName: options.ciCommitRefName,
|
|
130
|
+
pipelineId: options.ciPipelineId,
|
|
131
|
+
pipelineUrl: options.ciPipelineUrl,
|
|
132
|
+
jobName: options.ciJobName,
|
|
133
|
+
jobStage: options.ciJobStage,
|
|
134
|
+
jobStatus: options.ciJobStatus,
|
|
135
|
+
upgradedPackages: templateData.upgradedPackages,
|
|
136
|
+
};
|
|
137
|
+
await sendNotification(options.teamsWebhookUrl, payload);
|
|
138
|
+
return { sent: true };
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=happySoupNotification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"happySoupNotification.js","sourceRoot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AAgB,EAAE,YAAY,CAAC,gBAAgB;KAChD,CAAC;IAEF,MAAM,gBAAgB,CAAC,OAAO,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;IACzD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type AlmProviderKind } from '../alm/index.js';
|
|
2
|
+
export type NotifyProjectResult = {
|
|
3
|
+
sent: boolean;
|
|
4
|
+
};
|
|
5
|
+
type PrevInstalledPackageVersionParams = {
|
|
6
|
+
alias?: string;
|
|
7
|
+
debug: boolean;
|
|
8
|
+
};
|
|
9
|
+
type TargetPackageVersionParams = {
|
|
10
|
+
/** The packaging DevHub's alias. Must already be authenticated. */
|
|
11
|
+
packagingDevhub?: string;
|
|
12
|
+
subscriberPackageVersionId?: string;
|
|
13
|
+
debug: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type NotifyProjectOptions = {
|
|
16
|
+
alias?: string;
|
|
17
|
+
ciCommitRefName?: string;
|
|
18
|
+
ciEnvironmentName?: string;
|
|
19
|
+
ciJobName?: string;
|
|
20
|
+
ciJobStage?: string;
|
|
21
|
+
ciJobStatus?: string;
|
|
22
|
+
ciPipelineId?: string;
|
|
23
|
+
ciPipelineUrl?: string;
|
|
24
|
+
ciProjectTitle?: string;
|
|
25
|
+
packagingDevhub?: string;
|
|
26
|
+
almBaseUrl?: string;
|
|
27
|
+
almProjectKey?: string;
|
|
28
|
+
almProvider?: AlmProviderKind;
|
|
29
|
+
prevInstalledPackageVersion?: string;
|
|
30
|
+
subscriberPackageVersionId?: string;
|
|
31
|
+
targetPackageVersion?: string;
|
|
32
|
+
teamsWebhookUrl?: string[];
|
|
33
|
+
debug: boolean;
|
|
34
|
+
};
|
|
35
|
+
/** Queries the target org's installed package version. The org must already be authenticated. */
|
|
36
|
+
export declare function resolvePrevInstalledPackageVersion(params: PrevInstalledPackageVersionParams): Promise<string>;
|
|
37
|
+
/** Resolves the released package's version from the packaging DevHub. Returns `undefined` on any failure. */
|
|
38
|
+
export declare function resolveTargetPackageVersionFromDevHub(params: TargetPackageVersionParams): Promise<string | undefined>;
|
|
39
|
+
/** Falls back to the git tag pointing at HEAD when the DevHub can't resolve a target version. */
|
|
40
|
+
export declare function resolveTargetPackageVersionFromGitTag(debug: boolean): Promise<string>;
|
|
41
|
+
export declare function resolveTargetPackageVersion(params: TargetPackageVersionParams): Promise<string>;
|
|
42
|
+
/** Resolves and records the previously installed and target package versions for later stages. */
|
|
43
|
+
export declare function projectNotifyBeforeScript(options: NotifyProjectOptions): Promise<void>;
|
|
44
|
+
/** Posts the deployment result card (with Jira stories on success) to Teams. */
|
|
45
|
+
export declare function projectNotifyAfterScript(options: NotifyProjectOptions): Promise<NotifyProjectResult>;
|
|
46
|
+
export {};
|