@kitman-sh/software-engineering 0.14.8 → 0.15.0

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.
@@ -1,44 +1,90 @@
1
- import { MergedFinding, ResolvedDeliveryTarget, ResolvedReleaseTrigger } from '@kitman-sh/sdk/loop'
1
+ import { LiveBranchSource, MergedFinding, ResolvedDeliveryTarget, ResolvedReleaseTrigger } from '@kitman-sh/sdk/loop'
2
2
  import * as Schema from 'effect/Schema'
3
3
  import { OutOfScopeFinding } from './out-of-scope'
4
4
  import { ReviewedScope } from './reviewed-scope'
5
5
 
6
+ /** What a hand-back gives the Build its offer starts. */
7
+ export const HandBack = Schema.Struct({
8
+ changeRequestId: Schema.String,
9
+ words: Schema.String,
10
+ taskId: Schema.optional(Schema.String),
11
+ /** The ChangeRequest's target, which Build merges into. */
12
+ branch: Schema.optional(Schema.String),
13
+ /** The head the review that handed it back read, and its findings, so Build's first review reviews the fix. */
14
+ reviewed: Schema.optional(Schema.String),
15
+ earlier: Schema.optional(Schema.Array(MergedFinding)),
16
+ outOfScopeFindings: Schema.optional(Schema.Array(OutOfScopeFinding)),
17
+ /** That review's scope judgement, whose unmet items Build's first review judges again. */
18
+ scope: Schema.optional(ReviewedScope)
19
+ })
20
+
21
+ /** A Backport Shepherd offers after a merge: the Input its offer starts it with. */
22
+ export const BackportOffer = Schema.Struct({
23
+ mergedChangeRequestId: Schema.String,
24
+ branch: Schema.String,
25
+ title: Schema.String,
26
+ /** Why the branch is live. */
27
+ source: LiveBranchSource
28
+ })
29
+
30
+ export type BackportOffer = typeof BackportOffer.Type
31
+
32
+ /** A Backport Shepherd started itself, for a branch its Input names in `backportTo`. */
33
+ export const BackportStarted = Schema.Struct({
34
+ branch: Schema.String,
35
+ status: Schema.String,
36
+ reason: Schema.String
37
+ })
38
+
6
39
  /** Shepherd's Output, outside shepherd.ts so Build can import it without the review → build → shepherd cycle. */
7
40
  export const ShepherdOutput = Schema.Struct({
8
- /** handed_back: its fix rounds ran out, and the ChangeRequest goes back to Build with what is still open. */
9
- status: Schema.Literals(['merged', 'ready', 'needs_you', 'handed_back']),
10
- /** Why it stopped, in a line a person can act on. */
11
- reason: Schema.String,
12
- fixRounds: Schema.Int,
13
- replies: Schema.Int,
14
- /** Each passed Review another Run recorded that Shepherd used for a head instead of reviewing that head again. */
15
- reused: Schema.optional(Schema.Array(Schema.Struct({ review: Schema.String, head: Schema.String }))),
16
- /** What still stands when it stopped without landing (needs_you, handed_back), so the Run and a Build above it read partial. */
17
- unsettled: Schema.optional(Schema.Array(Schema.String)),
18
- /** The Release it started after merging, when it was told to release. */
41
+ status: Schema.Literals(['merged', 'ready', 'needs_you', 'handed_back']).annotate({
42
+ description:
43
+ 'handed_back: its fix rounds ran out, and the ChangeRequest goes back to Build with what is still open.'
44
+ }),
45
+ reason: Schema.String.annotate({ description: 'Why it stopped, in a line a person can act on.' }),
46
+ fixRounds: Schema.Int.annotate({ description: 'Fix rounds it ran on failing checks and review findings.' }),
47
+ replies: Schema.Int.annotate({ description: 'Replies it posted to comments on the ChangeRequest.' }),
48
+ revision: Schema.optional(Schema.String).annotate({
49
+ description: 'The merge revision, once it merged the ChangeRequest.'
50
+ }),
51
+ reused: Schema.optional(Schema.Array(Schema.Struct({ review: Schema.String, head: Schema.String }))).annotate({
52
+ description:
53
+ 'Each passed Review another Run recorded that Shepherd used for a head instead of reviewing that head again.'
54
+ }),
55
+ unsettled: Schema.optional(Schema.Array(Schema.String)).annotate({
56
+ description:
57
+ 'What still stands when it stopped without landing (needs_you, handed_back), so the Run and a Build above it read partial.'
58
+ }),
59
+ conflicts: Schema.optional(Schema.Array(Schema.String)).annotate({
60
+ description:
61
+ 'With hold, the files merging the target in conflicted on when it could not settle them; empty when the forge said it conflicts and the merge named none.'
62
+ }),
19
63
  release: Schema.optional(
20
64
  Schema.Struct({ runStatus: Schema.String, reason: Schema.String, tag: Schema.optional(Schema.String) })
21
- ),
22
- /** The release trigger the Run used and the layer it came from. */
23
- releaseWhen: Schema.optional(ResolvedReleaseTrigger),
24
- /** Where the Run's delivery landed and the layer it came from. */
25
- deliversTo: Schema.optional(ResolvedDeliveryTarget),
26
- /** What Land epic did after a sub-task merged into its epic's branch: kept it up with the default branch, or opened the epic's ChangeRequest. */
27
- epicLanding: Schema.optional(Schema.Struct({ status: Schema.String, reason: Schema.String })),
28
- /** The Build its offer starts when it hands the ChangeRequest back: that ChangeRequest, and what is still open. */
29
- handBack: Schema.optional(
30
- Schema.Struct({
31
- changeRequestId: Schema.String,
32
- words: Schema.String,
33
- taskId: Schema.optional(Schema.String),
34
- /** The ChangeRequest's target, which Build merges into. */
35
- branch: Schema.optional(Schema.String),
36
- /** The head the review that handed it back read, and its findings, so Build's first review reviews the fix. */
37
- reviewed: Schema.optional(Schema.String),
38
- earlier: Schema.optional(Schema.Array(MergedFinding)),
39
- outOfScopeFindings: Schema.optional(Schema.Array(OutOfScopeFinding)),
40
- /** That review's scope judgement, whose unmet items Build's first review judges again. */
41
- scope: Schema.optional(ReviewedScope)
42
- })
43
- )
65
+ ).annotate({ description: 'The Release it started after merging, when it was told to release.' }),
66
+ releaseWhen: Schema.optional(ResolvedReleaseTrigger).annotate({
67
+ description: 'The release trigger the Run used and the layer it came from.'
68
+ }),
69
+ deliversTo: Schema.optional(ResolvedDeliveryTarget).annotate({
70
+ description: "Where the Run's delivery landed and the layer it came from."
71
+ }),
72
+ backports: Schema.optional(Schema.Array(BackportOffer)).annotate({
73
+ description:
74
+ 'Each other live branch of the repository after the merge, offered a Backport that starts only when a person takes it.'
75
+ }),
76
+ backportsUnread: Schema.optional(Schema.String).annotate({
77
+ description: 'Why it could not read the live branches after the merge, so it offered and started no Backport.'
78
+ }),
79
+ backported: Schema.optional(Schema.Array(BackportStarted)).annotate({
80
+ description: 'The Backports it started itself, for the live branches its `backportTo` names, and how each ended.'
81
+ }),
82
+ epicLanding: Schema.optional(Schema.Struct({ status: Schema.String, reason: Schema.String })).annotate({
83
+ description:
84
+ "What Land epic did after a sub-task merged into its epic's branch: kept it up with the default branch, or opened the epic's ChangeRequest."
85
+ }),
86
+ handBack: Schema.optional(HandBack).annotate({
87
+ description:
88
+ 'The Build its offer starts when it hands the ChangeRequest back: that ChangeRequest, and what is still open.'
89
+ })
44
90
  })