willfire 0.1.16 → 0.1.18

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.
@@ -0,0 +1,6 @@
1
+ /**
2
+ * GitHub cuts a display name over 100 characters to 97 plus `...`. Verified
3
+ * on a live dispatch (dirsql PR #1013): the cap applies to the leaf name
4
+ * before any reusable-call prefixing, so it lives here, not on the entry.
5
+ */
6
+ export declare function capDisplayName(name: string): string;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * GitHub cuts a display name over 100 characters to 97 plus `...`. Verified
3
+ * on a live dispatch (dirsql PR #1013): the cap applies to the leaf name
4
+ * before any reusable-call prefixing, so it lives here, not on the entry.
5
+ */
6
+ export function capDisplayName(name) {
7
+ return name.length > 100 ? `${name.slice(0, 97)}...` : name;
8
+ }
@@ -1,4 +1,5 @@
1
1
  import { matrixSuffix } from "../matrix/matrixSuffix.js";
2
+ import { capDisplayName } from "./capDisplayName.js";
2
3
  import { renderName } from "./renderName.js";
3
4
  /**
4
5
  * A `name:` that contains any `${{ }}` expression suppresses the matrix
@@ -17,9 +18,9 @@ export const EXPRESSION_RE = /\$\{\{/;
17
18
  export function jobDisplayName(jobId, job, combo) {
18
19
  const raw = job != null && job.name != null ? String(job.name) : null;
19
20
  if (raw === null) {
20
- return { name: jobId + (combo ? matrixSuffix(combo) : ""), resolved: true };
21
+ return { name: capDisplayName(jobId + (combo ? matrixSuffix(combo) : "")), resolved: true };
21
22
  }
22
23
  const { text, resolved } = renderName(raw, combo?.values ?? null);
23
24
  const suffix = combo && !EXPRESSION_RE.test(raw) ? matrixSuffix(combo) : "";
24
- return { name: text + suffix, resolved };
25
+ return { name: capDisplayName(text + suffix), resolved };
25
26
  }
@@ -1,3 +1,4 @@
1
+ import { capDisplayName } from "./capDisplayName.js";
1
2
  /**
2
3
  * The check name a job gets when it is skipped.
3
4
  *
@@ -12,5 +13,5 @@
12
13
  */
13
14
  export function skippedDisplayName(jobId, job) {
14
15
  const raw = job != null && job.name != null ? String(job.name) : null;
15
- return { name: raw ?? jobId, resolved: true };
16
+ return { name: capDisplayName(raw ?? jobId), resolved: true };
16
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "willfire",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "description": "Predict the set of CI check entries GitHub Actions will create for a pull request",
5
5
  "license": "MIT",
6
6
  "packageManager": "pnpm@10.33.0",
@@ -40,6 +40,7 @@
40
40
  "prepare": "pnpm build",
41
41
  "test": "vitest run",
42
42
  "test:coverage": "vitest run --coverage",
43
+ "test:e2e": "vitest run --config tests/e2e/vitest.config.mts",
43
44
  "typecheck": "tsc -p tsconfig.json",
44
45
  "verify": "tsx src/verify.ts"
45
46
  },