@codyswann/lisa 4.95.2 → 4.95.4
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/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +32 -3
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/dist/health/governance-probes.js +1 -1
- package/dist/health/governance-probes.js.map +1 -1
- package/dist/health/template-inspection.d.ts.map +1 -1
- package/dist/health/template-inspection.js +61 -35
- package/dist/health/template-inspection.js.map +1 -1
- package/package.json +4 -4
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-agy/plugin.json +1 -1
- package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
- package/scripts/detect-stale-workflow-inputs.mjs +99 -18
- package/scripts/lib/reusable-workflow-contract.d.mts +10 -0
- package/scripts/lib/reusable-workflow-contract.mjs +80 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "4.95.
|
|
3
|
+
"version": "4.95.4",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "4.95.
|
|
3
|
+
"version": "4.95.4",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "4.95.
|
|
3
|
+
"version": "4.95.4",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "4.95.
|
|
3
|
+
"version": "4.95.4",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -30,9 +30,18 @@
|
|
|
30
30
|
* CLI:
|
|
31
31
|
* node scripts/detect-stale-workflow-inputs.mjs [--project <dir>]... [--contracts-root <dir>] [--json]
|
|
32
32
|
*
|
|
33
|
+
* Caller lines are read in every shape Lisa's pin step writes, including the
|
|
34
|
+
* trailing `# v<version>` comment and quoted references (#4641). A `uses:` line
|
|
35
|
+
* that names a Lisa reusable workflow but cannot be read is reported with
|
|
36
|
+
* status `unparsed` rather than dropped, so a file the detector could not read
|
|
37
|
+
* never counts as clean.
|
|
38
|
+
*
|
|
33
39
|
* Exit codes:
|
|
34
|
-
* 0 —
|
|
35
|
-
*
|
|
40
|
+
* 0 — every Lisa caller was read and none has a stale input. This includes a
|
|
41
|
+
* project with no Lisa reusable-workflow callers at all; the summary line
|
|
42
|
+
* says so explicitly.
|
|
43
|
+
* 1 — stale input(s) found in at least one caller, or at least one Lisa
|
|
44
|
+
* caller line could not be read (`unparsed`).
|
|
36
45
|
* 2 — operational/usage error: unknown flag, a flag missing its value, a
|
|
37
46
|
* `--project` that isn't a directory, or a filesystem error while scanning.
|
|
38
47
|
*
|
|
@@ -48,6 +57,7 @@ import {
|
|
|
48
57
|
diffStaleKeys,
|
|
49
58
|
extractCallerJobs,
|
|
50
59
|
extractDeclaredInputs,
|
|
60
|
+
findUnparsedLisaCallerLines,
|
|
51
61
|
parseReusableReference,
|
|
52
62
|
} from "./lib/reusable-workflow-contract.mjs";
|
|
53
63
|
|
|
@@ -55,6 +65,7 @@ export {
|
|
|
55
65
|
diffStaleKeys,
|
|
56
66
|
extractCallerJobs,
|
|
57
67
|
extractDeclaredInputs,
|
|
68
|
+
findUnparsedLisaCallerLines,
|
|
58
69
|
parseReusableReference,
|
|
59
70
|
};
|
|
60
71
|
|
|
@@ -103,22 +114,49 @@ function resolveContractInputs(contractsRoot, reusableFile) {
|
|
|
103
114
|
return extractDeclaredInputs(fs.readFileSync(contractPath, "utf8"));
|
|
104
115
|
}
|
|
105
116
|
|
|
117
|
+
/**
|
|
118
|
+
* Whether a parsed caller job calls one of Lisa's reusable workflows. Owner and
|
|
119
|
+
* repository compare case-insensitively, as GitHub resolves them.
|
|
120
|
+
*
|
|
121
|
+
* @param {{ owner?: string | null, repo?: string | null }} job - a caller row.
|
|
122
|
+
* @returns {boolean} true for a Lisa caller.
|
|
123
|
+
*/
|
|
124
|
+
function isLisaCaller(job) {
|
|
125
|
+
return (
|
|
126
|
+
job.owner?.toLowerCase() === LISA_OWNER &&
|
|
127
|
+
job.repo?.toLowerCase() === LISA_REPO
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
106
131
|
/**
|
|
107
132
|
* Scan one caller workflow file and classify each of its reusable-workflow
|
|
108
133
|
* jobs against the contracts root.
|
|
109
134
|
*
|
|
110
135
|
* @param {string} filePath - absolute path to the caller workflow file.
|
|
111
136
|
* @param {string} contractsRoot - directory holding current reusable workflows.
|
|
112
|
-
* @returns {{ reusableFile: string, ref: string, withKeys: string[], staleInputs: string[], status: "ok" | "stale" | "unknown-contract" }[]}
|
|
113
|
-
* one row per reusable-workflow job found in the file
|
|
137
|
+
* @returns {{ reusableFile: string | null, ref: string | null, withKeys: string[], staleInputs: string[], status: "ok" | "stale" | "unknown-contract" | "unparsed", line?: number, text?: string }[]}
|
|
138
|
+
* one row per reusable-workflow job found in the file, plus one `unparsed`
|
|
139
|
+
* row per line naming a Lisa reusable workflow that the parser could not
|
|
140
|
+
* read.
|
|
114
141
|
*/
|
|
115
142
|
function scanCallerFile(filePath, contractsRoot) {
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
143
|
+
const content = fs.readFileSync(filePath, "utf8");
|
|
144
|
+
const jobs = extractCallerJobs(content);
|
|
145
|
+
// Fail closed (#4641): a Lisa caller line the parser cannot read must be
|
|
146
|
+
// reported, never silently counted as "nothing stale".
|
|
147
|
+
const unparsed = findUnparsedLisaCallerLines(content).map(entry => ({
|
|
148
|
+
line: entry.line,
|
|
149
|
+
owner: null,
|
|
150
|
+
ref: null,
|
|
151
|
+
repo: null,
|
|
152
|
+
reusableFile: null,
|
|
153
|
+
staleInputs: [],
|
|
154
|
+
status: "unparsed",
|
|
155
|
+
text: entry.text,
|
|
156
|
+
withKeys: [],
|
|
157
|
+
}));
|
|
158
|
+
const classified = jobs.map(job => {
|
|
159
|
+
const declared = isLisaCaller(job)
|
|
122
160
|
? resolveContractInputs(contractsRoot, job.reusableFile)
|
|
123
161
|
: null;
|
|
124
162
|
if (declared === null) {
|
|
@@ -131,6 +169,7 @@ function scanCallerFile(filePath, contractsRoot) {
|
|
|
131
169
|
status: staleInputs.length > 0 ? "stale" : "ok",
|
|
132
170
|
};
|
|
133
171
|
});
|
|
172
|
+
return [...classified, ...unparsed];
|
|
134
173
|
}
|
|
135
174
|
|
|
136
175
|
/**
|
|
@@ -175,16 +214,21 @@ export function buildReport(results, opts) {
|
|
|
175
214
|
const unknownContract = results.filter(
|
|
176
215
|
r => r.status === "unknown-contract"
|
|
177
216
|
).length;
|
|
217
|
+
const unparsed = results.filter(r => r.status === "unparsed").length;
|
|
218
|
+
// An unparsed line is a caller the detector could NOT check, so it is
|
|
219
|
+
// reported separately and never counted among the caller jobs scanned.
|
|
220
|
+
const scanned = results.length - unparsed;
|
|
178
221
|
return {
|
|
179
222
|
contractsRoot: opts.contractsRoot,
|
|
180
223
|
projects: opts.projects,
|
|
181
224
|
results,
|
|
182
225
|
schemaVersion: 1,
|
|
183
226
|
summary: {
|
|
184
|
-
ok:
|
|
185
|
-
scanned
|
|
227
|
+
ok: scanned - stale - unknownContract,
|
|
228
|
+
scanned,
|
|
186
229
|
stale,
|
|
187
230
|
unknownContract,
|
|
231
|
+
unparsed,
|
|
188
232
|
},
|
|
189
233
|
};
|
|
190
234
|
}
|
|
@@ -203,10 +247,42 @@ function cell(value) {
|
|
|
203
247
|
return text === "" ? "-" : text.replace(/\r?\n/g, " ").replace(/\|/g, "\\|");
|
|
204
248
|
}
|
|
205
249
|
|
|
250
|
+
/**
|
|
251
|
+
* Render the summary line under the human-readable table.
|
|
252
|
+
*
|
|
253
|
+
* A project with no Lisa caller is stated outright, so a reader can tell
|
|
254
|
+
* "nothing of Lisa's to check" apart from "checked and clean" (#4641) — also
|
|
255
|
+
* when the project has third-party callers that were counted. Unreadable Lisa
|
|
256
|
+
* caller lines get a hint naming the shape the detector needs; when nothing
|
|
257
|
+
* else was scanned, that hint leads and the "0 of 0" counts are dropped.
|
|
258
|
+
*
|
|
259
|
+
* @param {{ scanned: number, stale: number, unknownContract: number, unparsed: number }} summary
|
|
260
|
+
* the report's summary counts.
|
|
261
|
+
* @param {boolean} hasLisaCaller - whether any row is a Lisa caller, parsed or
|
|
262
|
+
* not.
|
|
263
|
+
* @returns {string} the summary line.
|
|
264
|
+
*/
|
|
265
|
+
function summaryLine(summary, hasLisaCaller) {
|
|
266
|
+
const noLisa = "no Lisa reusable-workflow callers found";
|
|
267
|
+
if (summary.scanned === 0 && !hasLisaCaller) {
|
|
268
|
+
return `${noLisa} — nothing to check`;
|
|
269
|
+
}
|
|
270
|
+
// Detection stays fail-closed: any non-comment line naming a Lisa workflow
|
|
271
|
+
// path is listed. The hint covers both reasons a line can land here, so an
|
|
272
|
+
// operator is not told to "fix" a caller that is really prose in a script.
|
|
273
|
+
const unparsed = `${summary.unparsed} Lisa caller line(s) could not be read. If a listed line is a real caller, rewrite it as \`uses: CodySwannGT/lisa/.github/workflows/<file>@<ref>\`; if it only mentions the path (for example inside a \`run:\` script), reword or move that text.`;
|
|
274
|
+
if (summary.scanned === 0 && summary.unparsed > 0) {
|
|
275
|
+
return unparsed;
|
|
276
|
+
}
|
|
277
|
+
const counts = `${summary.stale} of ${summary.scanned} caller jobs have stale inputs (${summary.unknownContract} unresolvable contract(s))`;
|
|
278
|
+
const tail = summary.unparsed > 0 ? `; ${unparsed}` : "";
|
|
279
|
+
return `${counts}${tail}${hasLisaCaller ? "" : ` — ${noLisa}`}`;
|
|
280
|
+
}
|
|
281
|
+
|
|
206
282
|
/**
|
|
207
283
|
* Render the human-readable markdown table + summary line.
|
|
208
284
|
*
|
|
209
|
-
* @param {{ results: ReadonlyArray<Record<string, unknown>>, summary: { scanned: number, stale: number, unknownContract: number } }} report
|
|
285
|
+
* @param {{ results: ReadonlyArray<Record<string, unknown>>, summary: { scanned: number, stale: number, unknownContract: number, unparsed: number } }} report
|
|
210
286
|
* the report object.
|
|
211
287
|
* @returns {string} the rendered table.
|
|
212
288
|
*/
|
|
@@ -216,10 +292,12 @@ function humanTable(report) {
|
|
|
216
292
|
"| --- | --- | --- | --- | --- |";
|
|
217
293
|
const rows = report.results.map(
|
|
218
294
|
r =>
|
|
219
|
-
`| ${cell(r.project)} | ${cell(r.file)} | ${cell(r.reusableFile)} | ${cell(r.staleInputs)} | ${cell(r.status)} |`
|
|
295
|
+
`| ${cell(r.project)} | ${cell(r.line === undefined ? r.file : `${r.file}:${r.line}`)} | ${cell(r.reusableFile)} | ${cell(r.staleInputs)} | ${cell(r.status)} |`
|
|
296
|
+
);
|
|
297
|
+
const hasLisaCaller = report.results.some(
|
|
298
|
+
r => r.status === "unparsed" || isLisaCaller(r)
|
|
220
299
|
);
|
|
221
|
-
|
|
222
|
-
return [header, ...rows].join("\n") + summary;
|
|
300
|
+
return `${[header, ...rows].join("\n")}\n${summaryLine(report.summary, hasLisaCaller)}`;
|
|
223
301
|
}
|
|
224
302
|
|
|
225
303
|
/**
|
|
@@ -282,7 +360,8 @@ export function parseArgs(argv) {
|
|
|
282
360
|
* @param {readonly string[]} argv - arguments (without node/script prefix).
|
|
283
361
|
* @param {{ stdout?: { write(s: string): void }, stderr?: { write(s: string): void } }} [io]
|
|
284
362
|
* injectable streams (defaults to process streams).
|
|
285
|
-
* @returns {number} the exit code (0 ok, 1 stale found, 2 usage
|
|
363
|
+
* @returns {number} the exit code (0 ok, 1 stale or unparsed found, 2 usage
|
|
364
|
+
* error).
|
|
286
365
|
*/
|
|
287
366
|
export function main(argv, io = {}) {
|
|
288
367
|
const out = io.stdout ?? process.stdout;
|
|
@@ -317,7 +396,9 @@ export function main(argv, io = {}) {
|
|
|
317
396
|
}
|
|
318
397
|
const report = buildReport(results, opts);
|
|
319
398
|
emitReport(out, report, opts.json);
|
|
320
|
-
return results.some(r => r.status === "stale"
|
|
399
|
+
return results.some(r => r.status === "stale" || r.status === "unparsed")
|
|
400
|
+
? 1
|
|
401
|
+
: 0;
|
|
321
402
|
}
|
|
322
403
|
|
|
323
404
|
if (invokedAsScript(import.meta.url)) {
|
|
@@ -15,6 +15,16 @@ export function parseReusableReference(usesValue: string): {
|
|
|
15
15
|
export function extractCallerJobs(
|
|
16
16
|
content: string
|
|
17
17
|
): readonly ReusableCallerJob[];
|
|
18
|
+
export interface UnparsedLisaCallerLine {
|
|
19
|
+
/** 1-based line number within the file. */
|
|
20
|
+
readonly line: number;
|
|
21
|
+
/** The line's text, trimmed. */
|
|
22
|
+
readonly text: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function findUnparsedLisaCallerLines(
|
|
26
|
+
content: string
|
|
27
|
+
): readonly UnparsedLisaCallerLine[];
|
|
18
28
|
export function extractDeclaredInputs(
|
|
19
29
|
content: string
|
|
20
30
|
): readonly string[] | null;
|
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
/** Pure reusable-workflow caller/contract comparison shared by health and CLI. */
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* A job-level `uses:` line, in every shape Lisa itself writes.
|
|
5
|
+
*
|
|
6
|
+
* `src/core/reusable-workflow-pin.ts` rewrites each caller to
|
|
7
|
+
* `uses: <owner>/<repo>/.github/workflows/<file>@<sha> # v<version>`, keeping
|
|
8
|
+
* any surrounding quotes. This pattern accepts that shape: an optional matching
|
|
9
|
+
* `"` or `'` around the reference and an optional trailing YAML comment. It
|
|
10
|
+
* used to be end-anchored right after the reference, so the pin comment made
|
|
11
|
+
* every pinned caller invisible and both stale-input checks passed having
|
|
12
|
+
* compared nothing (CodySwannGT/lisa#4641). A round-trip test keeps the
|
|
13
|
+
* pinner's output and this reader in agreement.
|
|
14
|
+
*
|
|
15
|
+
* A `#` starts a YAML comment only after whitespace: `@main#note` is the ref
|
|
16
|
+
* `main#note` to GitHub, so that shape is rejected here (and then reported as
|
|
17
|
+
* unparsed) rather than read as ref `main`.
|
|
18
|
+
*
|
|
19
|
+
* Split in two so each pattern stays readable: `USES_LINE` finds the key and
|
|
20
|
+
* its indentation, `USES_VALUE` reads what follows it.
|
|
21
|
+
* `USES_VALUE` groups: 1 = double-quoted, 2 = single-quoted, 3 = bare value.
|
|
22
|
+
*/
|
|
23
|
+
const USES_LINE = /^(\s*)uses:[ \t]*(.*)$/;
|
|
24
|
+
const USES_VALUE =
|
|
25
|
+
/^(?:"([^"\s]+)"|'([^'\s]+)'|([^\s"'#]+))(?:[ \t]+#.*)?[ \t]*$/;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Any mention of a Lisa reusable workflow path. Owner and repository match
|
|
29
|
+
* case-insensitively, as GitHub resolves them.
|
|
30
|
+
*/
|
|
31
|
+
const LISA_WORKFLOW_PATH = /codyswanngt\/lisa\/\.github\/workflows\//i;
|
|
32
|
+
|
|
33
|
+
/** A line that is entirely a YAML comment. */
|
|
34
|
+
const COMMENT_LINE = /^\s*#/;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Parse one line as a reusable-workflow `uses:` reference.
|
|
38
|
+
*
|
|
39
|
+
* @param {string} line
|
|
40
|
+
* @returns {{ indentation: number, reference: { file: string, ref: string, owner: string | null, repo: string | null } } | null}
|
|
41
|
+
*/
|
|
42
|
+
function parseUsesLine(line) {
|
|
43
|
+
const match = USES_LINE.exec(line);
|
|
44
|
+
const value = match ? USES_VALUE.exec(match[2]) : null;
|
|
45
|
+
if (!match || !value) return null;
|
|
46
|
+
const reference = parseReusableReference(value[1] ?? value[2] ?? value[3]);
|
|
47
|
+
return reference ? { indentation: match[1].length, reference } : null;
|
|
48
|
+
}
|
|
49
|
+
|
|
3
50
|
/** @param {string} line @returns {number} */
|
|
4
51
|
function indentOf(line) {
|
|
5
52
|
return line.length - line.trimStart().length;
|
|
@@ -56,11 +103,9 @@ export function extractCallerJobs(content) {
|
|
|
56
103
|
const lines = content.split(/\r?\n/);
|
|
57
104
|
const jobs = [];
|
|
58
105
|
for (let index = 0; index < lines.length; index++) {
|
|
59
|
-
const
|
|
60
|
-
if (!
|
|
61
|
-
const reference =
|
|
62
|
-
if (!reference) continue;
|
|
63
|
-
const indentation = usesMatch[1].length;
|
|
106
|
+
const parsed = parseUsesLine(lines[index]);
|
|
107
|
+
if (!parsed) continue;
|
|
108
|
+
const { indentation, reference } = parsed;
|
|
64
109
|
let withKeys = [];
|
|
65
110
|
for (let child = index + 1; child < lines.length; child++) {
|
|
66
111
|
const line = lines[child];
|
|
@@ -85,6 +130,36 @@ export function extractCallerJobs(content) {
|
|
|
85
130
|
return jobs;
|
|
86
131
|
}
|
|
87
132
|
|
|
133
|
+
/**
|
|
134
|
+
* Every `uses:` line naming a Lisa reusable workflow that `extractCallerJobs`
|
|
135
|
+
* cannot read.
|
|
136
|
+
*
|
|
137
|
+
* Both stale-input checks treat "no callers parsed" as "nothing stale". A Lisa
|
|
138
|
+
* caller the parser skips is therefore a check that passes having inspected
|
|
139
|
+
* nothing — the failure CodySwannGT/lisa#4641 found on every pinned host. This
|
|
140
|
+
* lets each check fail closed: report the line instead of dropping it.
|
|
141
|
+
*
|
|
142
|
+
* Any non-comment line mentioning a Lisa reusable workflow path counts, not
|
|
143
|
+
* only `uses:` lines: a `uses:` value split onto the next line, or a flow
|
|
144
|
+
* mapping such as `job: { uses: … }`, is still a call the parser cannot check.
|
|
145
|
+
* Commented-out lines are documentation, not calls, and are never reported.
|
|
146
|
+
*
|
|
147
|
+
* @param {string} content
|
|
148
|
+
* @returns {{ line: number, text: string }[]} 1-based line number and the
|
|
149
|
+
* trimmed line text, in file order.
|
|
150
|
+
*/
|
|
151
|
+
export function findUnparsedLisaCallerLines(content) {
|
|
152
|
+
return content
|
|
153
|
+
.split(/\r?\n/)
|
|
154
|
+
.flatMap((line, index) =>
|
|
155
|
+
!COMMENT_LINE.test(line) &&
|
|
156
|
+
LISA_WORKFLOW_PATH.test(line) &&
|
|
157
|
+
parseUsesLine(line) === null
|
|
158
|
+
? [{ line: index + 1, text: line.trim() }]
|
|
159
|
+
: []
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
|
|
88
163
|
/** @param {string} content @returns {string[] | null} */
|
|
89
164
|
export function extractDeclaredInputs(content) {
|
|
90
165
|
const lines = content.split(/\r?\n/);
|