@tablation/crew 0.49.0 → 0.49.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.
Files changed (2) hide show
  1. package/dist/cli.js +19 -4
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -8691,8 +8691,13 @@ ${v.reason[0].toUpperCase()}${v.reason.slice(1)}. Set back to \`in_progress\`, s
8691
8691
  async function enforceHandoff(i) {
8692
8692
  try {
8693
8693
  const t = await i.writer.ticket(i.ticketId);
8694
- if (t.status !== i.contract.statuses.handoff) return { kind: "not-handed-off" };
8694
+ const st = i.contract.statuses;
8695
8695
  const log = { ticket: t.issue_id, step: "handoff" };
8696
+ const claimed = [st.verifying, st.verified, st.deployed].some((s) => s && t.status === s);
8697
+ if (t.status !== st.handoff && !claimed) {
8698
+ i.log.emit(`${t.issue_id} is at ${t.status}, not handed off \u2014 nothing to check`, log);
8699
+ return { kind: "not-handed-off" };
8700
+ }
8696
8701
  const v = inspectHandoff(i.dir, i.cfg, t, i.role);
8697
8702
  if (v.kind === "unverified") {
8698
8703
  i.log.warn(`${t.issue_id} is at ${t.status} but the push was not checked: ${v.why}`, log);
@@ -8703,6 +8708,10 @@ async function enforceHandoff(i) {
8703
8708
  i.log.emit(`${t.issue_id} pushed at ${v.sha.slice(0, 7)} \u2014 handed on to QA`, log);
8704
8709
  return { kind: "pushed", sha: v.sha };
8705
8710
  }
8711
+ if (claimed) {
8712
+ i.log.warn(`${t.issue_id} is at ${t.status} but its branch is not on the remote at HEAD: ${v.reason}`, log);
8713
+ return { kind: "failed", why: v.reason };
8714
+ }
8706
8715
  const heldBy = i.hold ? t[i.hold.column] : void 0;
8707
8716
  await i.writer.updateTicket(t.id, {
8708
8717
  status: i.contract.statuses.building,
@@ -9244,10 +9253,10 @@ function movedPast(r, t, branch, pushedAs) {
9244
9253
  const head = resolve2(r.cwd, branch);
9245
9254
  const remoteHead = resolve2(r.cwd, `${r.repo.branch.remote}/${pushedAs}`);
9246
9255
  if (remoteHead && !isAncestor(r.cwd, remoteHead, verified) && remoteHead !== head) {
9247
- return { ticket: t, verified, head: remoteHead };
9256
+ return { ticket: t, verified, head: remoteHead, branch: pushedAs };
9248
9257
  }
9249
9258
  if (head && head !== verified && !isAncestor(r.cwd, head, verified)) {
9250
- return { ticket: t, verified, head };
9259
+ return { ticket: t, verified, head, branch: pushedAs };
9251
9260
  }
9252
9261
  return null;
9253
9262
  }
@@ -9336,6 +9345,12 @@ ${h.prFailure.tail}
9336
9345
  try {
9337
9346
  await tracker.updateTicket(t.id, { [contract.columns.status]: contract.statuses.handoff }, t.updated_at);
9338
9347
  await tracker.postEvent(t.id, body, seat, "requeued");
9348
+ await tracker.postEvent(
9349
+ t.id,
9350
+ pushedEventBody(q.head, remote, q.branch),
9351
+ seat,
9352
+ "pushed"
9353
+ );
9339
9354
  emit.emit(`returned to ${contract.statuses.handoff} \u2014 branch moved past ${q.verified.slice(0, 8)}`, { ticket: t.issue_id });
9340
9355
  } catch (e) {
9341
9356
  emit.warn(`could not return to ${contract.statuses.handoff}: ${e.message}`, { ticket: t.issue_id });
@@ -9769,7 +9784,7 @@ async function runReleaseCycle(o, movedPast2) {
9769
9784
  const moved = branch ? movedPastVerified(o.cwd, branch, verified) : null;
9770
9785
  if (!moved) continue;
9771
9786
  drop.add(t.id);
9772
- movedPast2.push({ ticket: t, verified: moved.verified, head: moved.tip });
9787
+ movedPast2.push({ ticket: t, verified: moved.verified, head: moved.tip, branch: pushedBranchForTicket(o.repo, t) });
9773
9788
  o.emit.error(
9774
9789
  `not releasing ${t.issue_id}: ${branch} is at ${moved.tip.slice(0, 8)}, past the ${moved.verified.slice(0, 8)} QA verified`,
9775
9790
  { ticket: t.issue_id }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tablation/crew",
3
- "version": "0.49.0",
3
+ "version": "0.49.2",
4
4
  "description": "A standing team of headless agents that picks work off a Tablation board, does it on a machine you control, and reports back.",
5
5
  "type": "module",
6
6
  "license": "MIT",