pr-shepherd 0.32.0 → 0.32.1
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/README.md
CHANGED
package/bin/checks/classify.mjs
CHANGED
|
@@ -19,14 +19,37 @@ import picomatch from "picomatch";
|
|
|
19
19
|
export function classifyChecks(checks) {
|
|
20
20
|
const config = loadConfig();
|
|
21
21
|
const relevantEvents = new Set(config.checks.ciTriggerEvents);
|
|
22
|
-
const isIgnored =
|
|
23
|
-
|
|
22
|
+
const isIgnored = buildMatcher(config.ignoreChecks ?? []);
|
|
23
|
+
const isProtected = buildMatcher(config.actions.neverCancelRuns ?? []);
|
|
24
|
+
const protectedRunIds = buildProtectedRunIds(checks, isProtected);
|
|
25
|
+
return checks.map((c) => isIgnored(c.name) && !isProtectedCheck(c, protectedRunIds)
|
|
26
|
+
? { ...c, category: "ignored" }
|
|
27
|
+
: classify(c, relevantEvents));
|
|
24
28
|
}
|
|
25
|
-
function
|
|
29
|
+
function buildMatcher(patterns) {
|
|
26
30
|
if (patterns.length === 0)
|
|
27
31
|
return () => false;
|
|
28
32
|
return picomatch(patterns, { nocase: true });
|
|
29
33
|
}
|
|
34
|
+
function buildProtectedRunIds(checks, isProtected) {
|
|
35
|
+
const protectedRunIds = new Set();
|
|
36
|
+
for (const check of checks) {
|
|
37
|
+
if (check.runId == null)
|
|
38
|
+
continue;
|
|
39
|
+
if (protectedRunIds.has(check.runId) || checkMatchesProtection(check, isProtected)) {
|
|
40
|
+
protectedRunIds.add(check.runId);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return protectedRunIds;
|
|
44
|
+
}
|
|
45
|
+
function isProtectedCheck(check, protectedRunIds) {
|
|
46
|
+
return check.runId != null && protectedRunIds.has(check.runId);
|
|
47
|
+
}
|
|
48
|
+
function checkMatchesProtection(check, isProtected) {
|
|
49
|
+
return [check.workflowName, check.name]
|
|
50
|
+
.filter((name) => typeof name === "string" && name.trim() !== "")
|
|
51
|
+
.some((name) => isProtected(name));
|
|
52
|
+
}
|
|
30
53
|
function classify(check, relevantEvents) {
|
|
31
54
|
// Filter: runs from non-PR events don't count toward PR readiness.
|
|
32
55
|
// event === null means a commit StatusContext — these are always relevant regardless of ciTriggerEvents.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pr-shepherd",
|
|
3
|
-
"version": "0.32.
|
|
3
|
+
"version": "0.32.1",
|
|
4
4
|
"description": "Autonomous PR CI monitor and review-comment resolver for agentic coding tools",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Jonathan Ong",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@types/node": "^
|
|
36
|
+
"@types/node": "^26.0.0",
|
|
37
37
|
"@types/picomatch": "^4.0.3",
|
|
38
38
|
"@vitest/coverage-v8": "^4.1.4",
|
|
39
39
|
"husky": "^9.1.7",
|
|
40
40
|
"knip": "^6.14.1",
|
|
41
|
-
"oxfmt": "^0.
|
|
41
|
+
"oxfmt": "^0.56.0",
|
|
42
42
|
"oxlint": "^1.60.0",
|
|
43
43
|
"typescript": "^6.0.3",
|
|
44
44
|
"vitest": "^4.1.4"
|