@intentius/chant 0.124.70 → 0.124.72
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/ci-agent.d.ts +12 -1
- package/dist/ci-agent.d.ts.map +1 -1
- package/dist/ci-agent.js +13 -8
- package/dist/ci-commit.d.ts +326 -0
- package/dist/ci-commit.d.ts.map +1 -0
- package/dist/ci-commit.js +725 -0
- package/dist/ci-estate/delivery.d.ts +75 -2
- package/dist/ci-estate/delivery.d.ts.map +1 -1
- package/dist/ci-estate/delivery.js +129 -0
- package/dist/ci-estate.d.ts +3 -1
- package/dist/ci-estate.d.ts.map +1 -1
- package/dist/ci-estate.js +4 -1
- package/dist/ci-product-words.d.ts +6 -1
- package/dist/ci-product-words.d.ts.map +1 -1
- package/dist/ci-product-words.js +3 -1
- package/dist/ci-product.d.ts +1 -1
- package/dist/ci-product.d.ts.map +1 -1
- package/dist/ci-product.js +1 -1
- package/dist/cli/handlers/approve.d.ts.map +1 -1
- package/dist/cli/handlers/approve.js +7 -2
- package/dist/cli/handlers/commit.d.ts +26 -0
- package/dist/cli/handlers/commit.d.ts.map +1 -0
- package/dist/cli/handlers/commit.js +145 -0
- package/dist/cli/handlers/notify-relay.d.ts.map +1 -1
- package/dist/cli/handlers/notify-relay.js +22 -2
- package/dist/cli/handlers/pr.d.ts +6 -0
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +16 -7
- package/dist/cli/handlers/release.d.ts +9 -0
- package/dist/cli/handlers/release.d.ts.map +1 -1
- package/dist/cli/handlers/release.js +114 -5
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +17 -0
- package/dist/components/product-pipeline.d.ts +33 -0
- package/dist/components/product-pipeline.d.ts.map +1 -1
- package/dist/components/product-pipeline.js +34 -1
- package/dist/components/release-compile.d.ts +2 -0
- package/dist/components/release-compile.d.ts.map +1 -1
- package/dist/components/release-compile.js +8 -4
- package/dist/config.d.ts +60 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +16 -0
- package/dist/lexicon.d.ts +54 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lexicon.js +28 -0
- package/dist/lifecycle/__fixtures__/publish-fakes.d.ts +4 -0
- package/dist/lifecycle/__fixtures__/publish-fakes.d.ts.map +1 -1
- package/dist/lifecycle/__fixtures__/publish-fakes.js +6 -2
- package/dist/lifecycle/gated-request.d.ts +3 -1
- package/dist/lifecycle/gated-request.d.ts.map +1 -1
- package/dist/lifecycle/gated-request.js +5 -2
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/git.js +57 -0
- package/dist/lifecycle/publish-declaration.d.ts +16 -0
- package/dist/lifecycle/publish-declaration.d.ts.map +1 -1
- package/dist/lifecycle/publish-declaration.js +35 -3
- package/dist/lifecycle/publish-forge.d.ts +12 -0
- package/dist/lifecycle/publish-forge.d.ts.map +1 -1
- package/dist/lifecycle/publish-forge.js +102 -19
- package/dist/lifecycle/publish-npm.d.ts +15 -0
- package/dist/lifecycle/publish-npm.d.ts.map +1 -1
- package/dist/lifecycle/publish-npm.js +28 -1
- package/dist/lifecycle/publish-oci.d.ts +2 -0
- package/dist/lifecycle/publish-oci.d.ts.map +1 -1
- package/dist/lifecycle/publish-oci.js +10 -0
- package/dist/lifecycle/release-cut.d.ts +7 -1
- package/dist/lifecycle/release-cut.d.ts.map +1 -1
- package/dist/lifecycle/release-cut.js +8 -1
- package/dist/lifecycle/release-images.d.ts +87 -0
- package/dist/lifecycle/release-images.d.ts.map +1 -0
- package/dist/lifecycle/release-images.js +138 -0
- package/dist/lifecycle/release-publish.d.ts +2 -0
- package/dist/lifecycle/release-publish.d.ts.map +1 -1
- package/dist/notify-relay.d.ts +41 -1
- package/dist/notify-relay.d.ts.map +1 -1
- package/dist/notify-relay.js +40 -0
- package/dist/notify.d.ts +16 -3
- package/dist/notify.d.ts.map +1 -1
- package/dist/notify.js +16 -10
- package/dist/op/activities/review-agent.d.ts.map +1 -1
- package/dist/op/activities/review-agent.js +4 -2
- package/dist/op/gate.d.ts +5 -1
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/op/gate.js +7 -2
- package/dist/op/op-waves-notify.d.ts +1 -1
- package/dist/op/op-waves-notify.d.ts.map +1 -1
- package/dist/op/op-waves-notify.js +2 -1
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +12 -8
- package/dist/op/op-waves.d.ts +9 -0
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +11 -0
- package/dist/pr-forge-base.d.ts +18 -0
- package/dist/pr-forge-base.d.ts.map +1 -0
- package/dist/pr-forge-base.js +29 -0
- package/dist/release-floors.d.ts +1 -1
- package/dist/release-floors.js +1 -1
- package/dist/wave-runtime.mjs +315 -315
- package/dist/workspace/ci-green.d.ts.map +1 -1
- package/dist/workspace/ci-green.js +1 -2
- package/dist/workspace/release-workflow.d.ts +47 -0
- package/dist/workspace/release-workflow.d.ts.map +1 -1
- package/dist/workspace/release-workflow.js +258 -14
- package/package.json +1 -1
- package/src/ci-agent.ts +13 -8
- package/src/ci-commit.test.ts +415 -0
- package/src/ci-commit.ts +901 -0
- package/src/ci-estate/__fixtures__/terragucci-dora.json +1305 -0
- package/src/ci-estate/delivery.ts +186 -2
- package/src/ci-estate/records-delivery.test.ts +55 -0
- package/src/ci-estate.ts +10 -0
- package/src/ci-product-words.ts +6 -2
- package/src/ci-product.ts +1 -0
- package/src/cli/handlers/approve.ts +6 -2
- package/src/cli/handlers/commit.ts +155 -0
- package/src/cli/handlers/notify-relay.ts +21 -2
- package/src/cli/handlers/operator.test.ts +2 -0
- package/src/cli/handlers/pr-wave-approve-lines.test.ts +32 -0
- package/src/cli/handlers/pr.ts +17 -7
- package/src/cli/handlers/release.ts +110 -5
- package/src/cli/main.ts +17 -0
- package/src/components/product-pipeline.test.ts +28 -1
- package/src/components/product-pipeline.ts +54 -1
- package/src/components/release-compile.ts +9 -3
- package/src/config.ts +31 -0
- package/src/lexicon.ts +72 -0
- package/src/lifecycle/__fixtures__/publish-fakes.ts +11 -5
- package/src/lifecycle/gated-request-spend.test.ts +115 -0
- package/src/lifecycle/gated-request.ts +5 -2
- package/src/lifecycle/git.ts +53 -0
- package/src/lifecycle/ledger-two-clones.test.ts +132 -0
- package/src/lifecycle/publish-declaration.ts +35 -3
- package/src/lifecycle/publish-forge-notes.test.ts +193 -0
- package/src/lifecycle/publish-forge.ts +100 -22
- package/src/lifecycle/publish-npm.ts +31 -2
- package/src/lifecycle/publish-oci.ts +10 -0
- package/src/lifecycle/publish-targets.test.ts +2 -1
- package/src/lifecycle/release-cut.ts +17 -1
- package/src/lifecycle/release-images.test.ts +242 -0
- package/src/lifecycle/release-images.ts +174 -0
- package/src/lifecycle/release-publish.ts +2 -0
- package/src/notify-relay.test.ts +55 -1
- package/src/notify-relay.ts +49 -1
- package/src/notify.ts +25 -12
- package/src/op/activities/review-agent.test.ts +20 -1
- package/src/op/activities/review-agent.ts +5 -2
- package/src/op/gate.ts +7 -2
- package/src/op/op-waves-approve-target.test.ts +108 -0
- package/src/op/op-waves-notify.ts +2 -2
- package/src/op/op-waves-run.ts +12 -7
- package/src/op/op-waves.ts +12 -0
- package/src/pr-forge-base.test.ts +37 -0
- package/src/pr-forge-base.ts +36 -0
- package/src/release-floors.ts +1 -1
- package/src/workspace/__fixtures__/release-workflow/forgejo-plain-member.yml +26 -0
- package/src/workspace/__fixtures__/release-workflow/forgejo-plain.yml +23 -0
- package/src/workspace/__fixtures__/release-workflow/forgejo-secure-member.yml +27 -0
- package/src/workspace/__fixtures__/release-workflow/forgejo-secure.yml +24 -0
- package/src/workspace/__fixtures__/release-workflow/github-plain-member.yml +26 -0
- package/src/workspace/__fixtures__/release-workflow/github-plain.yml +23 -0
- package/src/workspace/__fixtures__/release-workflow/github-secure-member.yml +27 -0
- package/src/workspace/__fixtures__/release-workflow/github-secure.yml +24 -0
- package/src/workspace/__fixtures__/release-workflow/gitlab-plain-member.yml +13 -0
- package/src/workspace/__fixtures__/release-workflow/gitlab-plain.yml +12 -0
- package/src/workspace/__fixtures__/release-workflow/gitlab-secure-member.yml +14 -0
- package/src/workspace/__fixtures__/release-workflow/gitlab-secure.yml +13 -0
- package/src/workspace/ci-green.ts +1 -2
- package/src/workspace/release-workflow.test.ts +199 -0
- package/src/workspace/release-workflow.ts +356 -14
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Images a release builds in its cut, and the digests its package pins
|
|
3
|
+
* (#4657, option 1).
|
|
4
|
+
*
|
|
5
|
+
* A package that pins container images by digest needs those digests when it
|
|
6
|
+
* is packed, and they exist only once the images are built. So the cut builds
|
|
7
|
+
* each image `release.images` declares first, as an OCI archive, and records
|
|
8
|
+
* the archive's digest in the release as an image artifact. It writes the
|
|
9
|
+
* digests to a file, `{ "<name>": "sha256:..." }`, and runs the build that
|
|
10
|
+
* packs the package with {@link RELEASE_DIGESTS_ENV} naming that file. The
|
|
11
|
+
* digest of an OCI archive is the digest of its top manifest, which is the
|
|
12
|
+
* digest a registry serves once the archive is pushed by the `oci` target.
|
|
13
|
+
*
|
|
14
|
+
* The publish job builds the images again from the release's commit
|
|
15
|
+
* (`chant release images`), with `SOURCE_DATE_EPOCH` set to the commit's
|
|
16
|
+
* time as in the cut, and refuses an archive whose digest is not the one the
|
|
17
|
+
* release records, so what is pushed is what the package pins. An image build
|
|
18
|
+
* that writes the same archive twice is the requirement (#4657's thread has
|
|
19
|
+
* the check against terragucci's Dockerfiles).
|
|
20
|
+
*
|
|
21
|
+
* An npm target's `pins` names the file in a package that carries the
|
|
22
|
+
* digests. The publish plan and `chant release verify` read it and refuse a
|
|
23
|
+
* digest the release does not record as an image.
|
|
24
|
+
*/
|
|
25
|
+
import type { PublishDeclaration } from "./publish-declaration.js";
|
|
26
|
+
import type { Release, ReleaseArtifact } from "./release-store.js";
|
|
27
|
+
/** The variable that names the digests file a release's package build reads. */
|
|
28
|
+
export declare const RELEASE_DIGESTS_ENV = "CHANT_RELEASE_DIGESTS";
|
|
29
|
+
/** The first chant with `release.images`, `CHANT_RELEASE_DIGESTS`, `chant release images` and an npm target's `pins` (#4657). Products feature-detect on it. */
|
|
30
|
+
export declare const RELEASE_IMAGES_FLOOR = "0.124.71";
|
|
31
|
+
/** One image a release builds in its cut. */
|
|
32
|
+
export interface ReleaseImageDeclaration {
|
|
33
|
+
/** The image's name: its key in the digests file, and its artifact's `component` in the release. */
|
|
34
|
+
name: string;
|
|
35
|
+
/** The shell command, run in the member's directory, that writes the archive. */
|
|
36
|
+
build: string;
|
|
37
|
+
/** The OCI archive the command writes, a layout directory or a tar file, relative to the member. The `oci` target's `image`. */
|
|
38
|
+
archive: string;
|
|
39
|
+
}
|
|
40
|
+
export declare class ReleaseImageError extends Error {
|
|
41
|
+
readonly code: string;
|
|
42
|
+
readonly fix?: string | undefined;
|
|
43
|
+
constructor(code: string, message: string, fix?: string | undefined);
|
|
44
|
+
}
|
|
45
|
+
/** Check a member's `release.images`: names valid and unique, archives inside the member. */
|
|
46
|
+
export declare function checkReleaseImages(images: readonly ReleaseImageDeclaration[]): void;
|
|
47
|
+
/** The digest of an OCI archive: its top manifest's, as `index.json` names it. */
|
|
48
|
+
export type ArchiveDigest = (abs: string) => string;
|
|
49
|
+
export interface BuildImagesInput {
|
|
50
|
+
images: readonly ReleaseImageDeclaration[];
|
|
51
|
+
/** The member's directory. */
|
|
52
|
+
cwd: string;
|
|
53
|
+
/** The commit's time in seconds, passed to each build as `SOURCE_DATE_EPOCH`. */
|
|
54
|
+
sourceDateEpoch: number;
|
|
55
|
+
label: string | null;
|
|
56
|
+
env?: NodeJS.ProcessEnv;
|
|
57
|
+
archiveDigest: ArchiveDigest;
|
|
58
|
+
/** Run one build command; the default runs it through the shell with its output on stderr. */
|
|
59
|
+
run?: (command: string, o: {
|
|
60
|
+
cwd: string;
|
|
61
|
+
env: NodeJS.ProcessEnv;
|
|
62
|
+
}) => number | null;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Build each image and return it as the release's image artifact. The
|
|
66
|
+
* command runs with `SOURCE_DATE_EPOCH` and, for a cut with a label,
|
|
67
|
+
* `CHANT_RELEASE_LABEL`; an archive it did not write, or a command that
|
|
68
|
+
* fails, stops the cut.
|
|
69
|
+
*/
|
|
70
|
+
export declare function buildReleaseImages(i: BuildImagesInput): ReleaseArtifact[];
|
|
71
|
+
/** The release's built images by name: every image artifact with a path, which a handed image (#4694) has not. */
|
|
72
|
+
export declare function releaseImageDigests(release: Pick<Release, "artifactDigests">, names?: readonly string[]): Record<string, string>;
|
|
73
|
+
/** Write the digests file a package build reads. */
|
|
74
|
+
export declare function writeReleaseDigests(file: string, digests: Record<string, string>): void;
|
|
75
|
+
/** Every `sha256:` digest in a pins file's text. */
|
|
76
|
+
export declare function pinnedDigests(text: string): string[];
|
|
77
|
+
/** The digests in `text` that the release does not record as an image. */
|
|
78
|
+
export declare function unknownPins(text: string, release: Pick<Release, "artifactDigests">): string[];
|
|
79
|
+
/** A pins file read from a package directory or a packed `.tgz`, or null when the package has none. */
|
|
80
|
+
export declare function readPins(abs: string, pins: string, isDirectory: boolean): string | null;
|
|
81
|
+
/**
|
|
82
|
+
* For `chant release verify` (#4657): the first package an npm target's
|
|
83
|
+
* `pins` finds holding an image digest the release does not record, said in
|
|
84
|
+
* a sentence, or null. A package not built here is not read.
|
|
85
|
+
*/
|
|
86
|
+
export declare function packagePinProblem(cwd: string, release: Pick<Release, "artifactDigests">, targets: readonly PublishDeclaration[]): string | null;
|
|
87
|
+
//# sourceMappingURL=release-images.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release-images.d.ts","sourceRoot":"","sources":["../../src/lifecycle/release-images.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAKH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,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BAAkB,CAAC,CAAC,EAAE,gBAAgB,GAAG,eAAe,EAAE,CAezE;AAED,kHAAkH;AAClH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,iBAAiB,CAAC,EAAE,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQhI;AAED,oDAAoD;AACpD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAIvF;AAID,oDAAoD;AACpD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAEpD;AAED,0EAA0E;AAC1E,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,iBAAiB,CAAC,GAAG,MAAM,EAAE,CAG7F;AAED,uGAAuG;AACvG,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAOvF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,iBAAiB,CAAC,EAAE,OAAO,EAAE,SAAS,kBAAkB,EAAE,GAAG,MAAM,GAAG,IAAI,CAY/I"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Images a release builds in its cut, and the digests its package pins
|
|
3
|
+
* (#4657, option 1).
|
|
4
|
+
*
|
|
5
|
+
* A package that pins container images by digest needs those digests when it
|
|
6
|
+
* is packed, and they exist only once the images are built. So the cut builds
|
|
7
|
+
* each image `release.images` declares first, as an OCI archive, and records
|
|
8
|
+
* the archive's digest in the release as an image artifact. It writes the
|
|
9
|
+
* digests to a file, `{ "<name>": "sha256:..." }`, and runs the build that
|
|
10
|
+
* packs the package with {@link RELEASE_DIGESTS_ENV} naming that file. The
|
|
11
|
+
* digest of an OCI archive is the digest of its top manifest, which is the
|
|
12
|
+
* digest a registry serves once the archive is pushed by the `oci` target.
|
|
13
|
+
*
|
|
14
|
+
* The publish job builds the images again from the release's commit
|
|
15
|
+
* (`chant release images`), with `SOURCE_DATE_EPOCH` set to the commit's
|
|
16
|
+
* time as in the cut, and refuses an archive whose digest is not the one the
|
|
17
|
+
* release records, so what is pushed is what the package pins. An image build
|
|
18
|
+
* that writes the same archive twice is the requirement (#4657's thread has
|
|
19
|
+
* the check against terragucci's Dockerfiles).
|
|
20
|
+
*
|
|
21
|
+
* An npm target's `pins` names the file in a package that carries the
|
|
22
|
+
* digests. The publish plan and `chant release verify` read it and refuse a
|
|
23
|
+
* digest the release does not record as an image.
|
|
24
|
+
*/
|
|
25
|
+
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";
|
|
28
|
+
/** The variable that names the digests file a release's package build reads. */
|
|
29
|
+
export const RELEASE_DIGESTS_ENV = "CHANT_RELEASE_DIGESTS";
|
|
30
|
+
/** 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
|
+
export const RELEASE_IMAGES_FLOOR = "0.124.71";
|
|
32
|
+
export class ReleaseImageError extends Error {
|
|
33
|
+
constructor(code, message, fix) {
|
|
34
|
+
super(message);
|
|
35
|
+
this.code = code;
|
|
36
|
+
this.fix = fix;
|
|
37
|
+
this.name = "ReleaseImageError";
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const NAME = /^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$/;
|
|
41
|
+
/** Check a member's `release.images`: names valid and unique, archives inside the member. */
|
|
42
|
+
export function checkReleaseImages(images) {
|
|
43
|
+
const seen = new Set();
|
|
44
|
+
for (const i of images) {
|
|
45
|
+
if (!NAME.test(i.name))
|
|
46
|
+
throw new ReleaseImageError("release-image-name-invalid", `release.images: "${i.name}" is not a name of letters, digits, ".", "_" and "-"`);
|
|
47
|
+
if (seen.has(i.name))
|
|
48
|
+
throw new ReleaseImageError("release-image-name-taken", `release.images names "${i.name}" twice`);
|
|
49
|
+
seen.add(i.name);
|
|
50
|
+
if (isAbsolute(i.archive) || i.archive.split(/[\\/]/).includes("..")) {
|
|
51
|
+
throw new ReleaseImageError("release-image-archive-outside", `release.images "${i.name}": the archive ${i.archive} is not a path inside the member`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const defaultRun = (command, o) => spawnSync(command, { cwd: o.cwd, env: o.env, shell: true, stdio: ["ignore", 2, 2] }).status;
|
|
56
|
+
/**
|
|
57
|
+
* Build each image and return it as the release's image artifact. The
|
|
58
|
+
* command runs with `SOURCE_DATE_EPOCH` and, for a cut with a label,
|
|
59
|
+
* `CHANT_RELEASE_LABEL`; an archive it did not write, or a command that
|
|
60
|
+
* fails, stops the cut.
|
|
61
|
+
*/
|
|
62
|
+
export function buildReleaseImages(i) {
|
|
63
|
+
checkReleaseImages(i.images);
|
|
64
|
+
const run = i.run ?? defaultRun;
|
|
65
|
+
const out = [];
|
|
66
|
+
for (const image of i.images) {
|
|
67
|
+
const env = { ...(i.env ?? process.env), SOURCE_DATE_EPOCH: String(i.sourceDateEpoch) };
|
|
68
|
+
delete env.CHANT_RELEASE_LABEL;
|
|
69
|
+
if (i.label !== null)
|
|
70
|
+
env.CHANT_RELEASE_LABEL = i.label;
|
|
71
|
+
const status = run(image.build, { cwd: i.cwd, env });
|
|
72
|
+
if (status !== 0)
|
|
73
|
+
throw new ReleaseImageError("release-image-build-failed", `the build of image "${image.name}" exited ${status ?? "with a signal"}: ${image.build}`);
|
|
74
|
+
const abs = resolve(i.cwd, image.archive);
|
|
75
|
+
if (!existsSync(abs))
|
|
76
|
+
throw new ReleaseImageError("release-image-no-archive", `the build of image "${image.name}" wrote no ${image.archive}`, "Make the command write the OCI archive at archive, such as docker buildx build --output type=oci,dest=<archive>,rewrite-timestamp=true.");
|
|
77
|
+
out.push({ component: image.name, kind: "image", path: relative(i.cwd, abs).split("\\").join("/"), digest: i.archiveDigest(abs) });
|
|
78
|
+
}
|
|
79
|
+
return out;
|
|
80
|
+
}
|
|
81
|
+
/** The release's built images by name: every image artifact with a path, which a handed image (#4694) has not. */
|
|
82
|
+
export function releaseImageDigests(release, names) {
|
|
83
|
+
const out = {};
|
|
84
|
+
for (const a of release.artifactDigests) {
|
|
85
|
+
if (a.kind !== "image")
|
|
86
|
+
continue;
|
|
87
|
+
if (names && !names.includes(a.component))
|
|
88
|
+
continue;
|
|
89
|
+
out[a.component] = a.digest;
|
|
90
|
+
}
|
|
91
|
+
return out;
|
|
92
|
+
}
|
|
93
|
+
/** Write the digests file a package build reads. */
|
|
94
|
+
export function writeReleaseDigests(file, digests) {
|
|
95
|
+
mkdirSync(dirname(file), { recursive: true });
|
|
96
|
+
const sorted = Object.fromEntries(Object.entries(digests).sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0)));
|
|
97
|
+
writeFileSync(file, `${JSON.stringify(sorted, null, 2)}\n`);
|
|
98
|
+
}
|
|
99
|
+
const DIGEST = /sha256:[0-9a-f]{64}/g;
|
|
100
|
+
/** Every `sha256:` digest in a pins file's text. */
|
|
101
|
+
export function pinnedDigests(text) {
|
|
102
|
+
return [...new Set(text.match(DIGEST) ?? [])];
|
|
103
|
+
}
|
|
104
|
+
/** The digests in `text` that the release does not record as an image. */
|
|
105
|
+
export function unknownPins(text, release) {
|
|
106
|
+
const known = new Set(release.artifactDigests.filter((a) => a.kind === "image").map((a) => a.digest));
|
|
107
|
+
return pinnedDigests(text).filter((d) => !known.has(d));
|
|
108
|
+
}
|
|
109
|
+
/** A pins file read from a package directory or a packed `.tgz`, or null when the package has none. */
|
|
110
|
+
export function readPins(abs, pins, isDirectory) {
|
|
111
|
+
if (isDirectory) {
|
|
112
|
+
const file = resolve(abs, pins);
|
|
113
|
+
return existsSync(file) ? readFileSync(file, "utf-8") : null;
|
|
114
|
+
}
|
|
115
|
+
const run = spawnSync("tar", ["-xzOf", abs, `package/${pins.replace(/^\.\//, "")}`], { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] });
|
|
116
|
+
return run.status === 0 ? run.stdout : null;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* For `chant release verify` (#4657): the first package an npm target's
|
|
120
|
+
* `pins` finds holding an image digest the release does not record, said in
|
|
121
|
+
* a sentence, or null. A package not built here is not read.
|
|
122
|
+
*/
|
|
123
|
+
export function packagePinProblem(cwd, release, targets) {
|
|
124
|
+
for (const t of targets) {
|
|
125
|
+
if (t.type !== "npm" || !t.pins)
|
|
126
|
+
continue;
|
|
127
|
+
for (const p of t.packages) {
|
|
128
|
+
const abs = resolve(cwd, p);
|
|
129
|
+
if (!existsSync(abs))
|
|
130
|
+
continue;
|
|
131
|
+
const text = readPins(abs, t.pins, statSync(abs).isDirectory());
|
|
132
|
+
const unknown = text === null ? [] : unknownPins(text, release);
|
|
133
|
+
if (unknown.length > 0)
|
|
134
|
+
return `${p} pins ${unknown.join(", ")} in ${t.pins}, which the release does not record as an image`;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
@@ -73,6 +73,8 @@ export interface PublishItem {
|
|
|
73
73
|
attachment?: "sbom" | "provenance";
|
|
74
74
|
/** The SBOM file an npm package carries at its root (#4049). */
|
|
75
75
|
sbom?: string;
|
|
76
|
+
/** The notes a forge release is given (#4658), which a dry run prints. */
|
|
77
|
+
notes?: string;
|
|
76
78
|
}
|
|
77
79
|
/** The cut a publish carries the signature of (#4049): the cut whose signature verified, else the newest. */
|
|
78
80
|
export interface PublishCut {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-publish.d.ts","sourceRoot":"","sources":["../../src/lifecycle/release-publish.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtE,0FAA0F;AAC1F,MAAM,WAAW,eAAe;IAC9B,6EAA6E;IAC7E,IAAI,EAAE,OAAO,CAAC;IACd,sDAAsD;IACtD,EAAE,EAAE,QAAQ,GAAG,QAAQ,GAAG,IAAI,CAAC;IAC/B,sCAAsC;IACtC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,eAAe,CAYtF;AAED,mEAAmE;AACnE,MAAM,WAAW,WAAW;IAC1B,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAC;IACb,qFAAqF;IACrF,WAAW,EAAE,MAAM,CAAC;IACpB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gKAAgK;IAChK,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kHAAkH;IAClH,UAAU,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IACnC,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"release-publish.d.ts","sourceRoot":"","sources":["../../src/lifecycle/release-publish.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtE,0FAA0F;AAC1F,MAAM,WAAW,eAAe;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W,UAAU;IACzB,oDAAoD;IACpD,SAAS,EAAE,eAAe,EAAE,CAAC;IAC7B,+FAA+F;IAC/F,OAAO,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,QAAQ,GAAG,UAAU,CAAA;KAAE,CAAC,CAAC;IAChE,2GAA2G;IAC3G,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,0GAA0G;AAC1G,qBAAa,eAAgB,SAAQ,kBAAkB;IAKnD,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,QAAQ;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE;IAN7B,YACE,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,GAAG,SAAS,EACd,IAAI,EAAE,OAAO,GAAG,QAAQ,EACxB,MAAM,EAAE,MAAM,EAAE,EAChB,QAAQ,EAAE,MAAM,EAAE,EAI5B;CACF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,UAAU,CAAC,GAAG,EAAE;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,SAAS,aAAa,EAAE,CAAC;IAClC,GAAG,EAAE,cAAc,CAAC;IACpB,sCAAsC;IACtC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,0DAA0D;IAC1D,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAClB,GAAG,OAAO,CAAC,UAAU,CAAC,CAsFtB"}
|
package/dist/notify-relay.d.ts
CHANGED
|
@@ -25,6 +25,17 @@
|
|
|
25
25
|
* command applies: the decision point, `identity.gates` (the relay holds
|
|
26
26
|
* no key, so a sealed gate is refused), the gate policy and the push.
|
|
27
27
|
*
|
|
28
|
+
* A gate that asks a decision point (#3170) passes on the point's answer,
|
|
29
|
+
* not an approval. There the relay answers the question the gate waits on
|
|
30
|
+
* instead, as `chant workspace points answer <id> --answer <yes> --by
|
|
31
|
+
* <principal> --relayed-by <relay>` does, when the gate passes on one answer
|
|
32
|
+
* (a yes, or the one value its `pass` names). The point's quorum decides
|
|
33
|
+
* whether that principal counts. A gate that passes on several answers names
|
|
34
|
+
* no one answer for a button, and is refused.
|
|
35
|
+
*
|
|
36
|
+
* A product that renders its own chat messages gets the signed buttons from
|
|
37
|
+
* `sendNotify`'s `render` (`./notify.ts`), so its clicks reach this relay too.
|
|
38
|
+
*
|
|
28
39
|
* Decline records nothing and says who declined. The type-the-name prompt
|
|
29
40
|
* of `chant approve` (#4575) is for a terminal; a signed click is the
|
|
30
41
|
* person's confirmation here. The relay starts no job: the resume job
|
|
@@ -33,6 +44,13 @@
|
|
|
33
44
|
import { type Server } from "node:http";
|
|
34
45
|
import type { CiProductWords } from "./ci-product-words.js";
|
|
35
46
|
import type { GatedRequest } from "./lifecycle/gated-request-digest.js";
|
|
47
|
+
/**
|
|
48
|
+
* The first chant whose relay answers a gate's decision point and whose
|
|
49
|
+
* `sendNotify` hands a product's own render the signed buttons
|
|
50
|
+
* (`slackRelayActions`, `teamsRelayReply`), so a product can drop a relay of
|
|
51
|
+
* its own (#4611). Products feature-detect on it.
|
|
52
|
+
*/
|
|
53
|
+
export declare const NOTIFY_RELAY_POINTS_FLOOR = "0.124.72";
|
|
36
54
|
/** The relay's settings, by environment variable. */
|
|
37
55
|
export declare const RELAY_ENV: {
|
|
38
56
|
/** The key the notify buttons are signed with: the variable `notify.relay` names on the sending side. */
|
|
@@ -100,6 +118,12 @@ export interface RelayPending {
|
|
|
100
118
|
environment?: string;
|
|
101
119
|
/** On a gated request (#4551): the request, whose requester may not approve it. */
|
|
102
120
|
request?: GatedRequest;
|
|
121
|
+
/** When the gate asks a decision point: the open question it waits on, and the answers that pass it (absent: a yes). */
|
|
122
|
+
question?: {
|
|
123
|
+
point: string;
|
|
124
|
+
id: string;
|
|
125
|
+
pass?: Array<string | boolean>;
|
|
126
|
+
};
|
|
103
127
|
}
|
|
104
128
|
/** What the relay reads and writes, so a test stands in for the repo. */
|
|
105
129
|
export interface RelayDeps {
|
|
@@ -127,6 +151,22 @@ export interface RelayDeps {
|
|
|
127
151
|
ok: false;
|
|
128
152
|
error: string;
|
|
129
153
|
}>;
|
|
154
|
+
/**
|
|
155
|
+
* Answer a decision point's question as `chant workspace points answer`
|
|
156
|
+
* does, relayed by the relay (#4611). Absent: a gate that asks a decision
|
|
157
|
+
* point is refused.
|
|
158
|
+
*/
|
|
159
|
+
answer?(input: {
|
|
160
|
+
id: string;
|
|
161
|
+
answer: string | boolean;
|
|
162
|
+
by: string;
|
|
163
|
+
relayedBy: string;
|
|
164
|
+
}): Promise<{
|
|
165
|
+
ok: true;
|
|
166
|
+
} | {
|
|
167
|
+
ok: false;
|
|
168
|
+
error: string;
|
|
169
|
+
}>;
|
|
130
170
|
/** Who the relay records as `relayedBy`. */
|
|
131
171
|
principal: string;
|
|
132
172
|
words: CiProductWords;
|
|
@@ -144,7 +184,7 @@ export interface RelaySettings {
|
|
|
144
184
|
export interface RelayAnswer {
|
|
145
185
|
ok: boolean;
|
|
146
186
|
/** What the relay did: `approved`, `declined`, or the refusal's kind. */
|
|
147
|
-
outcome: "approved" | "declined" | "bad-reference" | "stale" | "ineligible" | "moved" | "refused";
|
|
187
|
+
outcome: "approved" | "answered" | "declined" | "bad-reference" | "stale" | "ineligible" | "moved" | "refused";
|
|
148
188
|
text: string;
|
|
149
189
|
/** The gate's op, when the click reached one. */
|
|
150
190
|
op?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notify-relay.d.ts","sourceRoot":"","sources":["../src/notify-relay.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"notify-relay.d.ts","sourceRoot":"","sources":["../src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OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,KAAK,OAAO,CAAC;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAK5J;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,YAAY,EACjB,QAAQ,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
|
@@ -25,6 +25,17 @@
|
|
|
25
25
|
* command applies: the decision point, `identity.gates` (the relay holds
|
|
26
26
|
* no key, so a sealed gate is refused), the gate policy and the push.
|
|
27
27
|
*
|
|
28
|
+
* A gate that asks a decision point (#3170) passes on the point's answer,
|
|
29
|
+
* not an approval. There the relay answers the question the gate waits on
|
|
30
|
+
* instead, as `chant workspace points answer <id> --answer <yes> --by
|
|
31
|
+
* <principal> --relayed-by <relay>` does, when the gate passes on one answer
|
|
32
|
+
* (a yes, or the one value its `pass` names). The point's quorum decides
|
|
33
|
+
* whether that principal counts. A gate that passes on several answers names
|
|
34
|
+
* no one answer for a button, and is refused.
|
|
35
|
+
*
|
|
36
|
+
* A product that renders its own chat messages gets the signed buttons from
|
|
37
|
+
* `sendNotify`'s `render` (`./notify.ts`), so its clicks reach this relay too.
|
|
38
|
+
*
|
|
28
39
|
* Decline records nothing and says who declined. The type-the-name prompt
|
|
29
40
|
* of `chant approve` (#4575) is for a terminal; a signed click is the
|
|
30
41
|
* person's confirmation here. The relay starts no job: the resume job
|
|
@@ -33,6 +44,14 @@
|
|
|
33
44
|
import { createHmac, timingSafeEqual } from "node:crypto";
|
|
34
45
|
import { createServer } from "node:http";
|
|
35
46
|
import { readRelayToken, RELAY_APPROVE_ACTION, RELAY_DECLINE_ACTION } from "./notify.js";
|
|
47
|
+
import { NEXT_RELEASE } from "./release-floors.js";
|
|
48
|
+
/**
|
|
49
|
+
* The first chant whose relay answers a gate's decision point and whose
|
|
50
|
+
* `sendNotify` hands a product's own render the signed buttons
|
|
51
|
+
* (`slackRelayActions`, `teamsRelayReply`), so a product can drop a relay of
|
|
52
|
+
* its own (#4611). Products feature-detect on it.
|
|
53
|
+
*/
|
|
54
|
+
export const NOTIFY_RELAY_POINTS_FLOOR = NEXT_RELEASE;
|
|
36
55
|
/** The relay's settings, by environment variable. */
|
|
37
56
|
export const RELAY_ENV = {
|
|
38
57
|
/** The key the notify buttons are signed with: the variable `notify.relay` names on the sending side. */
|
|
@@ -197,6 +216,27 @@ export async function decideRelayClick(click, settings, deps) {
|
|
|
197
216
|
if (pending.request && norm(pending.request.by) === norm(principal)) {
|
|
198
217
|
return { ok: false, outcome: "ineligible", op: pending.op, gate: pending.gate, principal, text: `Refused: ${principal} made the request, and a requester's own approval does not count. Someone else approves it.` };
|
|
199
218
|
}
|
|
219
|
+
if (pending.question) {
|
|
220
|
+
const q = pending.question;
|
|
221
|
+
if (!deps.answer) {
|
|
222
|
+
return { ok: false, outcome: "refused", op: pending.op, gate: pending.gate, principal, text: `Not approved: ${pending.gate} asks decision point ${q.point}, so its answer passes the gate, not an approval. Answer question ${q.id} at a shell.` };
|
|
223
|
+
}
|
|
224
|
+
if (q.pass && q.pass.length !== 1) {
|
|
225
|
+
return { ok: false, outcome: "refused", op: pending.op, gate: pending.gate, principal, text: `Not approved: ${pending.gate} asks decision point ${q.point}, which ${q.pass.length === 0 ? "names no answer that passes it" : `passes on ${q.pass.map(String).join(" or ")}`}, so a button names no one answer. Answer question ${q.id} at a shell.` };
|
|
226
|
+
}
|
|
227
|
+
const value = q.pass ? q.pass[0] : true;
|
|
228
|
+
const answered = await deps.answer({ id: q.id, answer: value, by: principal, relayedBy: deps.principal });
|
|
229
|
+
if (!answered.ok)
|
|
230
|
+
return { ok: false, outcome: "refused", op: pending.op, gate: pending.gate, principal, text: `Not approved: ${pending.gate} asks decision point ${q.point}, and question ${q.id} was not answered for ${principal}: ${answered.error}` };
|
|
231
|
+
return {
|
|
232
|
+
ok: true,
|
|
233
|
+
outcome: "answered",
|
|
234
|
+
op: pending.op,
|
|
235
|
+
gate: pending.gate,
|
|
236
|
+
principal,
|
|
237
|
+
text: `${pending.gate} on ${pending.op}: decision point ${q.point}, question ${q.id}, answered ${String(value)} by ${principal}, relayed by ${deps.principal}, for ${pending.digest} and no other plan. The resume job starts the ${words.stages.apply} once the answer passes the gate.`,
|
|
238
|
+
};
|
|
239
|
+
}
|
|
200
240
|
const recorded = await deps.approve({ op: pending.op, gate: pending.gate, digest: pending.digest, ...(pending.environment !== undefined ? { environment: pending.environment } : {}), actor: principal, relayedBy: deps.principal });
|
|
201
241
|
if (!recorded.ok)
|
|
202
242
|
return { ok: false, outcome: "refused", op: pending.op, gate: pending.gate, principal, text: `Not approved: ${recorded.error}` };
|
package/dist/notify.d.ts
CHANGED
|
@@ -205,6 +205,14 @@ export declare function slackMessage(e: NotifyEvent, relay?: RelayButtons): {
|
|
|
205
205
|
text: string;
|
|
206
206
|
blocks?: unknown[];
|
|
207
207
|
};
|
|
208
|
+
/**
|
|
209
|
+
* The Slack actions block with the relay's Approve and Decline buttons
|
|
210
|
+
* (#4611), for a product that renders its own Slack message: its clicks reach
|
|
211
|
+
* `chant notify relay` like those on chant's own message.
|
|
212
|
+
*/
|
|
213
|
+
export declare function slackRelayActions(relay: RelayButtons): Record<string, unknown>;
|
|
214
|
+
/** The Teams reply that approves through the relay's outgoing webhook (#4611): `approve <token>`, after a mention of the relay. */
|
|
215
|
+
export declare function teamsRelayReply(relay: RelayButtons, action?: "approve" | "decline"): string;
|
|
208
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). */
|
|
209
217
|
export declare function teamsMessage(e: NotifyEvent, relay?: RelayButtons): Record<string, unknown>;
|
|
210
218
|
/** Where events go. Each value is the NAME of an environment variable; the configuration never holds a URL or a key. */
|
|
@@ -267,10 +275,15 @@ export interface SendNotifyOptions {
|
|
|
267
275
|
/** The webhook headers' prefix. Default `x-chant`. */
|
|
268
276
|
prefix?: string;
|
|
269
277
|
userAgent?: string;
|
|
270
|
-
/**
|
|
278
|
+
/**
|
|
279
|
+
* A product's own Slack or Teams body, in place of {@link slackMessage} and
|
|
280
|
+
* {@link teamsMessage}. `relay` is the relay's signed button value for a
|
|
281
|
+
* waiting event when `notify.relay` names a key that is set (#4611), for
|
|
282
|
+
* {@link slackRelayActions} and {@link teamsRelayReply}.
|
|
283
|
+
*/
|
|
271
284
|
render?: {
|
|
272
|
-
slack?: (e: NotifyEvent) => unknown;
|
|
273
|
-
teams?: (e: NotifyEvent) => unknown;
|
|
285
|
+
slack?: (e: NotifyEvent, relay?: RelayButtons) => unknown;
|
|
286
|
+
teams?: (e: NotifyEvent, relay?: RelayButtons) => unknown;
|
|
274
287
|
};
|
|
275
288
|
/** Seconds since the epoch, for the signature's timestamp. Default: the clock. */
|
|
276
289
|
now?: number;
|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AClI,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
|
@@ -209,18 +209,24 @@ export function slackMessage(e, relay) {
|
|
|
209
209
|
const text = lines.join("\n");
|
|
210
210
|
if (!relay)
|
|
211
211
|
return { text };
|
|
212
|
+
return { text, blocks: [{ type: "section", text: { type: "mrkdwn", text } }, slackRelayActions(relay)] };
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* The Slack actions block with the relay's Approve and Decline buttons
|
|
216
|
+
* (#4611), for a product that renders its own Slack message: its clicks reach
|
|
217
|
+
* `chant notify relay` like those on chant's own message.
|
|
218
|
+
*/
|
|
219
|
+
export function slackRelayActions(relay) {
|
|
212
220
|
const button = (label, action, style) => ({ type: "button", text: { type: "plain_text", text: label }, action_id: action, value: relay.token, ...(style ? { style } : {}) });
|
|
213
|
-
return {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
],
|
|
219
|
-
};
|
|
221
|
+
return { type: "actions", elements: [button("Approve", RELAY_APPROVE_ACTION, "primary"), button("Decline", RELAY_DECLINE_ACTION)] };
|
|
222
|
+
}
|
|
223
|
+
/** The Teams reply that approves through the relay's outgoing webhook (#4611): `approve <token>`, after a mention of the relay. */
|
|
224
|
+
export function teamsRelayReply(relay, action = "approve") {
|
|
225
|
+
return `${action} ${relay.token}`;
|
|
220
226
|
}
|
|
221
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). */
|
|
222
228
|
export function teamsMessage(e, relay) {
|
|
223
|
-
const all = [...facts(e), ...(relay ? [{ title: "Approve in chat", value: `mention the relay and reply:
|
|
229
|
+
const all = [...facts(e), ...(relay ? [{ title: "Approve in chat", value: `mention the relay and reply: ${teamsRelayReply(relay)}` }] : [])];
|
|
224
230
|
const actions = [
|
|
225
231
|
...(e.approve?.review ? [{ type: "Action.OpenUrl", title: "Review and approve", url: e.approve.review.url }] : []),
|
|
226
232
|
...(e.run?.url ? [{ type: "Action.OpenUrl", title: "Open the run", url: e.run.url }] : []),
|
|
@@ -382,8 +388,8 @@ export async function sendNotify(config, event, options = {}) {
|
|
|
382
388
|
log(`notify: ${config.relay} is not set, so the message carries no relay buttons`);
|
|
383
389
|
const buttons = ref && relayKey ? { token: relayToken(relayKey, ref) } : undefined;
|
|
384
390
|
if (config.slack)
|
|
385
|
-
await deliver("slack", config.slack, () => json(options.render?.slack ? options.render.slack(event) : slackMessage(event, buttons)));
|
|
391
|
+
await deliver("slack", config.slack, () => json(options.render?.slack ? options.render.slack(event, buttons) : slackMessage(event, buttons)));
|
|
386
392
|
if (config.teams)
|
|
387
|
-
await deliver("teams", config.teams, () => json(options.render?.teams ? options.render.teams(event) : teamsMessage(event, buttons)));
|
|
393
|
+
await deliver("teams", config.teams, () => json(options.render?.teams ? options.render.teams(event, buttons) : teamsMessage(event, buttons)));
|
|
388
394
|
return out;
|
|
389
395
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review-agent.d.ts","sourceRoot":"","sources":["../../../src/op/activities/review-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAMH,OAAO,KAAK,EAAE,iBAAiB,EAAkB,MAAM,kBAAkB,CAAC;AAC1E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAc,WAAW,EAAkB,MAAM,aAAa,CAAC;AAItE,kFAAkF;AAClF,eAAO,MAAM,0BAA0B,YAAY,CAAC;AAEpD;;;;GAIG;AACH,eAAO,MAAM,cAAc,QAQhB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B,CAoH3I,CAAC;AAErD,2IAA2I;AAC3I,eAAO,MAAM,WAAW,SAtQ8C,eAAe,WAAW,WAAW,KAAK,OAAO,CAAC,iBAAiB,CAsQ3F,CAAC"}
|
|
@@ -192,6 +192,8 @@ export function riskOf(review) {
|
|
|
192
192
|
}
|
|
193
193
|
return found;
|
|
194
194
|
}
|
|
195
|
+
/** The first 12 hex characters of a change set's digest, after its `jcs1-sha256:` or `sha256:` prefix. */
|
|
196
|
+
const shortDigest = (d) => d.replace(/^(jcs1-)?sha256:/, "").slice(0, 12);
|
|
195
197
|
/** The note's body. The review is the model's text: shown, never trusted, and no HTML comment of it survives. */
|
|
196
198
|
export function reviewNoteBody(o) {
|
|
197
199
|
const ok = o.exitCode === 0;
|
|
@@ -200,7 +202,7 @@ export function reviewNoteBody(o) {
|
|
|
200
202
|
const lines = [
|
|
201
203
|
// Ours, and first: the review's own `<!--` is escaped below, so no later marker of this kind is the model's.
|
|
202
204
|
...(o.head !== undefined ? [reviewResultMarker(o.head, risk), ""] : []),
|
|
203
|
-
`### Review of change set \`${o.digest
|
|
205
|
+
`### Review of change set \`${shortDigest(o.digest)}\``,
|
|
204
206
|
"",
|
|
205
207
|
`Risk: **${risk}**. A model compared the title and description with the change set. This note approves nothing and gates nothing.`,
|
|
206
208
|
];
|
|
@@ -414,7 +416,7 @@ export function readReviewRecord(text) {
|
|
|
414
416
|
if (typeof r.review !== "string")
|
|
415
417
|
return undefined;
|
|
416
418
|
const exitCode = Number.isInteger(r.exitCode) ? r.exitCode : null;
|
|
417
|
-
const digest = typeof r.digest === "string" && /^sha256:[0-9a-f]{1,128}$/.test(r.digest) ? r.digest : "";
|
|
419
|
+
const digest = typeof r.digest === "string" && /^(jcs1-)?sha256:[0-9a-f]{1,128}$/.test(r.digest) ? r.digest : "";
|
|
418
420
|
return {
|
|
419
421
|
review: r.review,
|
|
420
422
|
exitCode,
|
package/dist/op/gate.d.ts
CHANGED
|
@@ -511,8 +511,12 @@ export declare function evaluateGate(port: GateLedgerPort, input: GateCheckInput
|
|
|
511
511
|
* plan (#2300) gets `--plan <digest>` too (#2832), so the line approves the
|
|
512
512
|
* plan the reader was shown and not whatever is pending by the time they run
|
|
513
513
|
* it.
|
|
514
|
+
*
|
|
515
|
+
* `target` fills a product's `{target}` (#4574) where no environment does,
|
|
516
|
+
* such as a wave's run target ({@link waveApproveTarget}). chant's own line
|
|
517
|
+
* leaves it out: `chant approve` names the op and the gate.
|
|
514
518
|
*/
|
|
515
|
-
export declare function approveCommand(op: string, gate: string, environment?: string, planDigest?: string, sealed?: boolean): string;
|
|
519
|
+
export declare function approveCommand(op: string, gate: string, environment?: string, planDigest?: string, sealed?: boolean, target?: string): string;
|
|
516
520
|
/**
|
|
517
521
|
* Whether the workspace seals `gate` (`identity.gates`), so an approval
|
|
518
522
|
* without `--sign` doesn't count. Callers pass the answer to
|