@tablation/crew 0.130.5 → 0.130.6

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 +39 -12
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -4751,7 +4751,10 @@ The \`${f.hook}\` hook (\`${f.label}\`) printed, last lines:
4751
4751
  ${f.tail}
4752
4752
  \`\`\``;
4753
4753
  }
4754
- function describeRelease(o, route2) {
4754
+ function describeRelease(o, route2, where) {
4755
+ const shipNote = where?.ship ? `
4756
+
4757
+ Failed on ship ${where.ship}${where.runner === "sandbox" ? " (sandbox runner, released on the host rather than from a release sandbox)" : ""}; other ships' releases of this repository are unaffected.` : "";
4755
4758
  if (o.integrated) {
4756
4759
  return {
4757
4760
  level: "ok",
@@ -4787,7 +4790,7 @@ ${o.isolation}` : ""),
4787
4790
  level: "fail",
4788
4791
  headline: `${route2}: release blocked \u2014 setup failed`,
4789
4792
  detail: withHookTail(
4790
- "the setup hook failed in the release checkout; the target stays on the previous release",
4793
+ `the setup hook failed in the release checkout; the target stays on the previous release${shipNote}`,
4791
4794
  o.hookFailure
4792
4795
  )
4793
4796
  };
@@ -5059,7 +5062,11 @@ ${userLine}ExecStart=${[...crewInvocation(crewHome), ...subcommandFor(job, "syst
5059
5062
  WorkingDirectory=${crewHome}
5060
5063
  ${systemdEnvLines(ship)}
5061
5064
  StandardOutput=append:${schedulerLog}
5062
- StandardError=append:${schedulerLog}
5065
+ StandardError=append:${schedulerLog}${job === "passengers" ? `
5066
+ # CREW-2994: the sync spawns the relay tunnel (a detached ssh) and exits. The
5067
+ # default KillMode=control-group would kill that ssh with the rest of this
5068
+ # one-shot unit's cgroup, so no tunnel would ever survive to "connected".
5069
+ KillMode=process` : ""}
5063
5070
  `;
5064
5071
  const timer = `# Written by \`crew install\` \u2014 re-run it rather than hand-editing this file.
5065
5072
  [Unit]
@@ -16106,7 +16113,7 @@ function readAllPersistedWorkspaceIds(stateDir) {
16106
16113
  }
16107
16114
  var TUNNEL_REJECTED_KEY = "tunnel_rejected";
16108
16115
  function tunnelRejectedMessage(workspaceId, quickExits) {
16109
- return `the relay tunnel for workspace ${workspaceId} exited before settling on ${quickExits} consecutive cycles, which is how a refused claim looks (the relay logs "slug already owned by another workspace/ssh key") \u2014 rotate the slug with \`crew rotate-passenger-url\` or check the relay journal`;
16116
+ return `the relay tunnel for workspace ${workspaceId} exited before settling on ${quickExits} consecutive cycles, which is how a refused claim looks (the relay logs "slug already owned by another workspace/ssh key") \u2014 rotate the slug with \`crew rotate-passenger-url\` or check the relay journal. If the relay logged no rejection, a Linux passengers unit without KillMode=process kills the tunnel when the sync exits (CREW-2994): run \`crew install\`, and see \`crew doctor\``;
16110
16117
  }
16111
16118
  function rejectedTunnels(stateDir) {
16112
16119
  const out = [];
@@ -20015,6 +20022,9 @@ function mirrorOutcome(m) {
20015
20022
  function lacksCheckout(ship, dir) {
20016
20023
  return ship.runner === "sandbox" && !existsSync39(dir) && !remoteOf(dir);
20017
20024
  }
20025
+ function skipsHostCheckout(ship) {
20026
+ return ship.runner === "sandbox";
20027
+ }
20018
20028
  function mirrorRepoOfTarget(t) {
20019
20029
  return mirrorRepoOf({ remote: t.remote, forgeHost: t.forgeHost });
20020
20030
  }
@@ -24484,7 +24494,7 @@ async function runRoleAgentLocked(role, decision, ctx, hooks, held) {
24484
24494
  const target = repoTargetFor(route2, result.ticket.repo_id);
24485
24495
  ticketRepo = target?.name;
24486
24496
  try {
24487
- if (target && ensureRepoCheckout(target.dir, target.remote, { scheme: ship.cloneScheme, host: target.forgeHost })) {
24497
+ if (target && !skipsHostCheckout(ship) && ensureRepoCheckout(target.dir, target.remote, { scheme: ship.cloneScheme, host: target.forgeHost })) {
24488
24498
  emit.emit(`cloned ${target.name} into ${target.dir}`, { step: "select", role });
24489
24499
  }
24490
24500
  } catch (e) {
@@ -26974,7 +26984,7 @@ ${changed2.map((c) => ` - ${c}
26974
26984
  async function releasePhase(c, target, opts = {}) {
26975
26985
  const scope = releaseLockScope(c.route, target.name);
26976
26986
  const remit = emit.forRoute(c.route);
26977
- if (lacksCheckout(cfg.ship, target.dir)) {
26987
+ if (cfg.ship.runner === "sandbox") {
26978
26988
  let mode = null;
26979
26989
  let contract = null;
26980
26990
  const settings = cacheSettingsOf(cfg.ship.sandbox);
@@ -26990,9 +27000,11 @@ ${changed2.map((c) => ` - ${c}
26990
27000
  if (releasesFromSandbox(mode) && settings && mirror && contract) {
26991
27001
  return releaseFromSandbox(c, target, contract, mirror, opts);
26992
27002
  }
26993
- const note = noCheckoutReleaseNote(target.name, mode);
26994
- if (firstReport(`${scope0(c, target)}:release`)) remit.emit(note, { step: "release" });
26995
- return { scope: releaseLockScope(c.route, target.name), tests: "skipped", outcome: "skipped", detail: note };
27003
+ if (lacksCheckout(cfg.ship, target.dir)) {
27004
+ const note = noCheckoutReleaseNote(target.name, mode);
27005
+ if (firstReport(`${scope0(c, target)}:release`)) remit.emit(note, { step: "release" });
27006
+ return { scope: releaseLockScope(c.route, target.name), tests: "skipped", outcome: "skipped", detail: note };
27007
+ }
26996
27008
  }
26997
27009
  const relLock = dryRun ? void 0 : state.acquire(`release-${scope}`);
26998
27010
  if (relLock && !relLock.ok) {
@@ -27317,7 +27329,7 @@ ${changed2.map((c) => ` - ${c}
27317
27329
  }
27318
27330
  return placement;
27319
27331
  };
27320
- const news = describeRelease(outcome, scope);
27332
+ const news = describeRelease(outcome, scope, { ship: cfg.ship.name, runner: cfg.ship.runner });
27321
27333
  if (news) {
27322
27334
  const notified = await notify(c, cfg.ship, news, remit, dryRun);
27323
27335
  if (!notified && news.level === "fail") {
@@ -27655,7 +27667,7 @@ ${cu.tail.trimEnd()}
27655
27667
  const target = repoTargetFor(w.route, result.ticket.repo_id);
27656
27668
  fleetTicketRepo = target?.name;
27657
27669
  try {
27658
- if (target && ensureRepoCheckout(target.dir, target.remote, { scheme: cfg.ship.cloneScheme, host: target.forgeHost })) {
27670
+ if (target && !skipsHostCheckout(cfg.ship) && ensureRepoCheckout(target.dir, target.remote, { scheme: cfg.ship.cloneScheme, host: target.forgeHost })) {
27659
27671
  wemit.emit(`cloned ${target.name} into ${target.dir}`, { step: "select", role: w.role });
27660
27672
  }
27661
27673
  } catch (e) {
@@ -27873,7 +27885,7 @@ ${cu.tail.trimEnd()}
27873
27885
  const target = repoTargetFor(route2, result.ticket.repo_id);
27874
27886
  ticketRepo = target?.name;
27875
27887
  try {
27876
- if (target && ensureRepoCheckout(target.dir, target.remote, { scheme: cfg.ship.cloneScheme, host: target.forgeHost })) {
27888
+ if (target && !skipsHostCheckout(cfg.ship) && ensureRepoCheckout(target.dir, target.remote, { scheme: cfg.ship.cloneScheme, host: target.forgeHost })) {
27877
27889
  emit.emit(`cloned ${target.name} into ${target.dir}`, { step: "select", role: current });
27878
27890
  }
27879
27891
  } catch (e) {
@@ -31414,6 +31426,21 @@ routes: ${cfg.routes.map((c) => c.route).join(", ")}
31414
31426
  );
31415
31427
  }
31416
31428
  }
31429
+ if (host === "linux" && detectSystemd() && cfg.ship.relayHost) {
31430
+ const pPlan = planInstall(cfg.ship, CREW_HOME, host, true, "passengers", installContext());
31431
+ const keeps = unitAbandonsAgents(pPlan, (p) => {
31432
+ try {
31433
+ return readFileSync47(p, "utf8");
31434
+ } catch {
31435
+ return null;
31436
+ }
31437
+ });
31438
+ if (keeps === false) {
31439
+ process.stdout.write(
31440
+ "passengers unit: WARN the installed unit lacks KillMode=process, so systemd kills the relay tunnel each time the sync exits (tunnel never reaches connected); run `crew install`\n"
31441
+ );
31442
+ }
31443
+ }
31417
31444
  if (host === "linux" && detectSystemd()) {
31418
31445
  const ctl = planDaemonControl(CREW_HOME, host, true);
31419
31446
  const unitPlan = planInstall(cfg.ship, CREW_HOME, host, true, "run", installContext());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tablation/crew",
3
- "version": "0.130.5",
3
+ "version": "0.130.6",
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",