@continuous-excellence/ze-great-dashboard-aws 0.31.28 → 0.31.30

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/cli.js CHANGED
@@ -86,6 +86,28 @@ var positionSchema = z2.union([
86
86
  ]);
87
87
  var panelDensities = ["auto", "comfortable", "compact"];
88
88
  var panelDensitySchema = z2.enum(panelDensities);
89
+ var githubActionsBuildEvents = [
90
+ "push",
91
+ "pull_request",
92
+ "pull_request_target",
93
+ "pull_request_review",
94
+ "pull_request_review_comment",
95
+ "workflow_dispatch",
96
+ "workflow_run",
97
+ "merge_group"
98
+ ];
99
+ var githubActionsBuildEventSchema = z2.enum(githubActionsBuildEvents);
100
+ var githubActionsBuildEventsSchema = z2.array(githubActionsBuildEventSchema).min(1).superRefine((events, ctx) => {
101
+ events.forEach((event, index) => {
102
+ if (events.indexOf(event) !== index)
103
+ ctx.addIssue({
104
+ code: "custom",
105
+ path: [index],
106
+ message: `duplicate build event "${event}"`,
107
+ params: { constraint: "Use each build event at most once." }
108
+ });
109
+ });
110
+ });
89
111
  var attentionTreatments = ["beacon", "alarm", "steady"];
90
112
  var attentionTreatmentSchema = z2.enum(attentionTreatments);
91
113
  var httpValueJsonPathSchema = z2.string().regex(/^\$(?:\.[A-Za-z_][A-Za-z0-9_]*|\[\d+\])*$/, "must be a simple JSON path");
@@ -146,7 +168,9 @@ var panelSchema = z2.looseObject({
146
168
  /** Small, deliberate JSON path subset: $.version, $.deployment.version, or $.response.docs[0].latestVersion. */
147
169
  json_path: httpValueJsonPathSchema.optional(),
148
170
  /** Up to four independently fetched source-agnostic readings in one visual panel. */
149
- facts: httpValueGroupedPanelSchema.shape.facts.optional()
171
+ facts: httpValueGroupedPanelSchema.shape.facts.optional(),
172
+ /** Optional GitHub Actions-only restriction on which workflow triggers count as build evidence. */
173
+ build_events: githubActionsBuildEventsSchema.optional()
150
174
  }).superRefine((panel, ctx) => {
151
175
  if ("display" in panel) {
152
176
  ctx.addIssue({
@@ -388,6 +412,16 @@ var boardConfigSchema = z2.object({
388
412
  for (const [boardName, board] of Object.entries(config.boards)) {
389
413
  board.panels.forEach((panel, panelIndex) => {
390
414
  const source = panel.source ? config.sources[panel.source] : void 0;
415
+ if (panel.build_events !== void 0 && (panel.type !== "pull-request-health" || source?.type !== "github-actions")) {
416
+ ctx.addIssue({
417
+ code: "custom",
418
+ path: ["boards", boardName, "panels", panelIndex, "build_events"],
419
+ message: "build_events is available only on pull-request-health panels using a github-actions source",
420
+ params: {
421
+ constraint: "Configure build_events only for GitHub Actions pull-request health panels."
422
+ }
423
+ });
424
+ }
391
425
  if (panel.type !== "pipeline-status" || source?.type !== "azure-devops") return;
392
426
  if (typeof panel.pipeline !== "number" || !Number.isInteger(panel.pipeline) || panel.pipeline <= 0) {
393
427
  ctx.addIssue({
@@ -656,7 +690,8 @@ var pullRequestHealthPanelSchema = z7.object({
656
690
  branch_prefixes: z7.array(z7.string().min(1)).min(1)
657
691
  })
658
692
  ).min(1),
659
- build_workflow: z7.string().min(1)
693
+ build_workflow: z7.string().min(1),
694
+ build_events: githubActionsBuildEventsSchema.optional()
660
695
  });
661
696
  var runSchema = z7.object({
662
697
  id: z7.number().int().positive().optional(),
@@ -664,6 +699,8 @@ var runSchema = z7.object({
664
699
  conclusion: z7.string().nullable(),
665
700
  name: z7.string().min(1),
666
701
  html_url: z7.url(),
702
+ /** The GitHub Actions trigger that started this run. */
703
+ event: z7.string().min(1).optional(),
667
704
  /** The branch that produced this run; absent for some event types. */
668
705
  head_branch: z7.string().min(1).nullable().optional(),
669
706
  // Timestamp quality should only remove timing advice, never make an otherwise useful run unreadable.
package/dist/index.js CHANGED
@@ -767,6 +767,28 @@ var positionSchema = z2.union([
767
767
  ]);
768
768
  var panelDensities = ["auto", "comfortable", "compact"];
769
769
  var panelDensitySchema = z2.enum(panelDensities);
770
+ var githubActionsBuildEvents = [
771
+ "push",
772
+ "pull_request",
773
+ "pull_request_target",
774
+ "pull_request_review",
775
+ "pull_request_review_comment",
776
+ "workflow_dispatch",
777
+ "workflow_run",
778
+ "merge_group"
779
+ ];
780
+ var githubActionsBuildEventSchema = z2.enum(githubActionsBuildEvents);
781
+ var githubActionsBuildEventsSchema = z2.array(githubActionsBuildEventSchema).min(1).superRefine((events, ctx) => {
782
+ events.forEach((event, index) => {
783
+ if (events.indexOf(event) !== index)
784
+ ctx.addIssue({
785
+ code: "custom",
786
+ path: [index],
787
+ message: `duplicate build event "${event}"`,
788
+ params: { constraint: "Use each build event at most once." }
789
+ });
790
+ });
791
+ });
770
792
  var attentionTreatments = ["beacon", "alarm", "steady"];
771
793
  var attentionTreatmentSchema = z2.enum(attentionTreatments);
772
794
  var httpValueJsonPathSchema = z2.string().regex(/^\$(?:\.[A-Za-z_][A-Za-z0-9_]*|\[\d+\])*$/, "must be a simple JSON path");
@@ -827,7 +849,9 @@ var panelSchema = z2.looseObject({
827
849
  /** Small, deliberate JSON path subset: $.version, $.deployment.version, or $.response.docs[0].latestVersion. */
828
850
  json_path: httpValueJsonPathSchema.optional(),
829
851
  /** Up to four independently fetched source-agnostic readings in one visual panel. */
830
- facts: httpValueGroupedPanelSchema.shape.facts.optional()
852
+ facts: httpValueGroupedPanelSchema.shape.facts.optional(),
853
+ /** Optional GitHub Actions-only restriction on which workflow triggers count as build evidence. */
854
+ build_events: githubActionsBuildEventsSchema.optional()
831
855
  }).superRefine((panel, ctx) => {
832
856
  if ("display" in panel) {
833
857
  ctx.addIssue({
@@ -1069,6 +1093,16 @@ var boardConfigSchema = z2.object({
1069
1093
  for (const [boardName, board] of Object.entries(config.boards)) {
1070
1094
  board.panels.forEach((panel, panelIndex) => {
1071
1095
  const source = panel.source ? config.sources[panel.source] : void 0;
1096
+ if (panel.build_events !== void 0 && (panel.type !== "pull-request-health" || source?.type !== "github-actions")) {
1097
+ ctx.addIssue({
1098
+ code: "custom",
1099
+ path: ["boards", boardName, "panels", panelIndex, "build_events"],
1100
+ message: "build_events is available only on pull-request-health panels using a github-actions source",
1101
+ params: {
1102
+ constraint: "Configure build_events only for GitHub Actions pull-request health panels."
1103
+ }
1104
+ });
1105
+ }
1072
1106
  if (panel.type !== "pipeline-status" || source?.type !== "azure-devops") return;
1073
1107
  if (typeof panel.pipeline !== "number" || !Number.isInteger(panel.pipeline) || panel.pipeline <= 0) {
1074
1108
  ctx.addIssue({
@@ -1337,7 +1371,8 @@ var pullRequestHealthPanelSchema = z7.object({
1337
1371
  branch_prefixes: z7.array(z7.string().min(1)).min(1)
1338
1372
  })
1339
1373
  ).min(1),
1340
- build_workflow: z7.string().min(1)
1374
+ build_workflow: z7.string().min(1),
1375
+ build_events: githubActionsBuildEventsSchema.optional()
1341
1376
  });
1342
1377
  var runSchema = z7.object({
1343
1378
  id: z7.number().int().positive().optional(),
@@ -1345,6 +1380,8 @@ var runSchema = z7.object({
1345
1380
  conclusion: z7.string().nullable(),
1346
1381
  name: z7.string().min(1),
1347
1382
  html_url: z7.url(),
1383
+ /** The GitHub Actions trigger that started this run. */
1384
+ event: z7.string().min(1).optional(),
1348
1385
  /** The branch that produced this run; absent for some event types. */
1349
1386
  head_branch: z7.string().min(1).nullable().optional(),
1350
1387
  // Timestamp quality should only remove timing advice, never make an otherwise useful run unreadable.
package/dist/lambda.mjs CHANGED
@@ -460,7 +460,7 @@ var require_dist_cjs = __commonJS({
460
460
  FieldPosition3[FieldPosition3["HEADER"] = 0] = "HEADER";
461
461
  FieldPosition3[FieldPosition3["TRAILER"] = 1] = "TRAILER";
462
462
  })(FieldPosition2 || (FieldPosition2 = {}));
463
- var SMITHY_CONTEXT_KEY3 = "__smithy_context";
463
+ var SMITHY_CONTEXT_KEY4 = "__smithy_context";
464
464
  var IniSectionType4;
465
465
  (function(IniSectionType5) {
466
466
  IniSectionType5["PROFILE"] = "profile";
@@ -480,7 +480,7 @@ var require_dist_cjs = __commonJS({
480
480
  exports.HttpAuthLocation = HttpAuthLocation;
481
481
  exports.IniSectionType = IniSectionType4;
482
482
  exports.RequestHandlerProtocol = RequestHandlerProtocol;
483
- exports.SMITHY_CONTEXT_KEY = SMITHY_CONTEXT_KEY3;
483
+ exports.SMITHY_CONTEXT_KEY = SMITHY_CONTEXT_KEY4;
484
484
  exports.getDefaultClientConfiguration = getDefaultClientConfiguration2;
485
485
  exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig2;
486
486
  }
@@ -13700,10 +13700,11 @@ var init_utils3 = __esm({
13700
13700
  });
13701
13701
 
13702
13702
  // node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js
13703
- var throwSigningPropertyError, validateSigningProperties, AwsSdkSigV4Signer, AWSSDKSigV4Signer;
13703
+ var import_types25, throwSigningPropertyError, hasEventStreamOutput, validateSigningProperties, AwsSdkSigV4Signer, AWSSDKSigV4Signer;
13704
13704
  var init_AwsSdkSigV4Signer = __esm({
13705
13705
  "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js"() {
13706
13706
  init_protocols();
13707
+ import_types25 = __toESM(require_dist_cjs());
13707
13708
  init_utils3();
13708
13709
  throwSigningPropertyError = (name, property) => {
13709
13710
  if (!property) {
@@ -13711,6 +13712,11 @@ var init_AwsSdkSigV4Signer = __esm({
13711
13712
  }
13712
13713
  return property;
13713
13714
  };
13715
+ hasEventStreamOutput = (signingProperties) => {
13716
+ const context = signingProperties.context;
13717
+ const eventStream = context?.[import_types25.SMITHY_CONTEXT_KEY]?.eventStream;
13718
+ return eventStream?.output === true;
13719
+ };
13714
13720
  validateSigningProperties = async (signingProperties) => {
13715
13721
  const context = throwSigningPropertyError("context", signingProperties.context);
13716
13722
  const config2 = throwSigningPropertyError("config", signingProperties.config);
@@ -13746,7 +13752,9 @@ var init_AwsSdkSigV4Signer = __esm({
13746
13752
  }
13747
13753
  const noSkewCorrection = await config2.disableClockSkewCorrection?.() === true;
13748
13754
  signingProperties._disableClockSkewCorrection = noSkewCorrection;
13749
- if (!noSkewCorrection) {
13755
+ const skipSkewSampling = noSkewCorrection || hasEventStreamOutput(signingProperties);
13756
+ signingProperties._skipClockSkewSampling = skipSkewSampling;
13757
+ if (!skipSkewSampling) {
13750
13758
  signingProperties._preRequestSystemClockOffset = config2.systemClockOffset;
13751
13759
  signingProperties._requestSentAt = Date.now();
13752
13760
  }
@@ -13760,7 +13768,7 @@ var init_AwsSdkSigV4Signer = __esm({
13760
13768
  errorHandler(signingProperties) {
13761
13769
  return (error63) => {
13762
13770
  const errorException = error63;
13763
- if (!signingProperties._disableClockSkewCorrection) {
13771
+ if (!signingProperties._skipClockSkewSampling && !signingProperties._disableClockSkewCorrection) {
13764
13772
  const serverTime = errorException.ServerTime ?? getDateHeader(errorException.$response);
13765
13773
  if (serverTime) {
13766
13774
  const config2 = throwSigningPropertyError("config", signingProperties.config);
@@ -13781,7 +13789,7 @@ var init_AwsSdkSigV4Signer = __esm({
13781
13789
  };
13782
13790
  }
13783
13791
  successHandler(httpResponse, signingProperties) {
13784
- if (signingProperties._disableClockSkewCorrection) {
13792
+ if (signingProperties._skipClockSkewSampling || signingProperties._disableClockSkewCorrection) {
13785
13793
  return;
13786
13794
  }
13787
13795
  const dateHeader = getDateHeader(httpResponse);
@@ -16107,7 +16115,7 @@ var init_package = __esm({
16107
16115
  "node_modules/@aws-sdk/nested-clients/package.json"() {
16108
16116
  package_default = {
16109
16117
  name: "@aws-sdk/nested-clients",
16110
- version: "3.997.47",
16118
+ version: "3.997.48",
16111
16119
  description: "Nested clients for AWS SDK packages.",
16112
16120
  homepage: "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients",
16113
16121
  license: "Apache-2.0",
@@ -16207,7 +16215,7 @@ var init_package = __esm({
16207
16215
  "test:watch": "yarn g:vitest watch"
16208
16216
  },
16209
16217
  dependencies: {
16210
- "@aws-sdk/core": "^3.978.2",
16218
+ "@aws-sdk/core": "^3.978.3",
16211
16219
  "@aws-sdk/signature-v4-multi-region": "^3.996.48",
16212
16220
  "@aws-sdk/types": "^3.974.6",
16213
16221
  "@smithy/core": "^3.35.2",
@@ -26166,7 +26174,7 @@ var require_dist_cjs16 = __commonJS({
26166
26174
  Region: { type: "builtInParams", name: "region" },
26167
26175
  UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
26168
26176
  };
26169
- var version2 = "3.1148.0";
26177
+ var version2 = "3.1149.0";
26170
26178
  var packageInfo = {
26171
26179
  version: version2
26172
26180
  };
@@ -27957,7 +27965,7 @@ var require_dist_cjs17 = __commonJS({
27957
27965
  Region: { type: "builtInParams", name: "region" },
27958
27966
  UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
27959
27967
  };
27960
- var version2 = "3.1148.0";
27968
+ var version2 = "3.1149.0";
27961
27969
  var packageInfo = {
27962
27970
  version: version2
27963
27971
  };
@@ -52237,7 +52245,7 @@ ${content.join("\n")}
52237
52245
  var version = {
52238
52246
  major: 4,
52239
52247
  minor: 6,
52240
- patch: 6
52248
+ patch: 7
52241
52249
  };
52242
52250
 
52243
52251
  // node_modules/zod/v4/core/schemas.js
@@ -69381,6 +69389,28 @@ var positionSchema = external_exports.union([
69381
69389
  ]);
69382
69390
  var panelDensities = ["auto", "comfortable", "compact"];
69383
69391
  var panelDensitySchema = external_exports.enum(panelDensities);
69392
+ var githubActionsBuildEvents = [
69393
+ "push",
69394
+ "pull_request",
69395
+ "pull_request_target",
69396
+ "pull_request_review",
69397
+ "pull_request_review_comment",
69398
+ "workflow_dispatch",
69399
+ "workflow_run",
69400
+ "merge_group"
69401
+ ];
69402
+ var githubActionsBuildEventSchema = external_exports.enum(githubActionsBuildEvents);
69403
+ var githubActionsBuildEventsSchema = external_exports.array(githubActionsBuildEventSchema).min(1).superRefine((events, ctx) => {
69404
+ events.forEach((event, index) => {
69405
+ if (events.indexOf(event) !== index)
69406
+ ctx.addIssue({
69407
+ code: "custom",
69408
+ path: [index],
69409
+ message: `duplicate build event "${event}"`,
69410
+ params: { constraint: "Use each build event at most once." }
69411
+ });
69412
+ });
69413
+ });
69384
69414
  var attentionTreatments = ["beacon", "alarm", "steady"];
69385
69415
  var attentionTreatmentSchema = external_exports.enum(attentionTreatments);
69386
69416
  var httpValueJsonPathSchema = external_exports.string().regex(/^\$(?:\.[A-Za-z_][A-Za-z0-9_]*|\[\d+\])*$/, "must be a simple JSON path");
@@ -69441,7 +69471,9 @@ var panelSchema = external_exports.looseObject({
69441
69471
  /** Small, deliberate JSON path subset: $.version, $.deployment.version, or $.response.docs[0].latestVersion. */
69442
69472
  json_path: httpValueJsonPathSchema.optional(),
69443
69473
  /** Up to four independently fetched source-agnostic readings in one visual panel. */
69444
- facts: httpValueGroupedPanelSchema.shape.facts.optional()
69474
+ facts: httpValueGroupedPanelSchema.shape.facts.optional(),
69475
+ /** Optional GitHub Actions-only restriction on which workflow triggers count as build evidence. */
69476
+ build_events: githubActionsBuildEventsSchema.optional()
69445
69477
  }).superRefine((panel, ctx) => {
69446
69478
  if ("display" in panel) {
69447
69479
  ctx.addIssue({
@@ -69688,6 +69720,16 @@ var boardConfigSchema = external_exports.object({
69688
69720
  for (const [boardName, board] of Object.entries(config2.boards)) {
69689
69721
  board.panels.forEach((panel, panelIndex) => {
69690
69722
  const source = panel.source ? config2.sources[panel.source] : void 0;
69723
+ if (panel.build_events !== void 0 && (panel.type !== "pull-request-health" || source?.type !== "github-actions")) {
69724
+ ctx.addIssue({
69725
+ code: "custom",
69726
+ path: ["boards", boardName, "panels", panelIndex, "build_events"],
69727
+ message: "build_events is available only on pull-request-health panels using a github-actions source",
69728
+ params: {
69729
+ constraint: "Configure build_events only for GitHub Actions pull-request health panels."
69730
+ }
69731
+ });
69732
+ }
69691
69733
  if (panel.type !== "pipeline-status" || source?.type !== "azure-devops") return;
69692
69734
  if (typeof panel.pipeline !== "number" || !Number.isInteger(panel.pipeline) || panel.pipeline <= 0) {
69693
69735
  ctx.addIssue({
@@ -70465,7 +70507,8 @@ var pullRequestHealthPanelSchema = external_exports.object({
70465
70507
  branch_prefixes: external_exports.array(external_exports.string().min(1)).min(1)
70466
70508
  })
70467
70509
  ).min(1),
70468
- build_workflow: external_exports.string().min(1)
70510
+ build_workflow: external_exports.string().min(1),
70511
+ build_events: githubActionsBuildEventsSchema.optional()
70469
70512
  });
70470
70513
  var runSchema = external_exports.object({
70471
70514
  id: external_exports.number().int().positive().optional(),
@@ -70473,6 +70516,8 @@ var runSchema = external_exports.object({
70473
70516
  conclusion: external_exports.string().nullable(),
70474
70517
  name: external_exports.string().min(1),
70475
70518
  html_url: external_exports.url(),
70519
+ /** The GitHub Actions trigger that started this run. */
70520
+ event: external_exports.string().min(1).optional(),
70476
70521
  /** The branch that produced this run; absent for some event types. */
70477
70522
  head_branch: external_exports.string().min(1).nullable().optional(),
70478
70523
  // Timestamp quality should only remove timing advice, never make an otherwise useful run unreadable.
@@ -70590,9 +70635,19 @@ async function fetchGithubActionsPullRequestBuild(args) {
70590
70635
  return githubObservation(
70591
70636
  args,
70592
70637
  source,
70593
- githubRunsCall(source, panel.build_workflow, args.branch, "pull_request"),
70638
+ githubRunsCall(
70639
+ source,
70640
+ panel.build_workflow,
70641
+ args.branch,
70642
+ void 0,
70643
+ panel.build_events ? 100 : 1
70644
+ ),
70594
70645
  (value, observedAt4) => {
70595
- const run = runsSchema.parse(value).workflow_runs[0];
70646
+ const run = runsSchema.parse(value).workflow_runs.find((candidate) => {
70647
+ if (!panel.build_events) return true;
70648
+ const event = githubActionsBuildEventSchema.safeParse(candidate.event);
70649
+ return event.success && panel.build_events.includes(event.data);
70650
+ });
70596
70651
  return {
70597
70652
  panelId: panel.id,
70598
70653
  state: "ok",
@@ -70601,7 +70656,7 @@ async function fetchGithubActionsPullRequestBuild(args) {
70601
70656
  signal: {
70602
70657
  type: "pull-request-build",
70603
70658
  branch: args.branch,
70604
- item: healthItem(args.branch, run, args.branch)
70659
+ item: healthItem(args.branch, run, args.branch, void 0, true)
70605
70660
  }
70606
70661
  };
70607
70662
  }
@@ -70688,11 +70743,11 @@ function githubRunsCall(source, workflow, branch, event, perPage = 1, created) {
70688
70743
  url2.searchParams.set("per_page", String(perPage));
70689
70744
  return { url: url2.toString(), headers: new Headers() };
70690
70745
  }
70691
- function healthItem(label, run, detail, link) {
70746
+ function healthItem(label, run, detail, link, includeEvent = false) {
70692
70747
  return {
70693
70748
  label,
70694
70749
  status: run ? normalizeStatus2(run.status, run.conclusion) : "unknown",
70695
- detail: run ? `${detail} \xB7 ${run.conclusion ?? run.status}` : `${detail} \xB7 No run found`,
70750
+ detail: run ? `${detail}${includeEvent ? ` \xB7 ${run.event ?? "unknown trigger"}` : ""} \xB7 ${run.conclusion ?? run.status}` : `${detail} \xB7 No run found`,
70696
70751
  link: link ?? run?.html_url ?? null
70697
70752
  };
70698
70753
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@continuous-excellence/ze-great-dashboard-aws",
3
- "version": "0.31.28",
3
+ "version": "0.31.30",
4
4
  "type": "module",
5
5
  "description": "AWS server runtime and CloudFormation deployment tooling for Ze Great Dashboard.",
6
6
  "keywords": [
@@ -36,7 +36,7 @@
36
36
  "dependencies": {
37
37
  "fflate": "^0.8.3",
38
38
  "yaml": "^2.9.1",
39
- "zod": "^4.6.6"
39
+ "zod": "^4.6.7"
40
40
  },
41
41
  "devDependencies": {
42
42
  "esbuild": "^0.28.2",