next-issue 6.6.50 → 6.6.52

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
@@ -467,6 +467,9 @@ issues apart from your own and filter them.
467
467
  An empty `labels.ready` turns the ready requirement off. The harness then
468
468
  claims every open issue that no other label holds back.
469
469
 
470
+ The harness compares the labels on an issue with the configured names without
471
+ case, as GitHub does, so `Status:Todo` counts as `status:todo`.
472
+
470
473
  The log gives the reason for a skipped issue as `stop-label`, `not-ready`,
471
474
  `in-flight` or `blocked`, the last one with the open blockers.
472
475
 
package/dist/labels.mjs CHANGED
@@ -6,9 +6,12 @@ async function labelsOf(repo, kind, number) {
6
6
  return names(parsed.labels);
7
7
  }
8
8
  export function labelArgs(add, remove, current) {
9
- const stale = remove.filter((item) => item !== add && current.includes(item));
9
+ const stale = current.filter((label) => hasLabel(remove, label) && label.toLowerCase() !== add.toLowerCase());
10
10
  return ['--add-label', add, ...stale.flatMap((name) => ['--remove-label', name])];
11
11
  }
12
+ export function hasLabel(labels, name) {
13
+ return labels.some((label) => label.toLowerCase() === name.toLowerCase());
14
+ }
12
15
  export async function setLabel(repo, kind, number, add, remove) {
13
16
  await createUnknownLabel(repo, add);
14
17
  const current = await labelsOf(repo, kind, number);
package/dist/skip.mjs CHANGED
@@ -1,20 +1,21 @@
1
1
  import { elapsedMs } from './durations.mjs';
2
2
  import { message } from './errors.mjs';
3
3
  import { handOverReply } from './hand-over-comments.mjs';
4
+ import { hasLabel } from './labels.mjs';
4
5
  export function skipReason(issue, config, resuming, answered = false) {
5
- const labels = new Set(issue.labels);
6
+ const has = (name) => hasLabel(issue.labels, name);
6
7
  const names = config.labels;
7
- const waiting = labels.has(names.needsHuman) && !answered;
8
- if (labels.has(names.done) || waiting || labels.has(names.skip)) {
8
+ const waiting = has(names.needsHuman) && !answered;
9
+ if (has(names.done) || waiting || has(names.skip)) {
9
10
  return 'stop-label';
10
11
  }
11
12
  if (resuming) {
12
13
  return undefined;
13
14
  }
14
- if (names.ready.length > 0 && !labels.has(names.ready)) {
15
+ if (names.ready.length > 0 && !has(names.ready)) {
15
16
  return 'not-ready';
16
17
  }
17
- if (labels.has(names.inProgress) || labels.has(names.inReview)) {
18
+ if (has(names.inProgress) || has(names.inReview)) {
18
19
  return 'in-flight';
19
20
  }
20
21
  return undefined;
@@ -49,7 +50,7 @@ export async function skipReport(context, log, issue, saved, started) {
49
50
  return undefined;
50
51
  }
51
52
  async function hasAnswer(context, issue) {
52
- if (!issue.labels.includes(context.config.labels.needsHuman)) {
53
+ if (!hasLabel(issue.labels, context.config.labels.needsHuman)) {
53
54
  return false;
54
55
  }
55
56
  return (await handOverReply(context, issue.number)).length > 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "6.6.50",
3
+ "version": "6.6.52",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",