@kitman-sh/software-engineering 0.10.103 → 0.10.104

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/dist/bundle.js CHANGED
@@ -22117,7 +22117,8 @@ ${open}`,
22117
22117
  else
22118
22118
  return found;
22119
22119
  }
22120
- const blocked = pipeline.conflicts === true || pipeline.needsRebase === true;
22120
+ const pipelineFailed = pipeline.status === "failed" || pipeline.status === "canceled";
22121
+ const blocked = pipeline.conflicts === true || pipeline.needsRebase === true && pipelineFailed;
22121
22122
  const caughtUpHead = pipeline.head === pipelineFirst;
22122
22123
  const onRunnerDue = pipeline.status === "none" && pipeline.runnerChecks !== undefined;
22123
22124
  if (onRunnerDue && (!blocked || caughtUpHead)) {
@@ -22280,7 +22281,7 @@ ${open}`,
22280
22281
  });
22281
22282
  if (mergeable.type === commented.event)
22282
22283
  continue;
22283
- if (mergeable.payload.mergeable === false || behind) {
22284
+ if (mergeable.payload.mergeable === false && mergeable.payload.mergeState !== "need_rebase" || behind) {
22284
22285
  behind = false;
22285
22286
  const stopped = yield* catchUp(cycle, pipeline.target?.head);
22286
22287
  if (stopped !== undefined)
@@ -30556,4 +30557,4 @@ var runKit = (config, identity, packages) => {
30556
30557
  runMain2(program.pipe(flatMap3((code) => sync2(() => process.exit(code)))));
30557
30558
  };
30558
30559
  // .kitman-build-entry.ts
30559
- runKit(kitman_config_default, { name: "@kitman-sh/software-engineering", version: "0.10.103" }, []);
30560
+ runKit(kitman_config_default, { name: "@kitman-sh/software-engineering", version: "0.10.104" }, []);
@@ -3847,7 +3847,7 @@
3847
3847
  "carried": [
3848
3848
  {
3849
3849
  "name": "@kitman-sh/software-engineering",
3850
- "version": "0.10.103",
3850
+ "version": "0.10.104",
3851
3851
  "setup": "2a237548a69b0cd53ec3be7f687cfa8c2128335b3a655d34e185f2abce6a3c37",
3852
3852
  "loops": [
3853
3853
  "build",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitman-sh/software-engineering",
3
- "version": "0.10.103",
3
+ "version": "0.10.104",
4
4
  "description": "Everything for building software: Loops, their Agents, the skills they use and the Ponytail plugin.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -17,12 +17,12 @@
17
17
  "tsconfig.json"
18
18
  ],
19
19
  "dependencies": {
20
- "@kitman-sh/sdk": "0.10.103",
20
+ "@kitman-sh/sdk": "0.10.104",
21
21
  "effect": "^4.1.2"
22
22
  },
23
23
  "kitman": {
24
24
  "bundle": "dist/bundle.js",
25
- "digest": "aeb153e088e49af667ba693190cad78333740fee16e7ecf5b61061b21af2f03e",
25
+ "digest": "571aa8c507bfb0903017f9153f3a9fff34351be2cee095f3cb9734bb6b10ea03",
26
26
  "protocolVersion": 5,
27
27
  "declarations": "dist/declarations.json",
28
28
  "setup": {
package/src/shepherd.ts CHANGED
@@ -207,8 +207,9 @@ const threadKey = (thread: ReviewThreads['threads'][number]) => `${thread.id}:${
207
207
  * Takes an open ChangeRequest to merge: it waits on its Events with no model time between them, fixes a pipeline the
208
208
  * branch broke (after ruling out a flake and a target branch that fails the same check, which it waits out), answers
209
209
  * each new review thread on the thread, merges the target branch in when it is behind, and merges once approved, green
210
- * and mergeable when told to or when a person says so. A branch the forge says conflicts or is behind merges its target
211
- * in before any pipeline is run or fixed, and one whose merge Shepherd cannot settle goes back to Build. It merges the
210
+ * and mergeable when told to or when a person says so. A branch the forge says conflicts, or is behind with a failing
211
+ * pipeline, merges its target in before any pipeline is run or fixed; one that is only behind catches up when its merge
212
+ * finds it behind, on its turn. One whose merge Shepherd cannot settle goes back to Build. It merges the
212
213
  * target in and merges only while it holds the target's turn, so ChangeRequests for one target land one at a time, in
213
214
  * order. A head nobody approved gets a review of what changed since the last approved head, and the head a catch-up
214
215
  * pushed gets its pipeline started and its review as soon as the forge shows it, not once its pipeline passes. It runs one ci-fix and two
@@ -852,7 +853,11 @@ export default defineLoop({
852
853
  else return found
853
854
  }
854
855
 
855
- const blocked = pipeline.conflicts === true || pipeline.needsRebase === true
856
+ // Behind alone waits for the merge, which catches up while holding the turn: catching up any sooner is undone
857
+ // by every merge that lands before this one's turn. A failing pipeline catches up first, so a ci-fix never
858
+ // chases what the target already fixed.
859
+ const pipelineFailed = pipeline.status === 'failed' || pipeline.status === 'canceled'
860
+ const blocked = pipeline.conflicts === true || (pipeline.needsRebase === true && pipelineFailed)
856
861
  const caughtUpHead = pipeline.head === pipelineFirst
857
862
  // The forge runs no pipeline for this repository: its pipeline runs on a Runner and is reported to Kitman.
858
863
  const onRunnerDue = pipeline.status === 'none' && pipeline.runnerChecks !== undefined
@@ -1101,7 +1106,8 @@ export default defineLoop({
1101
1106
 
1102
1107
  if (mergeable.type === commented.event) continue
1103
1108
 
1104
- if (mergeable.payload.mergeable === false || behind) {
1109
+ // GitLab says `need_rebase` for a branch behind its target; the merge finds that and catches up on its turn.
1110
+ if ((mergeable.payload.mergeable === false && mergeable.payload.mergeState !== 'need_rebase') || behind) {
1105
1111
  behind = false
1106
1112
 
1107
1113
  const stopped = yield* catchUp(cycle, pipeline.target?.head)