@chernabog/sdk 0.8.0 → 0.8.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/implement.ts +10 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chernabog/sdk",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "license": "MIT",
5
5
  "description": "The blocks Chernabog flows are written from (Implement, Review, Plan, Hybrid, PullRequest, prompts), over @chernabog/core, which it re-exports",
6
6
  "repository": {
package/src/implement.ts CHANGED
@@ -641,7 +641,16 @@ export const claim = (
641
641
  if ((yield* github.createBranch(branch, baseSha)) === "already-exists") {
642
642
  const latest = yield* latestClaim(issue);
643
643
 
644
+ // This run claimed it before, for an earlier attempt: the queue label
645
+ // comes off again, and a base the caller gives is the task's now,
646
+ // which may have moved since that claim (#249).
644
647
  if (Option.isSome(latest) && latest.value.runId === run.runId) {
648
+ yield* github.removeLabel(issue, label);
649
+
650
+ if (Option.isSome(Option.fromUndefinedOr(options.base))) {
651
+ return { branch, base };
652
+ }
653
+
645
654
  return { branch, base: yield* claimedBase(latest.value) };
646
655
  }
647
656
 
@@ -1267,6 +1276,7 @@ const waitForCiIn = <E, R>(
1267
1276
  `CI failed on pull request #${pullRequest}: ${failed}.`,
1268
1277
  `Read why with \`gh run list --branch ${target.branch} --limit 5\` and \`gh run view <run id> --log-failed\`.`,
1269
1278
  "Fix the cause and commit. A failure unrelated to your change may be re-run once with `gh run rerun <run id> --failed`. Then answer again.",
1279
+ `A check on the pull request's title or body is fixed on the pull request, not in a commit: \`gh pr edit ${pullRequest} --title "<title>"\` (or \`--body-file\`). Your answer's title is not applied again.`,
1270
1280
  ].join("\n"),
1271
1281
  target,
1272
1282
  );