@intentius/chant 0.124.77 → 0.124.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__fixtures__/notify-messages/events.d.ts +9 -0
- package/dist/__fixtures__/notify-messages/events.d.ts.map +1 -0
- package/dist/__fixtures__/notify-messages/events.js +21 -0
- package/dist/__fixtures__/product-words.d.ts +14 -0
- package/dist/__fixtures__/product-words.d.ts.map +1 -1
- package/dist/__fixtures__/product-words.js +11 -0
- package/dist/__fixtures__/terragucci-notify.d.ts +66 -0
- package/dist/__fixtures__/terragucci-notify.d.ts.map +1 -0
- package/dist/__fixtures__/terragucci-notify.js +133 -0
- package/dist/action-pins.d.ts +8 -0
- package/dist/action-pins.d.ts.map +1 -1
- package/dist/action-pins.js +9 -0
- package/dist/agent-guard.d.ts.map +1 -1
- package/dist/agent-guard.js +1 -2
- package/dist/ci-commit.d.ts +66 -2
- package/dist/ci-commit.d.ts.map +1 -1
- package/dist/ci-commit.js +148 -19
- package/dist/ci-own-jobs.d.ts.map +1 -1
- package/dist/ci-own-jobs.js +1 -2
- package/dist/ci-product-words.d.ts +18 -4
- package/dist/ci-product-words.d.ts.map +1 -1
- package/dist/ci-product-words.js +26 -6
- package/dist/ci-product.d.ts +1 -1
- package/dist/ci-product.d.ts.map +1 -1
- package/dist/ci-product.js +3 -4
- package/dist/cli/handlers/release.js +4 -4
- package/dist/components/pr-env-components.d.ts.map +1 -1
- package/dist/components/pr-env-components.js +1 -2
- package/dist/config.d.ts +14 -8
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +16 -1
- package/dist/lexicon.d.ts +8 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lexicon.js +9 -0
- package/dist/lifecycle/release-images.d.ts +77 -3
- package/dist/lifecycle/release-images.d.ts.map +1 -1
- package/dist/lifecycle/release-images.js +132 -6
- package/dist/notify-product.d.ts +11 -2
- package/dist/notify-product.d.ts.map +1 -1
- package/dist/notify-product.js +16 -4
- package/dist/notify-relay.d.ts.map +1 -1
- package/dist/notify-relay.js +1 -2
- package/dist/notify.d.ts +36 -4
- package/dist/notify.d.ts.map +1 -1
- package/dist/notify.js +31 -21
- package/dist/notify.schema.json +1 -0
- package/dist/op/activities/review-product.d.ts +111 -0
- package/dist/op/activities/review-product.d.ts.map +1 -0
- package/dist/op/activities/review-product.js +116 -0
- package/dist/policy-engine.d.ts.map +1 -1
- package/dist/policy-engine.js +1 -2
- package/dist/pr-forge-reads.d.ts +124 -0
- package/dist/pr-forge-reads.d.ts.map +1 -0
- package/dist/pr-forge-reads.js +322 -0
- package/dist/pr-forge.d.ts +14 -0
- package/dist/pr-forge.d.ts.map +1 -1
- package/dist/pr-forge.js +21 -13
- package/dist/pr-plan-note.d.ts +293 -0
- package/dist/pr-plan-note.d.ts.map +1 -0
- package/dist/pr-plan-note.js +362 -0
- package/dist/release-floors.d.ts +9 -1
- package/dist/release-floors.d.ts.map +1 -1
- package/dist/release-floors.js +9 -1
- package/dist/state-export.d.ts.map +1 -1
- package/dist/state-export.js +1 -2
- package/dist/state-migration.d.ts.map +1 -1
- package/dist/state-migration.js +1 -2
- package/dist/state-unlock.d.ts.map +1 -1
- package/dist/state-unlock.js +1 -2
- package/dist/wave-runtime.mjs +271 -271
- package/dist/workspace/release-workflow.d.ts.map +1 -1
- package/dist/workspace/release-workflow.js +2 -1
- package/package.json +1 -1
- package/src/__fixtures__/notify-messages/events.ts +23 -0
- package/src/__fixtures__/notify-messages/messages.json +50 -0
- package/src/__fixtures__/pr-loop/terragucci-plan.note.golden.md +53 -0
- package/src/__fixtures__/pr-loop/terragucci-plan.note.json +83 -0
- package/src/__fixtures__/product-words.ts +12 -0
- package/src/__fixtures__/review-agent/terragucci-review.json +94 -0
- package/src/__fixtures__/terragucci-notify.ts +170 -0
- package/src/action-pins.test.ts +12 -1
- package/src/action-pins.ts +11 -0
- package/src/agent-guard.test.ts +1 -2
- package/src/agent-guard.ts +1 -2
- package/src/ci-commit.test.ts +163 -0
- package/src/ci-commit.ts +168 -21
- package/src/ci-own-jobs.test.ts +1 -2
- package/src/ci-own-jobs.ts +1 -2
- package/src/ci-product-words.ts +35 -7
- package/src/ci-product.ts +3 -4
- package/src/cli/handlers/build-pr-loop-control.test.ts +1 -2
- package/src/cli/handlers/build-run-group.test.ts +1 -2
- package/src/cli/handlers/release.ts +5 -5
- package/src/components/pr-env-components.test.ts +1 -2
- package/src/components/pr-env-components.ts +1 -2
- package/src/config.ts +23 -3
- package/src/gate-policy-bundle.test.ts +1 -1
- package/src/lexicon.ts +10 -0
- package/src/lifecycle/release-images-dockerfile.test.ts +221 -0
- package/src/lifecycle/release-images.ts +167 -8
- package/src/notify-message-words.test.ts +186 -0
- package/src/notify-product.ts +17 -4
- package/src/notify-relay.ts +1 -2
- package/src/notify.schema.json +1 -0
- package/src/notify.ts +59 -19
- package/src/op/activities/review-product.test.ts +116 -0
- package/src/op/activities/review-product.ts +200 -0
- package/src/op/schedule-overdue.test.ts +26 -0
- package/src/policy-engine.test.ts +1 -2
- package/src/policy-engine.ts +1 -2
- package/src/pr-forge-reads.test.ts +285 -0
- package/src/pr-forge-reads.ts +424 -0
- package/src/pr-forge.ts +30 -16
- package/src/pr-plan-note.test.ts +105 -0
- package/src/pr-plan-note.ts +521 -0
- package/src/release-floors.ts +13 -1
- package/src/state-export.test.ts +1 -2
- package/src/state-export.ts +1 -2
- package/src/state-migration.test.ts +1 -2
- package/src/state-migration.ts +1 -2
- package/src/state-unlock.test.ts +1 -2
- package/src/state-unlock.ts +1 -2
- package/src/workspace/release-workflow.ts +2 -1
|
@@ -21,14 +21,66 @@
|
|
|
21
21
|
* An npm target's `pins` names the file in a package that carries the
|
|
22
22
|
* digests. The publish plan and `chant release verify` read it and refuse a
|
|
23
23
|
* digest the release does not record as an image.
|
|
24
|
+
*
|
|
25
|
+
* An entry may name a Dockerfile instead of a command (#4819): chant runs
|
|
26
|
+
* the reproducible build itself ({@link releaseImageBuildCommand}), a
|
|
27
|
+
* `docker-container` buildx builder writing an OCI archive with timestamps
|
|
28
|
+
* rewritten from `SOURCE_DATE_EPOCH` and no attestations, for every
|
|
29
|
+
* platform. Its `prepare` command (the bundle the image carries, a packed
|
|
30
|
+
* package) runs first with no digests file named, so the image is the same
|
|
31
|
+
* in the cut and the publish job. A product's package build turns the
|
|
32
|
+
* digests file and its `{ name: reference }` into the table it bakes in with
|
|
33
|
+
* {@link releaseImagePins}, and writes the pins file with
|
|
34
|
+
* {@link writeReleaseImagePins}. This module reaches only Node's built-ins at
|
|
35
|
+
* run time, so a product's build script imports it under plain Node.
|
|
24
36
|
*/
|
|
25
37
|
import { spawnSync } from "node:child_process";
|
|
26
|
-
import { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
|
|
27
|
-
import { dirname, isAbsolute, relative, resolve } from "node:path";
|
|
38
|
+
import { existsSync, mkdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
39
|
+
import { dirname, isAbsolute, posix, relative, resolve } from "node:path";
|
|
40
|
+
import { NEXT_RELEASE } from "../release-floors.js";
|
|
28
41
|
/** The variable that names the digests file a release's package build reads. */
|
|
29
42
|
export const RELEASE_DIGESTS_ENV = "CHANT_RELEASE_DIGESTS";
|
|
30
43
|
/** The first chant with `release.images`, `CHANT_RELEASE_DIGESTS`, `chant release images` and an npm target's `pins` (#4657). Products feature-detect on it. */
|
|
31
44
|
export const RELEASE_IMAGES_FLOOR = "0.124.71";
|
|
45
|
+
/**
|
|
46
|
+
* The first chant whose `release.images` takes a Dockerfile entry, with
|
|
47
|
+
* `releaseImagePins` and `writeReleaseImagePins` for a product's package
|
|
48
|
+
* build (#4819).
|
|
49
|
+
*/
|
|
50
|
+
export const RELEASE_IMAGE_DOCKERFILE_FLOOR = NEXT_RELEASE;
|
|
51
|
+
/** The platforms a Dockerfile entry builds by default. Building arm64 on amd64 needs QEMU's binfmt handlers. */
|
|
52
|
+
export const RELEASE_IMAGE_PLATFORMS = ["linux/amd64", "linux/arm64"];
|
|
53
|
+
/** The buildx builder a Dockerfile entry builds with, created with the `docker-container` driver when missing: the default driver cannot rewrite timestamps in an OCI archive. */
|
|
54
|
+
export const RELEASE_IMAGE_BUILDER = "chant-release";
|
|
55
|
+
const PLATFORM = /^[a-z0-9]+\/[a-z0-9_]+(?:\/[a-z0-9]+)?$/;
|
|
56
|
+
/** A word the shell reads as itself. */
|
|
57
|
+
const sh = (s) => (/^[A-Za-z0-9_./:=,@+%-]+$/.test(s) ? s : `'${s.replace(/'/g, "'\\''")}'`);
|
|
58
|
+
const isDockerfile = (i) => "dockerfile" in i && i.dockerfile !== undefined;
|
|
59
|
+
const archiveOf = (i) => i.archive ?? `dist/images/${i.name}.tar`;
|
|
60
|
+
/**
|
|
61
|
+
* The shell command a Dockerfile entry builds with (#4819), the one
|
|
62
|
+
* terragucci's and plywood's `scripts/release-image.sh` ran: `--no-cache`,
|
|
63
|
+
* no provenance or SBOM in the archive (chant attaches its own), the
|
|
64
|
+
* `SOURCE_DATE_EPOCH` the cut sets passed as a build argument and used to
|
|
65
|
+
* rewrite every timestamp, and every platform in one image index.
|
|
66
|
+
*/
|
|
67
|
+
export function releaseImageBuildCommand(i) {
|
|
68
|
+
const archive = archiveOf(i);
|
|
69
|
+
const b = RELEASE_IMAGE_BUILDER;
|
|
70
|
+
return [
|
|
71
|
+
`{ docker buildx inspect ${b} >/dev/null 2>&1 || docker buildx create --name ${b} --driver docker-container >/dev/null; }`,
|
|
72
|
+
`mkdir -p ${sh(posix.dirname(archive))}`,
|
|
73
|
+
[
|
|
74
|
+
`docker buildx build --builder ${b} --no-cache --platform ${sh((i.platforms ?? RELEASE_IMAGE_PLATFORMS).join(","))}`,
|
|
75
|
+
`--provenance=false --sbom=false --build-arg SOURCE_DATE_EPOCH="$SOURCE_DATE_EPOCH"`,
|
|
76
|
+
`--output ${sh(`type=oci,dest=${archive},rewrite-timestamp=true`)} -f ${sh(i.dockerfile)} ${sh(i.context ?? ".")} >&2`,
|
|
77
|
+
].join(" "),
|
|
78
|
+
].join(" && ");
|
|
79
|
+
}
|
|
80
|
+
/** Each entry as a command and an archive: a Dockerfile entry's command is {@link releaseImageBuildCommand}, its archive the default when it names none. */
|
|
81
|
+
export function resolveReleaseImages(images) {
|
|
82
|
+
return images.map((i) => (isDockerfile(i) ? { name: i.name, build: releaseImageBuildCommand(i), archive: archiveOf(i) } : i));
|
|
83
|
+
}
|
|
32
84
|
export class ReleaseImageError extends Error {
|
|
33
85
|
constructor(code, message, fix) {
|
|
34
86
|
super(message);
|
|
@@ -38,7 +90,8 @@ export class ReleaseImageError extends Error {
|
|
|
38
90
|
}
|
|
39
91
|
}
|
|
40
92
|
const NAME = /^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$/;
|
|
41
|
-
|
|
93
|
+
const outside = (p) => isAbsolute(p) || p.split(/[\\/]/).includes("..");
|
|
94
|
+
/** Check a member's `release.images`: names valid and unique, one of `build` and `dockerfile`, paths inside the member, platforms of the form os/arch. */
|
|
42
95
|
export function checkReleaseImages(images) {
|
|
43
96
|
const seen = new Set();
|
|
44
97
|
for (const i of images) {
|
|
@@ -47,8 +100,15 @@ export function checkReleaseImages(images) {
|
|
|
47
100
|
if (seen.has(i.name))
|
|
48
101
|
throw new ReleaseImageError("release-image-name-taken", `release.images names "${i.name}" twice`);
|
|
49
102
|
seen.add(i.name);
|
|
50
|
-
if (
|
|
51
|
-
throw new ReleaseImageError("release-image-
|
|
103
|
+
if (isDockerfile(i) && "build" in i)
|
|
104
|
+
throw new ReleaseImageError("release-image-invalid", `release.images "${i.name}" names a build command and a Dockerfile; chant builds a Dockerfile itself, so name one`);
|
|
105
|
+
const paths = isDockerfile(i) ? [["the archive", archiveOf(i)], ["the Dockerfile", i.dockerfile], ["the context", i.context]] : [["the archive", i.archive]];
|
|
106
|
+
for (const [what, p] of paths) {
|
|
107
|
+
if (p !== undefined && outside(p))
|
|
108
|
+
throw new ReleaseImageError("release-image-archive-outside", `release.images "${i.name}": ${what} ${p} is not a path inside the member`);
|
|
109
|
+
}
|
|
110
|
+
if (isDockerfile(i) && i.platforms !== undefined && (i.platforms.length === 0 || !i.platforms.every((p) => PLATFORM.test(p)))) {
|
|
111
|
+
throw new ReleaseImageError("release-image-invalid", `release.images "${i.name}": platforms is a list of os/arch such as linux/amd64, not ${JSON.stringify(i.platforms)}`);
|
|
52
112
|
}
|
|
53
113
|
}
|
|
54
114
|
}
|
|
@@ -63,11 +123,27 @@ export function buildReleaseImages(i) {
|
|
|
63
123
|
checkReleaseImages(i.images);
|
|
64
124
|
const run = i.run ?? defaultRun;
|
|
65
125
|
const out = [];
|
|
66
|
-
|
|
126
|
+
const envFor = () => {
|
|
67
127
|
const env = { ...(i.env ?? process.env), SOURCE_DATE_EPOCH: String(i.sourceDateEpoch) };
|
|
68
128
|
delete env.CHANT_RELEASE_LABEL;
|
|
69
129
|
if (i.label !== null)
|
|
70
130
|
env.CHANT_RELEASE_LABEL = i.label;
|
|
131
|
+
return env;
|
|
132
|
+
};
|
|
133
|
+
// #4819: each prepare command once, before any build, with no digests file, as the image's contents are built in the cut and the publish job alike.
|
|
134
|
+
const prepared = new Set();
|
|
135
|
+
for (const image of i.images) {
|
|
136
|
+
if (!isDockerfile(image) || !image.prepare || prepared.has(image.prepare))
|
|
137
|
+
continue;
|
|
138
|
+
prepared.add(image.prepare);
|
|
139
|
+
const env = envFor();
|
|
140
|
+
delete env[RELEASE_DIGESTS_ENV];
|
|
141
|
+
const status = run(image.prepare, { cwd: i.cwd, env });
|
|
142
|
+
if (status !== 0)
|
|
143
|
+
throw new ReleaseImageError("release-image-build-failed", `the prepare command of image "${image.name}" exited ${status ?? "with a signal"}: ${image.prepare}`);
|
|
144
|
+
}
|
|
145
|
+
for (const image of resolveReleaseImages(i.images)) {
|
|
146
|
+
const env = envFor();
|
|
71
147
|
const status = run(image.build, { cwd: i.cwd, env });
|
|
72
148
|
if (status !== 0)
|
|
73
149
|
throw new ReleaseImageError("release-image-build-failed", `the build of image "${image.name}" exited ${status ?? "with a signal"}: ${image.build}`);
|
|
@@ -90,6 +166,56 @@ export function releaseImageDigests(release, names) {
|
|
|
90
166
|
}
|
|
91
167
|
return out;
|
|
92
168
|
}
|
|
169
|
+
// ── a product's package build (#4819) ──────────────────────────────────
|
|
170
|
+
const SHA256 = /^sha256:[0-9a-f]{64}$/;
|
|
171
|
+
/**
|
|
172
|
+
* The digest table a release's package build bakes into its bundle: each
|
|
173
|
+
* reference in `images` to the digest the cut recorded for its name, in
|
|
174
|
+
* `images`' order. Undefined outside a release build (no
|
|
175
|
+
* `CHANT_RELEASE_DIGESTS`), when a pipeline names the images by tag. Refuses
|
|
176
|
+
* a label that is not the version and a name the digests file has no digest
|
|
177
|
+
* for.
|
|
178
|
+
*/
|
|
179
|
+
export function releaseImagePins(i) {
|
|
180
|
+
const env = i.env ?? process.env;
|
|
181
|
+
const file = env[RELEASE_DIGESTS_ENV];
|
|
182
|
+
if (!file)
|
|
183
|
+
return undefined;
|
|
184
|
+
const label = env.CHANT_RELEASE_LABEL;
|
|
185
|
+
if (label && label !== i.version) {
|
|
186
|
+
throw new ReleaseImageError("release-label-not-version", `the release is labelled ${label}, and the package is at ${i.version}`, `Set the package's version to ${label} on the default branch, then cut the merged commit.`);
|
|
187
|
+
}
|
|
188
|
+
const named = JSON.parse(readFileSync(file, "utf-8"));
|
|
189
|
+
const table = {};
|
|
190
|
+
for (const [name, reference] of Object.entries(i.images)) {
|
|
191
|
+
const digest = named[name];
|
|
192
|
+
if (typeof digest !== "string" || !SHA256.test(digest))
|
|
193
|
+
throw new ReleaseImageError("release-image-digest-missing", `${file} has no digest for the ${name} image, which the release builds`);
|
|
194
|
+
table[reference] = digest;
|
|
195
|
+
}
|
|
196
|
+
return table;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Write the pins file an npm target's `pins` names, once the bundle is
|
|
200
|
+
* built: the table as JSON, after checking that every bundle in `bundles`
|
|
201
|
+
* carries each digest. With no table (not a release build), remove the file,
|
|
202
|
+
* so a package never ships a stale one.
|
|
203
|
+
*/
|
|
204
|
+
export function writeReleaseImagePins(table, o) {
|
|
205
|
+
if (!table) {
|
|
206
|
+
rmSync(o.out, { force: true });
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
for (const bundle of o.bundles ?? []) {
|
|
210
|
+
const text = readFileSync(bundle, "utf-8");
|
|
211
|
+
for (const [reference, digest] of Object.entries(table)) {
|
|
212
|
+
if (!text.includes(digest))
|
|
213
|
+
throw new ReleaseImageError("release-pin-not-bundled", `${bundle} does not carry ${reference}@${digest}`);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
mkdirSync(dirname(o.out), { recursive: true });
|
|
217
|
+
writeFileSync(o.out, `${JSON.stringify(table, null, 2)}\n`);
|
|
218
|
+
}
|
|
93
219
|
/** Write the digests file a package build reads. */
|
|
94
220
|
export function writeReleaseDigests(file, digests) {
|
|
95
221
|
mkdirSync(dirname(file), { recursive: true });
|
package/dist/notify-product.d.ts
CHANGED
|
@@ -13,13 +13,22 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { type CiProductNotifyWords, type CiProductWords } from "./ci-product-words.js";
|
|
15
15
|
import type { NotifyFields, SendNotifyOptions } from "./notify.js";
|
|
16
|
+
/**
|
|
17
|
+
* The first chant whose Slack and Teams messages take a product's words, a
|
|
18
|
+
* drift event's `rerunUrl` and the relay's name (#4818): `notify.message` in
|
|
19
|
+
* the words, `message` in sendNotify's options, and the third argument of
|
|
20
|
+
* `slackMessage` and `teamsMessage`.
|
|
21
|
+
*/
|
|
22
|
+
export declare const NOTIFY_MESSAGE_WORDS_FLOOR = "0.124.78";
|
|
16
23
|
/** The notify slots of `words`, chant's when a caller built words before #4610. */
|
|
17
24
|
export declare function productNotifyWords(words: CiProductWords): CiProductNotifyWords;
|
|
18
25
|
/** The event's `source` under `words`: `notify.source`, else the product's name. */
|
|
19
26
|
export declare function productNotifySource(words: CiProductWords): string;
|
|
20
27
|
/**
|
|
21
|
-
* `options` with the product's header prefix, unless the caller names one
|
|
22
|
-
*
|
|
28
|
+
* `options` with the product's header prefix, unless the caller names one,
|
|
29
|
+
* and its message words (`notify.message`, #4818) under the caller's
|
|
30
|
+
* `message`. chant's own words with no message words leave `options` as they
|
|
31
|
+
* are, so chant sends `x-chant`.
|
|
23
32
|
*/
|
|
24
33
|
export declare function productSendOptions(words: CiProductWords, options?: SendNotifyOptions): SendNotifyOptions;
|
|
25
34
|
/** What a drift notice concerns. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notify-product.d.ts","sourceRoot":"","sources":["../src/notify-product.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAA6B,KAAK,oBAAoB,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC/G,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"notify-product.d.ts","sourceRoot":"","sources":["../src/notify-product.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAA6B,KAAK,oBAAoB,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC/G,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAGhE;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,aAAe,CAAC;AAEvD,mFAAmF;AACnF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,GAAG,oBAAoB,CAE9E;AAED,oFAAoF;AACpF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAEjE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,GAAE,iBAAsB,GAAG,iBAAiB,CAK5G;AAED,oCAAoC;AACpC,MAAM,WAAW,gBAAgB;IAC/B,6CAA6C;IAC7C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,gBAAgB,GAAG,YAAY,CAqB9F"}
|
package/dist/notify-product.js
CHANGED
|
@@ -12,6 +12,14 @@
|
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
14
|
import { CHANT_WORDS, isChantWords } from "./ci-product-words.js";
|
|
15
|
+
import { NEXT_RELEASE } from "./release-floors.js";
|
|
16
|
+
/**
|
|
17
|
+
* The first chant whose Slack and Teams messages take a product's words, a
|
|
18
|
+
* drift event's `rerunUrl` and the relay's name (#4818): `notify.message` in
|
|
19
|
+
* the words, `message` in sendNotify's options, and the third argument of
|
|
20
|
+
* `slackMessage` and `teamsMessage`.
|
|
21
|
+
*/
|
|
22
|
+
export const NOTIFY_MESSAGE_WORDS_FLOOR = NEXT_RELEASE;
|
|
15
23
|
/** The notify slots of `words`, chant's when a caller built words before #4610. */
|
|
16
24
|
export function productNotifyWords(words) {
|
|
17
25
|
return words.notify ?? CHANT_WORDS.notify;
|
|
@@ -21,13 +29,17 @@ export function productNotifySource(words) {
|
|
|
21
29
|
return productNotifyWords(words).source;
|
|
22
30
|
}
|
|
23
31
|
/**
|
|
24
|
-
* `options` with the product's header prefix, unless the caller names one
|
|
25
|
-
*
|
|
32
|
+
* `options` with the product's header prefix, unless the caller names one,
|
|
33
|
+
* and its message words (`notify.message`, #4818) under the caller's
|
|
34
|
+
* `message`. chant's own words with no message words leave `options` as they
|
|
35
|
+
* are, so chant sends `x-chant`.
|
|
26
36
|
*/
|
|
27
37
|
export function productSendOptions(words, options = {}) {
|
|
38
|
+
const own = productNotifyWords(words);
|
|
39
|
+
const out = own.message ? { ...options, message: { ...own.message, ...options.message } } : options;
|
|
28
40
|
if (options.prefix !== undefined || isChantWords(words))
|
|
29
|
-
return
|
|
30
|
-
return { ...
|
|
41
|
+
return out;
|
|
42
|
+
return { ...out, prefix: own.headers };
|
|
31
43
|
}
|
|
32
44
|
/**
|
|
33
45
|
* A `drift` event under `words`: `2 stacks drifted: shop-dev, shop-prod` for
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notify-relay.d.ts","sourceRoot":"","sources":["../src/notify-relay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAGH,OAAO,EAAsC,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"notify-relay.d.ts","sourceRoot":"","sources":["../src/notify-relay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAGH,OAAO,EAAsC,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAGrE;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,aAAa,CAAC;AAEpD;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,aAAa,CAAC;AAEnD,qDAAqD;AACrD,eAAO,MAAM,SAAS;IACpB,yGAAyG;aACzG,GAAG,EAAE,iBAAiB;aACtB,WAAW,EAAE,sBAAsB;aACnC,WAAW,EAAE,sBAAsB;IACnC,wEAAwE;aACxE,SAAS,EA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EAAE,aAAa,EACvB,IAAI,EAAE,SAAS,EACf,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,UAAU,CAAC;IAAC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,GAC9E,OAAO,CAAC,aAAa,CAAC,CAwCxB;AAqBD,wGAAwG;AACxG,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,SAAS,EACf,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,UAAU,CAAC;IAAC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAAO,GAC9F,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,CA4BtE"}
|
package/dist/notify-relay.js
CHANGED
|
@@ -44,7 +44,6 @@
|
|
|
44
44
|
import { createHmac, timingSafeEqual } from "node:crypto";
|
|
45
45
|
import { createServer } from "node:http";
|
|
46
46
|
import { readRelayToken, RELAY_APPROVE_ACTION, RELAY_DECLINE_ACTION } from "./notify.js";
|
|
47
|
-
import { NEXT_RELEASE } from "./release-floors.js";
|
|
48
47
|
/**
|
|
49
48
|
* The first chant whose relay answers a gate's decision point and whose
|
|
50
49
|
* `sendNotify` hands a product's own render the signed buttons
|
|
@@ -60,7 +59,7 @@ export const NOTIFY_RELAY_POINTS_FLOOR = "0.124.72";
|
|
|
60
59
|
* (#4759). A product whose relay container ran its own entrypoint for these
|
|
61
60
|
* feature-detects on it.
|
|
62
61
|
*/
|
|
63
|
-
export const NOTIFY_RELAY_CLONE_FLOOR =
|
|
62
|
+
export const NOTIFY_RELAY_CLONE_FLOOR = "0.124.77";
|
|
64
63
|
/** The relay's settings, by environment variable. */
|
|
65
64
|
export const RELAY_ENV = {
|
|
66
65
|
/** The key the notify buttons are signed with: the variable `notify.relay` names on the sending side. */
|
package/dist/notify.d.ts
CHANGED
|
@@ -106,6 +106,8 @@ export interface NotifyEvent {
|
|
|
106
106
|
run?: NotifyRun;
|
|
107
107
|
/** A report page for the run. */
|
|
108
108
|
reportUrl?: string;
|
|
109
|
+
/** On `drift` (#4818): the page where a person runs the check again, which the chat messages open from a button. */
|
|
110
|
+
rerunUrl?: string;
|
|
109
111
|
/** The product's own record of the outcome, carried whole for programs that know it. */
|
|
110
112
|
detail?: Record<string, unknown>;
|
|
111
113
|
}
|
|
@@ -167,6 +169,34 @@ export declare function makeNotifyEvent(fields: NotifyFields, options?: {
|
|
|
167
169
|
}): NotifyEvent;
|
|
168
170
|
/** The first line of every chat message: `<source>: <summary>`, or what happened to what when there is no summary. */
|
|
169
171
|
export declare function notifyHeadline(e: NotifyEvent): string;
|
|
172
|
+
/**
|
|
173
|
+
* A product's words in the Slack and Teams messages (#4818). Each slot left
|
|
174
|
+
* out keeps chant's, so a message given none is as before.
|
|
175
|
+
*/
|
|
176
|
+
export interface NotifyMessageWords {
|
|
177
|
+
/** The targets' label. Default `Targets`. */
|
|
178
|
+
targets?: string;
|
|
179
|
+
/** The targets' value when the event names none. Default: no line. */
|
|
180
|
+
noTargets?: string;
|
|
181
|
+
/** The reason's label. Default `Reason`. */
|
|
182
|
+
reason?: string;
|
|
183
|
+
/** What a person does after the review: `run it again`. */
|
|
184
|
+
again?: string;
|
|
185
|
+
/** The label of a Teams fact giving the wave's number. Default: no fact. */
|
|
186
|
+
wave?: string;
|
|
187
|
+
/** `false` leaves the report link out of the Teams card. */
|
|
188
|
+
teamsReport?: boolean;
|
|
189
|
+
/** The re-run button: its label (`Run again`), and the Slack action id (`chant-rerun`) and block id (none). */
|
|
190
|
+
rerun?: {
|
|
191
|
+
label?: string;
|
|
192
|
+
action?: string;
|
|
193
|
+
block?: string;
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
/** The words, and the relay's name: a Teams outgoing webhook reads only a message that mentions it, so with the name the card says the whole reply (#4818). */
|
|
197
|
+
export interface NotifyMessageOptions extends NotifyMessageWords {
|
|
198
|
+
relayName?: string;
|
|
199
|
+
}
|
|
170
200
|
/** The Slack buttons' action ids, which `chant notify relay` reads. */
|
|
171
201
|
export declare const RELAY_APPROVE_ACTION = "chant-approve";
|
|
172
202
|
export declare const RELAY_DECLINE_ACTION = "chant-decline";
|
|
@@ -200,8 +230,8 @@ export declare const DEFAULT_RELAY_MAX_AGE_SECONDS: number;
|
|
|
200
230
|
export interface RelayButtons {
|
|
201
231
|
token: string;
|
|
202
232
|
}
|
|
203
|
-
/** A Slack incoming webhook's body: one mrkdwn text, with the approve command as code and the links as links. With `relay`, Approve and Decline buttons (#4611). */
|
|
204
|
-
export declare function slackMessage(e: NotifyEvent, relay?: RelayButtons): {
|
|
233
|
+
/** A Slack incoming webhook's body: one mrkdwn text, with the approve command as code and the links as links. With `relay`, Approve and Decline buttons (#4611); with `rerunUrl`, a button that opens it (#4818). */
|
|
234
|
+
export declare function slackMessage(e: NotifyEvent, relay?: RelayButtons, w?: NotifyMessageOptions): {
|
|
205
235
|
text: string;
|
|
206
236
|
blocks?: unknown[];
|
|
207
237
|
};
|
|
@@ -213,8 +243,8 @@ export declare function slackMessage(e: NotifyEvent, relay?: RelayButtons): {
|
|
|
213
243
|
export declare function slackRelayActions(relay: RelayButtons): Record<string, unknown>;
|
|
214
244
|
/** The Teams reply that approves through the relay's outgoing webhook (#4611): `approve <token>`, after a mention of the relay. */
|
|
215
245
|
export declare function teamsRelayReply(relay: RelayButtons, action?: "approve" | "decline"): string;
|
|
216
|
-
/** A Teams incoming webhook's body (a Workflows webhook): one Adaptive Card, with buttons that open the review page and the run. With `relay`, the reply that approves through the relay (#4611). */
|
|
217
|
-
export declare function teamsMessage(e: NotifyEvent, relay?: RelayButtons): Record<string, unknown>;
|
|
246
|
+
/** A Teams incoming webhook's body (a Workflows webhook): one Adaptive Card, with buttons that open the review page, the re-run page (#4818) and the run. With `relay`, the reply that approves through the relay (#4611), in full when `w.relayName` names it. */
|
|
247
|
+
export declare function teamsMessage(e: NotifyEvent, relay?: RelayButtons, w?: NotifyMessageOptions): Record<string, unknown>;
|
|
218
248
|
/** Where events go. Each value is the NAME of an environment variable; the configuration never holds a URL or a key. */
|
|
219
249
|
export interface NotifyConfig {
|
|
220
250
|
/** The variable holding the generic webhook's URL. */
|
|
@@ -285,6 +315,8 @@ export interface SendNotifyOptions {
|
|
|
285
315
|
slack?: (e: NotifyEvent, relay?: RelayButtons) => unknown;
|
|
286
316
|
teams?: (e: NotifyEvent, relay?: RelayButtons) => unknown;
|
|
287
317
|
};
|
|
318
|
+
/** The product's words and the relay's name for chant's own Slack and Teams bodies (#4818). */
|
|
319
|
+
message?: NotifyMessageOptions;
|
|
288
320
|
/** Seconds since the epoch, for the signature's timestamp. Default: the clock. */
|
|
289
321
|
now?: number;
|
|
290
322
|
}
|
package/dist/notify.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notify.d.ts","sourceRoot":"","sources":["../src/notify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAKH,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,WAAW,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACnI,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE/F,+EAA+E;AAC/E,eAAO,MAAM,aAAa,oBAAoB,CAAC;AAC/C,+BAA+B;AAC/B,eAAO,MAAM,gBAAgB,oEAAoE,CAAC;AAElG;;;;GAIG;AACH,eAAO,MAAM,aAAa,YAAI,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,YA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AO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,kFAAkF;IAClF,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAkCD;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,MAAM,EAAE,YAAY,GAAG,SAAS,EAAE,KAAK,EAAE,WAAW,GAAG,SAAS,EAAE,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CA4C7J"}
|
package/dist/notify.js
CHANGED
|
@@ -109,10 +109,10 @@ export function notifyHeadline(e) {
|
|
|
109
109
|
return `${e.source}: ${what} ${HEADLINE[e.event]}`;
|
|
110
110
|
}
|
|
111
111
|
/** The label and value lines both chat messages show, in order. */
|
|
112
|
-
function facts(e) {
|
|
112
|
+
function facts(e, w) {
|
|
113
113
|
const out = [];
|
|
114
114
|
if (e.approve?.review)
|
|
115
|
-
out.push({ title: "Review and approve", value: `pull request ${e.approve.review.pr}, then run it again`, link: e.approve.review.url });
|
|
115
|
+
out.push({ title: "Review and approve", value: `pull request ${e.approve.review.pr}, then ${w.again ?? "run it again"}`, link: e.approve.review.url });
|
|
116
116
|
if (e.drift) {
|
|
117
117
|
if (e.drift.changed.length > 0)
|
|
118
118
|
out.push({ title: "Drifted", value: e.drift.changed.join(", ") });
|
|
@@ -121,8 +121,8 @@ function facts(e) {
|
|
|
121
121
|
if (e.drift.failed?.length)
|
|
122
122
|
out.push({ title: "Not refreshed", value: e.drift.failed.join(", ") });
|
|
123
123
|
}
|
|
124
|
-
else if (e.targets.length > 0)
|
|
125
|
-
out.push({ title: "Targets", value: e.targets.join(", ") });
|
|
124
|
+
else if (e.targets.length > 0 || w.noTargets)
|
|
125
|
+
out.push({ title: w.targets ?? "Targets", value: e.targets.join(", ") || w.noTargets });
|
|
126
126
|
if (e.ci) {
|
|
127
127
|
out.push({ title: "Commit", value: `${e.ci.commit.slice(0, 12)} on ${e.ci.branch}` });
|
|
128
128
|
if (e.ci.phase)
|
|
@@ -139,7 +139,7 @@ function facts(e) {
|
|
|
139
139
|
if (e.approve)
|
|
140
140
|
out.push({ title: e.approve.review ? "Or approve" : "Approve", value: e.approve.command });
|
|
141
141
|
if (e.reason)
|
|
142
|
-
out.push({ title: "Reason", value: e.reason });
|
|
142
|
+
out.push({ title: w.reason ?? "Reason", value: e.reason });
|
|
143
143
|
if (e.run?.url)
|
|
144
144
|
out.push({ title: "Run", value: e.run.url, link: e.run.url });
|
|
145
145
|
if (e.reportUrl)
|
|
@@ -193,13 +193,14 @@ export function readRelayToken(key, token, options = {}) {
|
|
|
193
193
|
}
|
|
194
194
|
/** How old a relay button may be, in seconds: a day, a gate's default timeout. */
|
|
195
195
|
export const DEFAULT_RELAY_MAX_AGE_SECONDS = 24 * 60 * 60;
|
|
196
|
-
/** A Slack incoming webhook's body: one mrkdwn text, with the approve command as code and the links as links. With `relay`, Approve and Decline buttons (#4611). */
|
|
197
|
-
export function slackMessage(e, relay) {
|
|
196
|
+
/** A Slack incoming webhook's body: one mrkdwn text, with the approve command as code and the links as links. With `relay`, Approve and Decline buttons (#4611); with `rerunUrl`, a button that opens it (#4818). */
|
|
197
|
+
export function slackMessage(e, relay, w = {}) {
|
|
198
198
|
const lines = [`*${notifyHeadline(e)}*`];
|
|
199
|
-
|
|
199
|
+
const r = w.rerun ?? {};
|
|
200
|
+
for (const f of facts(e, w)) {
|
|
200
201
|
if (f.title === "Review and approve")
|
|
201
|
-
lines.push(`${f.title}: <${f.link}
|
|
202
|
-
else if (
|
|
202
|
+
lines.push(`${f.title}: <${f.link}|${f.value.replace(", then", ">, then")}`);
|
|
203
|
+
else if (/^(Or a|A)pprove$|^Digest$/.test(f.title))
|
|
203
204
|
lines.push(`${f.title}: \`${f.value}\``);
|
|
204
205
|
else if (f.link)
|
|
205
206
|
lines.push(`${f.title}: <${f.link}>`);
|
|
@@ -207,9 +208,10 @@ export function slackMessage(e, relay) {
|
|
|
207
208
|
lines.push(`${f.title}: ${f.value}`);
|
|
208
209
|
}
|
|
209
210
|
const text = lines.join("\n");
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
211
|
+
const blocks = relay ? [slackRelayActions(relay)] : [];
|
|
212
|
+
if (e.rerunUrl)
|
|
213
|
+
blocks.push({ type: "actions", block_id: r.block, elements: [{ type: "button", action_id: r.action ?? "chant-rerun", text: { type: "plain_text", text: r.label ?? "Run again" }, url: e.rerunUrl }] });
|
|
214
|
+
return blocks.length ? { text, blocks: [{ type: "section", text: { type: "mrkdwn", text } }, ...blocks] } : { text };
|
|
213
215
|
}
|
|
214
216
|
/**
|
|
215
217
|
* The Slack actions block with the relay's Approve and Decline buttons
|
|
@@ -224,12 +226,19 @@ export function slackRelayActions(relay) {
|
|
|
224
226
|
export function teamsRelayReply(relay, action = "approve") {
|
|
225
227
|
return `${action} ${relay.token}`;
|
|
226
228
|
}
|
|
227
|
-
/** A Teams incoming webhook's body (a Workflows webhook): one Adaptive Card, with buttons that open the review page and the run. With `relay`, the reply that approves through the relay (#4611). */
|
|
228
|
-
export function teamsMessage(e, relay) {
|
|
229
|
-
const
|
|
229
|
+
/** A Teams incoming webhook's body (a Workflows webhook): one Adaptive Card, with buttons that open the review page, the re-run page (#4818) and the run. With `relay`, the reply that approves through the relay (#4611), in full when `w.relayName` names it. */
|
|
230
|
+
export function teamsMessage(e, relay, w = {}) {
|
|
231
|
+
const at = w.relayName && `reply @${w.relayName} `;
|
|
232
|
+
const all = [
|
|
233
|
+
...(w.wave && e.wave ? [{ title: w.wave, value: `${e.wave.number}` }] : []),
|
|
234
|
+
...facts(e, w).filter((f) => w.teamsReport !== false || f.title !== "Report"),
|
|
235
|
+
...(relay && !at ? [{ title: "Approve in chat", value: `mention the relay and reply: ${teamsRelayReply(relay)}` }] : []),
|
|
236
|
+
];
|
|
237
|
+
const open = (title, url) => ({ type: "Action.OpenUrl", title, url });
|
|
230
238
|
const actions = [
|
|
231
|
-
...(e.approve?.review ? [
|
|
232
|
-
...(e.
|
|
239
|
+
...(e.approve?.review ? [open("Review and approve", e.approve.review.url)] : []),
|
|
240
|
+
...(e.rerunUrl ? [open(w.rerun?.label ?? "Run again", e.rerunUrl)] : []),
|
|
241
|
+
...(e.run?.url ? [open("Open the run", e.run.url)] : []),
|
|
233
242
|
];
|
|
234
243
|
return {
|
|
235
244
|
type: "message",
|
|
@@ -244,6 +253,7 @@ export function teamsMessage(e, relay) {
|
|
|
244
253
|
body: [
|
|
245
254
|
{ type: "TextBlock", text: notifyHeadline(e), weight: "Bolder", wrap: true },
|
|
246
255
|
{ type: "FactSet", facts: all.map((f) => ({ title: f.title, value: f.link && f.title === "Review and approve" ? `${f.value}: ${f.link}` : f.value })) },
|
|
256
|
+
...(relay && at ? [{ type: "TextBlock", wrap: true, text: `Approve here: ${at}approve ${relay.token}. Decline: ${at}decline ${relay.token}.` }] : []),
|
|
247
257
|
],
|
|
248
258
|
...(actions.length > 0 ? { actions } : {}),
|
|
249
259
|
},
|
|
@@ -378,7 +388,7 @@ export async function sendNotify(config, event, options = {}) {
|
|
|
378
388
|
const key = config.key ? env[config.key] : undefined;
|
|
379
389
|
if (!key)
|
|
380
390
|
return `${config.key ?? "the key variable"} is not set, and an event is never sent unsigned`;
|
|
381
|
-
return webhookRequest(event, key, {
|
|
391
|
+
return webhookRequest(event, key, { now: options.now, prefix: options.prefix || undefined, userAgent: options.userAgent || undefined });
|
|
382
392
|
});
|
|
383
393
|
}
|
|
384
394
|
// #4611: a waiting event's buttons, when the relay's key is set.
|
|
@@ -388,8 +398,8 @@ export async function sendNotify(config, event, options = {}) {
|
|
|
388
398
|
log(`notify: ${config.relay} is not set, so the message carries no relay buttons`);
|
|
389
399
|
const buttons = ref && relayKey ? { token: relayToken(relayKey, ref) } : undefined;
|
|
390
400
|
if (config.slack)
|
|
391
|
-
await deliver("slack", config.slack, () => json(options.render?.slack ? options.render.slack(event, buttons) : slackMessage(event, buttons)));
|
|
401
|
+
await deliver("slack", config.slack, () => json(options.render?.slack ? options.render.slack(event, buttons) : slackMessage(event, buttons, options.message)));
|
|
392
402
|
if (config.teams)
|
|
393
|
-
await deliver("teams", config.teams, () => json(options.render?.teams ? options.render.teams(event, buttons) : teamsMessage(event, buttons)));
|
|
403
|
+
await deliver("teams", config.teams, () => json(options.render?.teams ? options.render.teams(event, buttons) : teamsMessage(event, buttons, options.message)));
|
|
394
404
|
return out;
|
|
395
405
|
}
|
package/dist/notify.schema.json
CHANGED
|
@@ -89,6 +89,7 @@
|
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
91
|
"reportUrl": { "type": "string" },
|
|
92
|
+
"rerunUrl": { "type": "string", "description": "On drift (#4818): the page where a person runs the check again, which the Slack and Teams messages open from a button." },
|
|
92
93
|
"detail": { "type": "object", "description": "The product's own record of the outcome, carried whole (terragucci.outcome/v1)." }
|
|
93
94
|
},
|
|
94
95
|
"allOf": [
|