@kitman-sh/software-engineering 0.13.1 → 0.13.3
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 +13 -4
- package/dist/declarations.json +2 -1
- package/package.json +3 -3
- package/src/release.ts +5 -1
- package/src/review.ts +15 -2
- package/src/shepherd.ts +2 -1
package/dist/bundle.js
CHANGED
|
@@ -20279,7 +20279,7 @@ var DeployWork = Struct({
|
|
|
20279
20279
|
runsScript: optionalKey2(Literal2(true))
|
|
20280
20280
|
});
|
|
20281
20281
|
var DeployOutcome = Struct({
|
|
20282
|
-
status: Literals(["deployed", "failed", "rolled_back", "rollback_failed", "none"]),
|
|
20282
|
+
status: Literals(["deployed", "published", "failed", "rolled_back", "rollback_failed", "none"]),
|
|
20283
20283
|
exitCode: optionalKey2(Int),
|
|
20284
20284
|
detail: String5.check(isMaxLength(1200))
|
|
20285
20285
|
});
|
|
@@ -21240,7 +21240,9 @@ class ReviewBaseUnpinned extends TaggedError3()("ReviewBaseUnpinned", {
|
|
|
21240
21240
|
message: String5
|
|
21241
21241
|
}) {
|
|
21242
21242
|
}
|
|
21243
|
-
var targetOf = (input, { base, head, branches }) => {
|
|
21243
|
+
var targetOf = (input, { base, head, branches, epic }) => {
|
|
21244
|
+
if (epic !== undefined)
|
|
21245
|
+
return `the epic's whole change \`git diff ${base}...${head}\` in your checkout: epic branch \`${epic.branch}\` against default branch \`${epic.defaultBranch}\`, as they stood when this review started. Fetch both from \`origin\` and diff exactly those commits, even if either branch has moved since.`;
|
|
21244
21246
|
if (input.changeRequestId !== undefined && branches !== undefined) {
|
|
21245
21247
|
const { source, target } = branches;
|
|
21246
21248
|
const from = source === undefined ? "" : ` from source branch \`${source}\``;
|
|
@@ -21274,6 +21276,11 @@ var pinnedRange = (input) => gen2(function* () {
|
|
|
21274
21276
|
branches: { source: status.sourceBranch, target: status.targetBranch }
|
|
21275
21277
|
};
|
|
21276
21278
|
}
|
|
21279
|
+
if ((input.base === undefined || input.head === undefined) && input.epic !== undefined) {
|
|
21280
|
+
const { branch, defaultBranch } = input.epic;
|
|
21281
|
+
const [base = "", head = ""] = yield* resolveRevisions("pin", [`origin/${defaultBranch}`, `origin/${branch}`]);
|
|
21282
|
+
return { base, head, epic: { branch, defaultBranch } };
|
|
21283
|
+
}
|
|
21277
21284
|
if (input.base === undefined || input.head === undefined)
|
|
21278
21285
|
return yield* new ReviewTargetMissing({ message: "Name a ChangeRequest, or both base and head revisions" });
|
|
21279
21286
|
const [base = "", head = ""] = yield* resolveRevisions("pin", [input.base, input.head]);
|
|
@@ -21568,6 +21575,7 @@ var Output2 = Struct({
|
|
|
21568
21575
|
"not_mergeable",
|
|
21569
21576
|
"rejected",
|
|
21570
21577
|
"deployed",
|
|
21578
|
+
"published",
|
|
21571
21579
|
"rolled_back",
|
|
21572
21580
|
"deploy_failed",
|
|
21573
21581
|
"rollback_failed",
|
|
@@ -21996,6 +22004,7 @@ ${drafted.notes}`,
|
|
|
21996
22004
|
const status = ran.status === "failed" ? "deploy_failed" : ran.status;
|
|
21997
22005
|
const outcome = {
|
|
21998
22006
|
deployed: "deployed",
|
|
22007
|
+
published: "published, not deployed",
|
|
21999
22008
|
rolled_back: "rolled back",
|
|
22000
22009
|
deploy_failed: "failed to deploy",
|
|
22001
22010
|
rollback_failed: "failed to deploy, and the rollback failed too"
|
|
@@ -23104,7 +23113,7 @@ Merge now?`,
|
|
|
23104
23113
|
...done("merged", `Merged at ${merged.revision}; its Release gate failed, so the next Release ships it`),
|
|
23105
23114
|
release: { runStatus: released.status, reason: released.reason }
|
|
23106
23115
|
};
|
|
23107
|
-
if (released.leftUndeployed !== true && released.status !== "deployed" && released.status !== "rejected" && released.status !== "gate_failed" && released.status !== "not_due" && released.status !== "nothing_to_release")
|
|
23116
|
+
if (released.leftUndeployed !== true && released.status !== "deployed" && released.status !== "published" && released.status !== "rejected" && released.status !== "gate_failed" && released.status !== "not_due" && released.status !== "nothing_to_release")
|
|
23108
23117
|
yield* ask("release-failed", {
|
|
23109
23118
|
prompt: `Merged at ${merged.revision}, but its Release ended ${released.status}: ${released.reason}`,
|
|
23110
23119
|
options: [{ value: "Taken over", description: "A person looks at the release and production from here." }],
|
|
@@ -31452,4 +31461,4 @@ var runKit = (config, identity, packages) => {
|
|
|
31452
31461
|
runMain2(program.pipe(flatMap3((code) => sync2(() => process.exit(code)))));
|
|
31453
31462
|
};
|
|
31454
31463
|
// .kitman-build-entry.ts
|
|
31455
|
-
runKit(kitman_config_default, { name: "@kitman-sh/software-engineering", version: "0.13.
|
|
31464
|
+
runKit(kitman_config_default, { name: "@kitman-sh/software-engineering", version: "0.13.3" }, []);
|
package/dist/declarations.json
CHANGED
|
@@ -2363,6 +2363,7 @@
|
|
|
2363
2363
|
"not_mergeable",
|
|
2364
2364
|
"rejected",
|
|
2365
2365
|
"deployed",
|
|
2366
|
+
"published",
|
|
2366
2367
|
"rolled_back",
|
|
2367
2368
|
"deploy_failed",
|
|
2368
2369
|
"rollback_failed",
|
|
@@ -5522,7 +5523,7 @@
|
|
|
5522
5523
|
"carried": [
|
|
5523
5524
|
{
|
|
5524
5525
|
"name": "@kitman-sh/software-engineering",
|
|
5525
|
-
"version": "0.13.
|
|
5526
|
+
"version": "0.13.3",
|
|
5526
5527
|
"setup": "2a237548a69b0cd53ec3be7f687cfa8c2128335b3a655d34e185f2abce6a3c37",
|
|
5527
5528
|
"loops": [
|
|
5528
5529
|
"build",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitman-sh/software-engineering",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.3",
|
|
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.13.
|
|
20
|
+
"@kitman-sh/sdk": "0.13.3",
|
|
21
21
|
"effect": "^4.1.2"
|
|
22
22
|
},
|
|
23
23
|
"kitman": {
|
|
24
24
|
"bundle": "dist/bundle.js",
|
|
25
|
-
"digest": "
|
|
25
|
+
"digest": "ad716e54c885563c038a4709dbd077dfd0cecc4aceda3ae4db7fb1efa40e9cb9",
|
|
26
26
|
"protocolVersion": 5,
|
|
27
27
|
"declarations": "dist/declarations.json",
|
|
28
28
|
"setup": {
|
package/src/release.ts
CHANGED
|
@@ -90,6 +90,8 @@ const Output = Schema.Struct({
|
|
|
90
90
|
'not_mergeable',
|
|
91
91
|
'rejected',
|
|
92
92
|
'deployed',
|
|
93
|
+
/** A release candidate the deploy script published and did not deploy. */
|
|
94
|
+
'published',
|
|
93
95
|
'rolled_back',
|
|
94
96
|
'deploy_failed',
|
|
95
97
|
/** The deploy failed after production changed, and so did the rollback: production may be broken. */
|
|
@@ -336,7 +338,8 @@ const recovery = (previous: string | undefined) =>
|
|
|
336
338
|
* target so two Releases never tag or deploy over each other, taking it over from a Release that failed holding it,
|
|
337
339
|
* and picks the version again under it: a revision an existing tag already contains ends as nothing to release. It
|
|
338
340
|
* then tags and publishes once (its own release of the tag at the same revision counts as done; one at another is
|
|
339
|
-
* never moved) and waits for the deploy. A
|
|
341
|
+
* never moved) and waits for the deploy. A release candidate the repository's deploy script only publishes ends
|
|
342
|
+
* published, not deployed, and is never rolled back for it. A failed or late deploy asks whether
|
|
340
343
|
* to retry (it runs the tag's failed pipeline again and waits), roll back to the previous tag (it runs that
|
|
341
344
|
* tag's pipeline again in full and waits for its deploy), or leave it, which it does by default.
|
|
342
345
|
*
|
|
@@ -721,6 +724,7 @@ export default defineLoop({
|
|
|
721
724
|
|
|
722
725
|
const outcome = {
|
|
723
726
|
deployed: 'deployed',
|
|
727
|
+
published: 'published, not deployed',
|
|
724
728
|
rolled_back: 'rolled back',
|
|
725
729
|
deploy_failed: 'failed to deploy',
|
|
726
730
|
rollback_failed: 'failed to deploy, and the rollback failed too'
|
package/src/review.ts
CHANGED
|
@@ -171,9 +171,14 @@ type Range = {
|
|
|
171
171
|
readonly head: string
|
|
172
172
|
/** A ChangeRequest's branches, which its reviewers are told so they need not look it up. */
|
|
173
173
|
readonly branches?: { readonly source: string | undefined; readonly target: string }
|
|
174
|
+
/** The epic branch and default branch it diffs, when the review is of an epic's whole change. */
|
|
175
|
+
readonly epic?: { readonly branch: string; readonly defaultBranch: string }
|
|
174
176
|
}
|
|
175
177
|
|
|
176
|
-
const targetOf = (input: typeof Input.Type, { base, head, branches }: Range) => {
|
|
178
|
+
const targetOf = (input: typeof Input.Type, { base, head, branches, epic }: Range) => {
|
|
179
|
+
if (epic !== undefined)
|
|
180
|
+
return `the epic's whole change \`git diff ${base}...${head}\` in your checkout: epic branch \`${epic.branch}\` against default branch \`${epic.defaultBranch}\`, as they stood when this review started. Fetch both from \`origin\` and diff exactly those commits, even if either branch has moved since.`
|
|
181
|
+
|
|
177
182
|
if (input.changeRequestId !== undefined && branches !== undefined) {
|
|
178
183
|
const { source, target } = branches
|
|
179
184
|
const from = source === undefined ? '' : ` from source branch \`${source}\``
|
|
@@ -200,7 +205,8 @@ const targetOf = (input: typeof Input.Type, { base, head, branches }: Range) =>
|
|
|
200
205
|
|
|
201
206
|
/**
|
|
202
207
|
* The commits the review diffs, read on a Runner when it starts: a ChangeRequest's head against its target branch,
|
|
203
|
-
* else `base` against `head
|
|
208
|
+
* else `base` against `head`, else the epic branch against the default branch. A branch that moves later does not move
|
|
209
|
+
* the diff.
|
|
204
210
|
*/
|
|
205
211
|
const pinnedRange = (input: typeof Input.Type) =>
|
|
206
212
|
Effect.gen(function* () {
|
|
@@ -221,6 +227,13 @@ const pinnedRange = (input: typeof Input.Type) =>
|
|
|
221
227
|
}
|
|
222
228
|
}
|
|
223
229
|
|
|
230
|
+
if ((input.base === undefined || input.head === undefined) && input.epic !== undefined) {
|
|
231
|
+
const { branch, defaultBranch } = input.epic
|
|
232
|
+
const [base = '', head = ''] = yield* resolveRevisions('pin', [`origin/${defaultBranch}`, `origin/${branch}`])
|
|
233
|
+
|
|
234
|
+
return { base, head, epic: { branch, defaultBranch } }
|
|
235
|
+
}
|
|
236
|
+
|
|
224
237
|
if (input.base === undefined || input.head === undefined)
|
|
225
238
|
return yield* new ReviewTargetMissing({ message: 'Name a ChangeRequest, or both base and head revisions' })
|
|
226
239
|
|
package/src/shepherd.ts
CHANGED
|
@@ -1619,10 +1619,11 @@ export default defineLoop({
|
|
|
1619
1619
|
release: { runStatus: released.status, reason: released.reason }
|
|
1620
1620
|
}
|
|
1621
1621
|
|
|
1622
|
-
// It merged either way; a Release that did not deploy needs a person, unless it was rejected, found it released or a person left it.
|
|
1622
|
+
// It merged either way; a Release that did not deploy needs a person, unless it only published a candidate, was rejected, found it released or a person left it.
|
|
1623
1623
|
if (
|
|
1624
1624
|
released.leftUndeployed !== true &&
|
|
1625
1625
|
released.status !== 'deployed' &&
|
|
1626
|
+
released.status !== 'published' &&
|
|
1626
1627
|
released.status !== 'rejected' &&
|
|
1627
1628
|
released.status !== 'gate_failed' &&
|
|
1628
1629
|
released.status !== 'not_due' &&
|