@kitman-sh/software-engineering 0.10.103 → 0.10.105
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 +4 -3
- package/dist/declarations.json +1 -1
- package/package.json +3 -3
- package/src/build.ts +2 -1
- package/src/shepherd.ts +10 -4
package/dist/bundle.js
CHANGED
|
@@ -22117,7 +22117,8 @@ ${open}`,
|
|
|
22117
22117
|
else
|
|
22118
22118
|
return found;
|
|
22119
22119
|
}
|
|
22120
|
-
const
|
|
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.
|
|
30560
|
+
runKit(kitman_config_default, { name: "@kitman-sh/software-engineering", version: "0.10.105" }, []);
|
package/dist/declarations.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitman-sh/software-engineering",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.105",
|
|
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.
|
|
20
|
+
"@kitman-sh/sdk": "0.10.105",
|
|
21
21
|
"effect": "^4.1.2"
|
|
22
22
|
},
|
|
23
23
|
"kitman": {
|
|
24
24
|
"bundle": "dist/bundle.js",
|
|
25
|
-
"digest": "
|
|
25
|
+
"digest": "a2c4d356ad81b1a3ded756e06522af80507387db4e84bb75de75e9e0d66a3ee4",
|
|
26
26
|
"protocolVersion": 5,
|
|
27
27
|
"declarations": "dist/declarations.json",
|
|
28
28
|
"setup": {
|
package/src/build.ts
CHANGED
|
@@ -439,7 +439,8 @@ const build = defineLoop({
|
|
|
439
439
|
|
|
440
440
|
const task = input.words === undefined ? 'the Task your brief describes.' : `this: ${input.words}`
|
|
441
441
|
const outcome = input.outcome
|
|
442
|
-
// A retry carries the Run's
|
|
442
|
+
// A retry carries the earlier Run's branch as `branch`, or the branch that Run started from when it never pushed;
|
|
443
|
+
// the ChangeRequest it continues says what it merges into.
|
|
443
444
|
const target = input.continuing?.targetBranch ?? input.branch
|
|
444
445
|
|
|
445
446
|
if (input.changeRequestId !== undefined && input.continuing?.changeRequestId !== input.changeRequestId)
|
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
|
|
211
|
-
* in before any pipeline is run or fixed
|
|
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
|
-
|
|
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
|
-
|
|
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)
|