@intentius/chant 0.124.65 → 0.124.67

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant",
3
- "version": "0.124.65",
3
+ "version": "0.124.67",
4
4
  "description": "Declarative infrastructure-as-code toolkit — TypeScript on Node.js",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://intentius.io/chant",
@@ -1498,7 +1498,9 @@ async function beforeMergeChecks(ctx: CommandContext): Promise<PrBeforeMerge | n
1498
1498
  // The apply's own statuses never hold it back: chant ci run's, and the report's.
1499
1499
  // Nor does the plan's: a policy denial fails it, and the denial is only recorded when the apply judges it (plywood#66).
1500
1500
  // #4550: under a product's words its own prefix too.
1501
- const ignore = [...new Set([productContext(activeProductWords(), gate), productContext(activeProductWords(), PR_APPLY_GATE), `chant/${gate}`, `chant/${PR_APPLY_GATE}`, prStatusContext("apply", member), prStatusContext("plan"), `${prStatusContext("plan")}/`])];
1501
+ // plywood#66: the forge also reports the pull-request pipeline's plan job, `chant-pr.<member>.<env> / plan (<event>)`, which a denial fails too.
1502
+ const planJob = [`chant-pr.${member ?? "*"}.${ctx.args.env ?? "*"} / plan*`];
1503
+ const ignore = [...new Set([productContext(activeProductWords(), gate), productContext(activeProductWords(), PR_APPLY_GATE), `chant/${gate}`, `chant/${PR_APPLY_GATE}`, prStatusContext("apply", member), prStatusContext("plan"), `${prStatusContext("plan")}/`, ...planJob])];
1502
1504
  // ws-106 gives the declaration no way to leave a check out, so with no --requires all four are asked (#4336, #4607).
1503
1505
  const requires = await checkPrRequires(forge, args.pr, head, { ignore, ...(only ? { only: only.checks } : {}) });
1504
1506
  for (const r of requires) console.error(formatInfo(`${r.name}: ${r.passed ? "passed" : r.pending ? "pending" : "unmet"}, ${r.reason}`));
@@ -40,10 +40,9 @@ import type { ComponentInputs } from "./component";
40
40
  import type { Release } from "../lifecycle/release-store";
41
41
  import type { ReleaseRecord, ReleaseRecordInput, RunOrigin } from "../lifecycle/release-ledger";
42
42
  import { releaseTemplatesDigest } from "./release-promote";
43
- import { NEXT_RELEASE } from "../release-floors";
44
43
 
45
44
  /** The first chant that reads a component's `inputs` and writes `unchangedSince` on a release record (#4695). */
46
- export const UNCHANGED_INPUTS_FLOOR = NEXT_RELEASE;
45
+ export const UNCHANGED_INPUTS_FLOOR = "0.124.65";
47
46
 
48
47
  /** Whether a component's inputs are the same as in the release the environment runs it from. */
49
48
  export type InputsVerdict =
@@ -55,7 +55,6 @@ import {
55
55
  type LedgerLocation,
56
56
  } from "./git";
57
57
  import type { RunOrigin } from "./release-ledger";
58
- import { NEXT_RELEASE } from "../release-floors";
59
58
 
60
59
  /** The directory on `chant/lifecycle` that holds releases, cuts and template bytes. */
61
60
  export const RELEASES_DIR = "_releases";
@@ -89,7 +88,7 @@ export interface ReleaseArtifact {
89
88
  }
90
89
 
91
90
  /** The first chant that writes and reads an artifact's `ref` (#4694). */
92
- export const RELEASE_IMAGE_REF_FLOOR = NEXT_RELEASE;
91
+ export const RELEASE_IMAGE_REF_FLOOR = "0.124.65";
93
92
 
94
93
  /** One template of a target: a file a component's deploy reads, compiled for the target's environment. */
95
94
  export interface ReleaseTemplate {
package/src/pr-forge.ts CHANGED
@@ -307,7 +307,9 @@ const MERGE_REFUSED = new Set([405, 406, 409, 422]);
307
307
  function ignoredStatus(ignore: readonly string[]): (name: string) => boolean {
308
308
  const exact = new Set(ignore);
309
309
  const under = ignore.filter((i) => i.endsWith("/"));
310
- return (name) => exact.has(name) || under.some((i) => name.startsWith(i));
310
+ // An entry with `*` in it is a pattern, `*` standing for any run of characters, such as a pipeline job's status with the event after it (plywood#66).
311
+ const globs = ignore.filter((i) => i.includes("*")).map((i) => new RegExp(`^${i.replace(/[.+?^${}()|[\]\\]/g, "\\$&").replaceAll("*", ".*")}$`));
312
+ return (name) => exact.has(name) || under.some((i) => name.startsWith(i)) || globs.some((g) => g.test(name));
311
313
  }
312
314
 
313
315
  /** A refused merge as a result, any other failure rethrown. */
@@ -115,6 +115,16 @@ describe("github", () => {
115
115
  expect((await f.prChecksPassed!(7, HEAD, ["plywood/preview"])).passed).toBe(false);
116
116
  });
117
117
 
118
+ test("checks: an entry with * leaves out every status it matches, and only those", async () => {
119
+ const f = forge({
120
+ [`GET ${repo}/commits/${HEAD}/status`]: { statuses: [{ context: "chant-pr.shop.production / plan (pull_request)", state: "failure" }, { context: "ci/test", state: "success" }] },
121
+ [`GET ${repo}/commits/${HEAD}/check-runs`]: { check_runs: [] },
122
+ });
123
+ expect((await f.prChecksPassed!(7, HEAD, ["chant-pr.*.production / plan*"])).passed).toBe(true);
124
+ expect((await f.prChecksPassed!(7, HEAD, ["chant-pr.*.staging / plan*"])).passed).toBe(false);
125
+ expect((await f.prChecksPassed!(7, HEAD, ["chant-pr.shop.production / plan"])).passed).toBe(false);
126
+ });
127
+
118
128
  test("checks: nothing reported is pending", async () => {
119
129
  const f = forge({ [`GET ${repo}/commits/${HEAD}/status`]: { statuses: [] }, [`GET ${repo}/commits/${HEAD}/check-runs`]: { check_runs: [] } });
120
130
  expect(await f.prChecksPassed!(7, HEAD)).toMatchObject({ passed: false, pending: true });
@@ -19,4 +19,4 @@
19
19
  * this constant to the next patch (#4501). The check fails while a floor
20
20
  * still names this constant after its version shipped.
21
21
  */
22
- export const NEXT_RELEASE = "0.124.65";
22
+ export const NEXT_RELEASE = "0.124.67";