@intentius/chant 0.124.71 → 0.124.73

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.
Files changed (58) hide show
  1. package/dist/ci-commit.d.ts +41 -1
  2. package/dist/ci-commit.d.ts.map +1 -1
  3. package/dist/ci-commit.js +54 -8
  4. package/dist/ci-estate/delivery.d.ts +75 -2
  5. package/dist/ci-estate/delivery.d.ts.map +1 -1
  6. package/dist/ci-estate/delivery.js +129 -0
  7. package/dist/ci-estate.d.ts +3 -1
  8. package/dist/ci-estate.d.ts.map +1 -1
  9. package/dist/ci-estate.js +3 -1
  10. package/dist/ci-product.d.ts +1 -1
  11. package/dist/ci-product.d.ts.map +1 -1
  12. package/dist/ci-product.js +1 -1
  13. package/dist/cli/handlers/commit.d.ts.map +1 -1
  14. package/dist/cli/handlers/commit.js +5 -2
  15. package/dist/cli/handlers/notify-relay.d.ts.map +1 -1
  16. package/dist/cli/handlers/notify-relay.js +22 -2
  17. package/dist/config.d.ts +14 -0
  18. package/dist/config.d.ts.map +1 -1
  19. package/dist/config.js +7 -0
  20. package/dist/lexicon.d.ts +17 -0
  21. package/dist/lexicon.d.ts.map +1 -1
  22. package/dist/lifecycle/publish-forge.d.ts.map +1 -1
  23. package/dist/lifecycle/publish-forge.js +1 -2
  24. package/dist/lifecycle/release-images.d.ts.map +1 -1
  25. package/dist/lifecycle/release-images.js +1 -2
  26. package/dist/notify-relay.d.ts +41 -1
  27. package/dist/notify-relay.d.ts.map +1 -1
  28. package/dist/notify-relay.js +39 -0
  29. package/dist/notify.d.ts +16 -3
  30. package/dist/notify.d.ts.map +1 -1
  31. package/dist/notify.js +16 -10
  32. package/dist/op/activities/activity-contracts.d.ts +4 -4
  33. package/dist/release-floors.d.ts +1 -1
  34. package/dist/release-floors.js +1 -1
  35. package/dist/wave-runtime.mjs +237 -237
  36. package/dist/workspace/release-workflow.d.ts +24 -0
  37. package/dist/workspace/release-workflow.d.ts.map +1 -1
  38. package/dist/workspace/release-workflow.js +61 -8
  39. package/package.json +1 -1
  40. package/src/ci-commit.test.ts +22 -1
  41. package/src/ci-commit.ts +79 -8
  42. package/src/ci-estate/__fixtures__/terragucci-dora.json +1305 -0
  43. package/src/ci-estate/delivery.ts +186 -2
  44. package/src/ci-estate/records-delivery.test.ts +55 -0
  45. package/src/ci-estate.ts +9 -0
  46. package/src/ci-product.ts +1 -0
  47. package/src/cli/handlers/commit.ts +4 -1
  48. package/src/cli/handlers/notify-relay.ts +21 -2
  49. package/src/config.ts +7 -0
  50. package/src/lexicon.ts +16 -0
  51. package/src/lifecycle/publish-forge.ts +1 -2
  52. package/src/lifecycle/release-images.ts +1 -2
  53. package/src/notify-relay.test.ts +55 -1
  54. package/src/notify-relay.ts +48 -1
  55. package/src/notify.ts +25 -12
  56. package/src/release-floors.ts +1 -1
  57. package/src/workspace/release-workflow.test.ts +49 -1
  58. package/src/workspace/release-workflow.ts +91 -7
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
- text,
215
- blocks: [
216
- { type: "section", text: { type: "mrkdwn", text } },
217
- { type: "actions", elements: [button("Approve", RELAY_APPROVE_ACTION, "primary"), button("Decline", RELAY_DECLINE_ACTION)] },
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: approve ${relay.token}` }] : [])];
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
  }
@@ -357,11 +357,11 @@ export declare const decideContract: import("../index.js").ActivityContract<{
357
357
  backends?: Record<string, {
358
358
  url: string;
359
359
  key?: {
360
+ env: string;
361
+ } | {
360
362
  capability: string;
361
363
  member?: string | undefined;
362
364
  env?: string | undefined;
363
- } | {
364
- env: string;
365
365
  } | undefined;
366
366
  timeoutMs?: number | undefined;
367
367
  }> | undefined;
@@ -450,11 +450,11 @@ export declare const factoryAskContract: import("../index.js").ActivityContract<
450
450
  backends?: Record<string, {
451
451
  url: string;
452
452
  key?: {
453
+ env: string;
454
+ } | {
453
455
  capability: string;
454
456
  member?: string | undefined;
455
457
  env?: string | undefined;
456
- } | {
457
- env: string;
458
458
  } | undefined;
459
459
  timeoutMs?: number | undefined;
460
460
  }> | undefined;
@@ -19,5 +19,5 @@
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 declare const NEXT_RELEASE = "0.124.71";
22
+ export declare const NEXT_RELEASE = "0.124.73";
23
23
  //# sourceMappingURL=release-floors.d.ts.map
@@ -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.71";
22
+ export const NEXT_RELEASE = "0.124.73";