pr-shepherd 0.25.1 → 0.25.2
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.
|
@@ -10,14 +10,16 @@ Usage:
|
|
|
10
10
|
[--require-sha SHA] [--format text|json]
|
|
11
11
|
|
|
12
12
|
Flags:
|
|
13
|
-
--resolve-thread-ids <ids> Comma-separated review thread IDs to resolve.
|
|
13
|
+
--resolve-thread-ids <ids> Comma-separated review thread IDs (PRRT_*) to resolve.
|
|
14
14
|
Human-authored thread IDs are skipped; use --reply-thread-ids.
|
|
15
|
+
Note: comment IDs (PRRC_*) from gh api are not thread IDs and will fail.
|
|
15
16
|
--reply-thread-ids <ids> Comma-separated human review thread IDs to reply to.
|
|
16
17
|
--minimize-comment-ids <ids> Comma-separated issue/review comment IDs to minimize.
|
|
17
18
|
--dismiss-review-ids <ids> Comma-separated CHANGES_REQUESTED review IDs to dismiss.
|
|
18
19
|
--message <text> Reply/dismiss message. Required with --reply-thread-ids
|
|
19
20
|
or --dismiss-review-ids.
|
|
20
21
|
--require-sha <sha> Wait until GitHub reports this PR head SHA before mutating.
|
|
22
|
+
Must be a full 40-character lowercase hex SHA. Use $(git rev-parse HEAD).
|
|
21
23
|
--format text|json Output format. Default: text.
|
|
22
24
|
--help, -h Print this help and exit before GitHub I/O.
|
|
23
25
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function warnPrrcThreadIds(ids) {
|
|
2
|
+
const prrcIds = ids.filter((id) => id.startsWith("PRRC_"));
|
|
3
|
+
if (prrcIds.length > 0) {
|
|
4
|
+
process.stderr.write(`pr-shepherd: resolve: warning: --resolve-thread-ids contains comment IDs (PRRC_*) instead of thread IDs (PRRT_*): ${prrcIds.join(", ")}. The resolveReviewThread mutation requires PRRT_* thread IDs. Run a GraphQL query for pullRequest.reviewThreads to get the correct IDs.\n`);
|
|
5
|
+
}
|
|
6
|
+
return prrcIds;
|
|
7
|
+
}
|
|
8
|
+
export function validateRequireSha(sha) {
|
|
9
|
+
if (sha === undefined)
|
|
10
|
+
return true;
|
|
11
|
+
if (/^[0-9a-f]{40}$/.test(sha))
|
|
12
|
+
return true;
|
|
13
|
+
process.stderr.write(`pr-shepherd: resolve: --require-sha must be a full 40-character lowercase hex SHA, got "${sha}". Short SHAs will never match GitHub's headRefOid. Use $(git rev-parse HEAD) to get the full SHA.\n`);
|
|
14
|
+
process.exitCode = 1;
|
|
15
|
+
return false;
|
|
16
|
+
}
|
package/bin/cli-parser.mjs
CHANGED
|
@@ -30,6 +30,7 @@ import { USAGE, maybePrintHelp } from "./cli/help.mjs";
|
|
|
30
30
|
import { formatMutateResult } from "./cli/formatters.mjs";
|
|
31
31
|
import { handleClean, handleCommitSuggestion, handleIterate, handleMarkFilesAsViewed, } from "./cli/handlers.mjs";
|
|
32
32
|
import { handlePoll } from "./cli/poll-handler.mjs";
|
|
33
|
+
import { warnPrrcThreadIds, validateRequireSha } from "./cli/resolve-validators.mjs";
|
|
33
34
|
import { setupLog } from "./log/setup.mjs";
|
|
34
35
|
// ---------------------------------------------------------------------------
|
|
35
36
|
// Entry
|
|
@@ -130,6 +131,9 @@ async function handleResolve(args) {
|
|
|
130
131
|
const dismissReviewIds = parseList(getFlag(extra, "--dismiss-review-ids"));
|
|
131
132
|
const dismissMessage = getFlag(extra, "--message") ?? undefined;
|
|
132
133
|
const requireSha = getFlag(extra, "--require-sha") ?? undefined;
|
|
134
|
+
warnPrrcThreadIds(resolveThreadIds);
|
|
135
|
+
if (!validateRequireSha(requireSha))
|
|
136
|
+
return;
|
|
133
137
|
if (hasFlag(extra, "--fetch")) {
|
|
134
138
|
process.stderr.write("pr-shepherd: resolve: --fetch has been removed; run pr-shepherd iterate or poll to fetch the next action.\n");
|
|
135
139
|
process.exitCode = 1;
|
|
@@ -8,6 +8,7 @@ export function classifyVisibleComments(comments, seenMap, minimizeComments, bot
|
|
|
8
8
|
if (shouldMinimizeAuthor(c.authorType, minimizeComments, c.author, botUsernames)) {
|
|
9
9
|
actionable.push(c);
|
|
10
10
|
minimizeIds.push(c.id);
|
|
11
|
+
toMarkSeen.push(c); // prevents re-surfacing as first-look after GitHub marks it minimized
|
|
11
12
|
continue;
|
|
12
13
|
}
|
|
13
14
|
const cls = classifyItem(c.id, c.body, seenMap);
|
package/package.json
CHANGED