@intentius/chant 0.124.62 → 0.124.64
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/cli/handlers/approve.d.ts +26 -0
- package/dist/cli/handlers/approve.d.ts.map +1 -1
- package/dist/cli/handlers/approve.js +167 -18
- package/dist/cli/handlers/plan.d.ts +10 -0
- package/dist/cli/handlers/plan.d.ts.map +1 -0
- package/dist/cli/handlers/plan.js +71 -0
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +2 -1
- package/dist/cli/handlers/release.d.ts +11 -7
- package/dist/cli/handlers/release.d.ts.map +1 -1
- package/dist/cli/handlers/release.js +93 -20
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +48 -7
- package/dist/cli/mcp/workspace-tools.d.ts.map +1 -1
- package/dist/cli/mcp/workspace-tools.js +2 -1
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +43 -0
- package/dist/cli/registry.d.ts +18 -2
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/config.d.ts +50 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/gate-decision.d.ts +1 -1
- package/dist/gate-decision.d.ts.map +1 -1
- package/dist/gate-decision.js +4 -2
- package/dist/gate-statement.schema.json +46 -0
- package/dist/lifecycle/__fixtures__/publish-fakes.d.ts +20 -0
- package/dist/lifecycle/__fixtures__/publish-fakes.d.ts.map +1 -1
- package/dist/lifecycle/__fixtures__/publish-fakes.js +119 -3
- package/dist/lifecycle/gate-ledger.d.ts +28 -5
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.js +6 -0
- package/dist/lifecycle/gate-seal.d.ts +59 -7
- package/dist/lifecycle/gate-seal.d.ts.map +1 -1
- package/dist/lifecycle/gate-seal.js +68 -15
- package/dist/lifecycle/gate-statement.d.ts +95 -0
- package/dist/lifecycle/gate-statement.d.ts.map +1 -0
- package/dist/lifecycle/gate-statement.js +110 -0
- package/dist/lifecycle/gate-webauthn.d.ts +79 -0
- package/dist/lifecycle/gate-webauthn.d.ts.map +1 -0
- package/dist/lifecycle/gate-webauthn.js +105 -0
- package/dist/lifecycle/git.d.ts +1 -1
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/git.js +24 -19
- package/dist/lifecycle/ledger-remote.d.ts +37 -0
- package/dist/lifecycle/ledger-remote.d.ts.map +1 -0
- package/dist/lifecycle/ledger-remote.js +42 -0
- package/dist/lifecycle/plan-stale.d.ts +76 -0
- package/dist/lifecycle/plan-stale.d.ts.map +1 -0
- package/dist/lifecycle/plan-stale.js +120 -0
- package/dist/lifecycle/publish-credentials.d.ts +1 -1
- package/dist/lifecycle/publish-credentials.d.ts.map +1 -1
- package/dist/lifecycle/publish-credentials.js +2 -0
- package/dist/lifecycle/publish-declaration.d.ts +107 -0
- package/dist/lifecycle/publish-declaration.d.ts.map +1 -1
- package/dist/lifecycle/publish-declaration.js +110 -1
- package/dist/lifecycle/publish-forge.d.ts +5 -1
- package/dist/lifecycle/publish-forge.d.ts.map +1 -1
- package/dist/lifecycle/publish-forge.js +13 -4
- package/dist/lifecycle/publish-git-ssh.d.ts +82 -0
- package/dist/lifecycle/publish-git-ssh.d.ts.map +1 -0
- package/dist/lifecycle/publish-git-ssh.js +180 -0
- package/dist/lifecycle/publish-github.d.ts +69 -0
- package/dist/lifecycle/publish-github.d.ts.map +1 -0
- package/dist/lifecycle/publish-github.js +153 -0
- package/dist/lifecycle/publish-homebrew.d.ts +77 -0
- package/dist/lifecycle/publish-homebrew.d.ts.map +1 -0
- package/dist/lifecycle/publish-homebrew.js +265 -0
- package/dist/lifecycle/publish-marketplace.d.ts +85 -0
- package/dist/lifecycle/publish-marketplace.d.ts.map +1 -0
- package/dist/lifecycle/publish-marketplace.js +398 -0
- package/dist/lifecycle/publish-targets.d.ts +6 -0
- package/dist/lifecycle/publish-targets.d.ts.map +1 -1
- package/dist/lifecycle/publish-targets.js +15 -0
- package/dist/lifecycle/publish-tauri.d.ts +61 -0
- package/dist/lifecycle/publish-tauri.d.ts.map +1 -0
- package/dist/lifecycle/publish-tauri.js +181 -0
- package/dist/lifecycle/release-cut.d.ts +51 -5
- package/dist/lifecycle/release-cut.d.ts.map +1 -1
- package/dist/lifecycle/release-cut.js +165 -16
- package/dist/lifecycle/release-publish.d.ts +18 -2
- package/dist/lifecycle/release-publish.d.ts.map +1 -1
- package/dist/lifecycle/release-publish.js +5 -0
- package/dist/lifecycle/release-revocation.d.ts +4 -3
- package/dist/lifecycle/release-revocation.d.ts.map +1 -1
- package/dist/lifecycle/release-revocation.js +5 -4
- package/dist/lifecycle/release-store.d.ts +32 -0
- package/dist/lifecycle/release-store.d.ts.map +1 -1
- package/dist/lifecycle/release-store.js +11 -0
- package/dist/lifecycle/snapshot-store.d.ts.map +1 -1
- package/dist/lifecycle/snapshot-store.js +17 -9
- package/dist/lifecycle/test-passkey.d.ts +25 -0
- package/dist/lifecycle/test-passkey.d.ts.map +1 -0
- package/dist/lifecycle/test-passkey.js +39 -0
- package/dist/notify.d.ts +23 -3
- package/dist/notify.d.ts.map +1 -1
- package/dist/notify.js +8 -2
- package/dist/notify.schema.json +12 -3
- package/dist/op/gate.d.ts +1 -1
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/op/gate.js +2 -1
- package/dist/pr-forge.d.ts +20 -0
- package/dist/pr-forge.d.ts.map +1 -1
- package/dist/pr-forge.js +87 -8
- package/dist/release-floors.d.ts +1 -1
- package/dist/release-floors.js +1 -1
- package/dist/wave-runtime.mjs +333 -331
- package/dist/workspace/ci-builds.d.ts +21 -0
- package/dist/workspace/ci-builds.d.ts.map +1 -1
- package/dist/workspace/ci-builds.js +14 -0
- package/dist/workspace/ci-green.d.ts +45 -2
- package/dist/workspace/ci-green.d.ts.map +1 -1
- package/dist/workspace/ci-green.js +123 -5
- package/dist/workspace/ci-quarantine-report.d.ts +80 -0
- package/dist/workspace/ci-quarantine-report.d.ts.map +1 -0
- package/dist/workspace/ci-quarantine-report.js +204 -0
- package/dist/workspace/ci-quarantine.d.ts +73 -0
- package/dist/workspace/ci-quarantine.d.ts.map +1 -0
- package/dist/workspace/ci-quarantine.js +170 -0
- package/dist/workspace/ci-serve.d.ts.map +1 -1
- package/dist/workspace/ci-serve.js +7 -4
- package/dist/workspace/class-data.d.ts +3 -1
- package/dist/workspace/class-data.d.ts.map +1 -1
- package/dist/workspace/class-data.js +4 -1
- package/dist/workspace/declaration.d.ts +45 -2
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.js +45 -2
- package/dist/workspace/declaration.schema.json +51 -3
- package/dist/workspace/forge-work.d.ts +76 -0
- package/dist/workspace/forge-work.d.ts.map +1 -0
- package/dist/workspace/forge-work.js +160 -0
- package/dist/workspace/identity-gate-rule.d.ts +3 -2
- package/dist/workspace/identity-gate-rule.d.ts.map +1 -1
- package/dist/workspace/identity-gate-rule.js +5 -7
- package/dist/workspace/identity.d.ts +3 -2
- package/dist/workspace/identity.d.ts.map +1 -1
- package/dist/workspace/identity.js +6 -3
- package/dist/workspace/intent-cli.d.ts +3 -2
- package/dist/workspace/intent-cli.d.ts.map +1 -1
- package/dist/workspace/intent-cli.js +26 -5
- package/dist/workspace/intent-record.d.ts +3 -0
- package/dist/workspace/intent-record.d.ts.map +1 -1
- package/dist/workspace/intent-record.schema.json +32 -0
- package/dist/workspace/intent.d.ts +9 -0
- package/dist/workspace/intent.d.ts.map +1 -1
- package/dist/workspace/intent.js +2 -0
- package/dist/workspace/intent.schema.json +32 -0
- package/dist/workspace/kind-readers.d.ts.map +1 -1
- package/dist/workspace/kind-readers.js +2 -1
- package/dist/workspace/kinds.d.ts +6 -1
- package/dist/workspace/kinds.d.ts.map +1 -1
- package/dist/workspace/kinds.js +8 -3
- package/dist/workspace/plan-stale.schema.json +286 -0
- package/dist/workspace/release-candidates.d.ts +42 -7
- package/dist/workspace/release-candidates.d.ts.map +1 -1
- package/dist/workspace/release-candidates.js +64 -23
- package/dist/workspace/release-candidates.schema.json +55 -2
- package/dist/workspace/releases.schema.json +47 -0
- package/dist/workspace/trust/policy.d.ts +10 -0
- package/dist/workspace/trust/policy.d.ts.map +1 -1
- package/dist/workspace/trust/policy.js +19 -1
- package/dist/workspace/trust/run-commits.d.ts.map +1 -1
- package/dist/workspace/trust/run-commits.js +2 -1
- package/dist/workspace/trust/seal.d.ts.map +1 -1
- package/dist/workspace/trust/seal.js +34 -3
- package/dist/workspace/trust/trust-files.d.ts.map +1 -1
- package/dist/workspace/trust/trust-files.js +6 -1
- package/package.json +2 -1
- package/src/cli/handlers/approve-external-signature.test.ts +328 -0
- package/src/cli/handlers/approve.ts +206 -18
- package/src/cli/handlers/plan.ts +74 -0
- package/src/cli/handlers/pr.ts +2 -1
- package/src/cli/handlers/release.ts +84 -20
- package/src/cli/main.ts +48 -7
- package/src/cli/mcp/workspace-tools.ts +2 -1
- package/src/cli/parse-args.ts +33 -0
- package/src/cli/registry.ts +18 -2
- package/src/config.ts +8 -0
- package/src/gate-decision-bundle.test.ts +4 -2
- package/src/gate-decision.ts +11 -2
- package/src/gate-statement.schema.json +46 -0
- package/src/lifecycle/__fixtures__/publish-fakes.ts +125 -5
- package/src/lifecycle/gate-ledger.ts +34 -5
- package/src/lifecycle/gate-seal.ts +86 -15
- package/src/lifecycle/gate-statement.ts +144 -0
- package/src/lifecycle/gate-webauthn.test.ts +77 -0
- package/src/lifecycle/gate-webauthn.ts +133 -0
- package/src/lifecycle/git.ts +23 -19
- package/src/lifecycle/ledger-remote.test.ts +183 -0
- package/src/lifecycle/ledger-remote.ts +46 -0
- package/src/lifecycle/plan-stale.test.ts +149 -0
- package/src/lifecycle/plan-stale.ts +172 -0
- package/src/lifecycle/publish-credentials.ts +2 -0
- package/src/lifecycle/publish-declaration.ts +116 -1
- package/src/lifecycle/publish-forge.ts +14 -4
- package/src/lifecycle/publish-git-ssh.ts +202 -0
- package/src/lifecycle/publish-github.ts +174 -0
- package/src/lifecycle/publish-homebrew.test.ts +358 -0
- package/src/lifecycle/publish-homebrew.ts +283 -0
- package/src/lifecycle/publish-marketplace.test.ts +406 -0
- package/src/lifecycle/publish-marketplace.ts +421 -0
- package/src/lifecycle/publish-resume.test.ts +40 -0
- package/src/lifecycle/publish-target-context.test.ts +2 -2
- package/src/lifecycle/publish-targets.test.ts +23 -0
- package/src/lifecycle/publish-targets.ts +15 -0
- package/src/lifecycle/publish-tauri.test.ts +163 -0
- package/src/lifecycle/publish-tauri.ts +198 -0
- package/src/lifecycle/release-cut-lane.test.ts +177 -0
- package/src/lifecycle/release-cut-override.test.ts +213 -0
- package/src/lifecycle/release-cut.ts +198 -17
- package/src/lifecycle/release-publish.ts +23 -3
- package/src/lifecycle/release-revocation.ts +5 -4
- package/src/lifecycle/release-store.ts +44 -0
- package/src/lifecycle/snapshot-store.ts +16 -9
- package/src/lifecycle/test-passkey.ts +55 -0
- package/src/notify-bundle.test.ts +3 -1
- package/src/notify.schema.json +12 -3
- package/src/notify.ts +20 -3
- package/src/op/gate.ts +2 -1
- package/src/override-gate-bundle.test.ts +2 -0
- package/src/pr-forge-bundle.test.ts +2 -2
- package/src/pr-forge.test.ts +38 -0
- package/src/pr-forge.ts +93 -11
- package/src/pr-requires.test.ts +9 -0
- package/src/release-floors.ts +1 -1
- package/src/stage-hooks-bundle.test.ts +2 -0
- package/src/wave-runtime-bundle.test.ts +3 -2
- package/src/workspace/ci-builds.ts +27 -0
- package/src/workspace/ci-green-stale.test.ts +193 -0
- package/src/workspace/ci-green.ts +137 -6
- package/src/workspace/ci-quarantine-report.test.ts +145 -0
- package/src/workspace/ci-quarantine-report.ts +234 -0
- package/src/workspace/ci-quarantine.test.ts +160 -0
- package/src/workspace/ci-quarantine.ts +188 -0
- package/src/workspace/ci-serve.ts +7 -4
- package/src/workspace/class-data.ts +5 -1
- package/src/workspace/declaration.schema.json +51 -3
- package/src/workspace/declaration.test.ts +1 -0
- package/src/workspace/declaration.ts +88 -5
- package/src/workspace/forge-work.test.ts +143 -0
- package/src/workspace/forge-work.ts +195 -0
- package/src/workspace/identity-gate-rule.ts +6 -8
- package/src/workspace/identity.ts +6 -3
- package/src/workspace/intent-cli.ts +24 -5
- package/src/workspace/intent-record.schema.json +32 -0
- package/src/workspace/intent-record.ts +3 -0
- package/src/workspace/intent.schema.json +32 -0
- package/src/workspace/intent.ts +9 -0
- package/src/workspace/kind-readers.ts +2 -1
- package/src/workspace/kinds.test.ts +13 -0
- package/src/workspace/kinds.ts +12 -3
- package/src/workspace/plan-stale.schema.json +286 -0
- package/src/workspace/release-candidates.schema.json +55 -2
- package/src/workspace/release-candidates.test.ts +77 -4
- package/src/workspace/release-candidates.ts +80 -23
- package/src/workspace/releases.schema.json +47 -0
- package/src/workspace/trust/gate-seal.test.ts +44 -0
- package/src/workspace/trust/policy.ts +24 -1
- package/src/workspace/trust/run-commits.ts +2 -1
- package/src/workspace/trust/seal.ts +35 -3
- package/src/workspace/trust/trust-files.test.ts +5 -0
- package/src/workspace/trust/trust-files.ts +15 -1
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://intentius.io/chant/schemas/workspace/plan-stale/v1/plan-stale.schema.json",
|
|
4
|
+
"title": "chant plan stale output",
|
|
5
|
+
"description": "What `chant plan stale <digest> --json` prints (#4648): whether anything applied to a plan's targets after the plan was recorded, and those applies. The plan is the pending gate facts that record the digest; it was recorded at the earliest. Its targets are each fact's member, op and environment (the fact's own, else the environment of the run that reached the gate). An apply under an approval of the same member and op for another plan, and a deploy record of the same member and environment, recorded after the plan, make it stale. It reads the local chant/lifecycle branch, never fetches and writes nothing. Version 1 of the read contract. Readers ignore fields they do not know; a field is only ever added within a version. The codes are a closed list, each in the one closed list of `reason-codes.ts`. Contract version 1 of this document is written by chant 0.124.63 and newer.",
|
|
6
|
+
"oneOf": [
|
|
7
|
+
{
|
|
8
|
+
"$ref": "#/$defs/result"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"$ref": "#/$defs/failure"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"$defs": {
|
|
15
|
+
"result": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"description": "The ledger was read. Exit code 0 when the plan is current, 2 when it is stale, 1 when plan is null.",
|
|
18
|
+
"required": [
|
|
19
|
+
"$schema",
|
|
20
|
+
"contract",
|
|
21
|
+
"chant",
|
|
22
|
+
"digest",
|
|
23
|
+
"plan",
|
|
24
|
+
"stale",
|
|
25
|
+
"applies"
|
|
26
|
+
],
|
|
27
|
+
"properties": {
|
|
28
|
+
"$schema": {
|
|
29
|
+
"const": "https://intentius.io/chant/schemas/workspace/plan-stale/v1/plan-stale.schema.json"
|
|
30
|
+
},
|
|
31
|
+
"contract": {
|
|
32
|
+
"const": 1
|
|
33
|
+
},
|
|
34
|
+
"chant": {
|
|
35
|
+
"type": "string"
|
|
36
|
+
},
|
|
37
|
+
"error": false,
|
|
38
|
+
"digest": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"description": "The digest asked for: a pending gate fact's planDigest."
|
|
41
|
+
},
|
|
42
|
+
"plan": {
|
|
43
|
+
"description": "The plan, or null when no pending gate fact on the local ledger records the digest.",
|
|
44
|
+
"oneOf": [
|
|
45
|
+
{
|
|
46
|
+
"type": "null"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"type": "object",
|
|
50
|
+
"required": [
|
|
51
|
+
"recordedAt",
|
|
52
|
+
"runId",
|
|
53
|
+
"gitSha",
|
|
54
|
+
"targets"
|
|
55
|
+
],
|
|
56
|
+
"properties": {
|
|
57
|
+
"recordedAt": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"format": "date-time",
|
|
60
|
+
"description": "The timestamp of the earliest pending fact that records the digest."
|
|
61
|
+
},
|
|
62
|
+
"runId": {
|
|
63
|
+
"type": [
|
|
64
|
+
"string",
|
|
65
|
+
"null"
|
|
66
|
+
],
|
|
67
|
+
"description": "The run that recorded that fact."
|
|
68
|
+
},
|
|
69
|
+
"gitSha": {
|
|
70
|
+
"type": [
|
|
71
|
+
"string",
|
|
72
|
+
"null"
|
|
73
|
+
],
|
|
74
|
+
"description": "The commit that run reached the gate at."
|
|
75
|
+
},
|
|
76
|
+
"targets": {
|
|
77
|
+
"type": "array",
|
|
78
|
+
"minItems": 1,
|
|
79
|
+
"description": "Each gate the plan waits at, once.",
|
|
80
|
+
"items": {
|
|
81
|
+
"type": "object",
|
|
82
|
+
"required": [
|
|
83
|
+
"member",
|
|
84
|
+
"op",
|
|
85
|
+
"gate",
|
|
86
|
+
"environment"
|
|
87
|
+
],
|
|
88
|
+
"properties": {
|
|
89
|
+
"member": {
|
|
90
|
+
"type": [
|
|
91
|
+
"string",
|
|
92
|
+
"null"
|
|
93
|
+
],
|
|
94
|
+
"description": "The workspace member whose gate ledger holds the fact, or null outside a workspace."
|
|
95
|
+
},
|
|
96
|
+
"op": {
|
|
97
|
+
"type": "string"
|
|
98
|
+
},
|
|
99
|
+
"gate": {
|
|
100
|
+
"type": "string"
|
|
101
|
+
},
|
|
102
|
+
"environment": {
|
|
103
|
+
"type": [
|
|
104
|
+
"string",
|
|
105
|
+
"null"
|
|
106
|
+
],
|
|
107
|
+
"description": "The fact's environment, else the env of the run that reached the gate, else null. A null environment matches no deploy record."
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
"stale": {
|
|
117
|
+
"type": [
|
|
118
|
+
"boolean",
|
|
119
|
+
"null"
|
|
120
|
+
],
|
|
121
|
+
"description": "True when applies is not empty. Null when plan is null."
|
|
122
|
+
},
|
|
123
|
+
"applies": {
|
|
124
|
+
"type": "array",
|
|
125
|
+
"description": "The applies that touched a target after the plan was recorded, oldest first. Empty when stale is false or null.",
|
|
126
|
+
"items": {
|
|
127
|
+
"type": "object",
|
|
128
|
+
"required": [
|
|
129
|
+
"source",
|
|
130
|
+
"member",
|
|
131
|
+
"op",
|
|
132
|
+
"gate",
|
|
133
|
+
"environment",
|
|
134
|
+
"component",
|
|
135
|
+
"planDigest",
|
|
136
|
+
"at",
|
|
137
|
+
"actor",
|
|
138
|
+
"approvedBy",
|
|
139
|
+
"runId",
|
|
140
|
+
"runUrl",
|
|
141
|
+
"gitSha",
|
|
142
|
+
"result"
|
|
143
|
+
],
|
|
144
|
+
"properties": {
|
|
145
|
+
"source": {
|
|
146
|
+
"enum": [
|
|
147
|
+
"applies",
|
|
148
|
+
"deploys"
|
|
149
|
+
],
|
|
150
|
+
"description": "applies: an apply under an approval, a line of _gates/<op>/applied.jsonl (chant ledger applies). deploys: a deploy record, a line of <env>/releases.jsonl (chant ledger deploys)."
|
|
151
|
+
},
|
|
152
|
+
"member": {
|
|
153
|
+
"type": [
|
|
154
|
+
"string",
|
|
155
|
+
"null"
|
|
156
|
+
],
|
|
157
|
+
"description": "The workspace member whose ledger holds it, or null outside a workspace."
|
|
158
|
+
},
|
|
159
|
+
"op": {
|
|
160
|
+
"type": [
|
|
161
|
+
"string",
|
|
162
|
+
"null"
|
|
163
|
+
],
|
|
164
|
+
"description": "The op it applied under. Null for a deploy record."
|
|
165
|
+
},
|
|
166
|
+
"gate": {
|
|
167
|
+
"type": [
|
|
168
|
+
"string",
|
|
169
|
+
"null"
|
|
170
|
+
],
|
|
171
|
+
"description": "The gate whose approval it spent. Null for a deploy record."
|
|
172
|
+
},
|
|
173
|
+
"environment": {
|
|
174
|
+
"type": [
|
|
175
|
+
"string",
|
|
176
|
+
"null"
|
|
177
|
+
],
|
|
178
|
+
"description": "The environment it deployed to. Null for an apply under an approval, whose line names none."
|
|
179
|
+
},
|
|
180
|
+
"component": {
|
|
181
|
+
"type": [
|
|
182
|
+
"string",
|
|
183
|
+
"null"
|
|
184
|
+
],
|
|
185
|
+
"description": "The component a deploy record deployed. Null for an apply under an approval."
|
|
186
|
+
},
|
|
187
|
+
"planDigest": {
|
|
188
|
+
"type": [
|
|
189
|
+
"string",
|
|
190
|
+
"null"
|
|
191
|
+
],
|
|
192
|
+
"description": "The plan it applied, always another plan than digest. Null for a deploy record."
|
|
193
|
+
},
|
|
194
|
+
"at": {
|
|
195
|
+
"type": "string",
|
|
196
|
+
"format": "date-time",
|
|
197
|
+
"description": "When it was recorded, after plan.recordedAt."
|
|
198
|
+
},
|
|
199
|
+
"actor": {
|
|
200
|
+
"type": [
|
|
201
|
+
"string",
|
|
202
|
+
"null"
|
|
203
|
+
],
|
|
204
|
+
"description": "Who ran it: a deploy record's actor. Null for an apply under an approval, which names only its approver."
|
|
205
|
+
},
|
|
206
|
+
"approvedBy": {
|
|
207
|
+
"type": [
|
|
208
|
+
"string",
|
|
209
|
+
"null"
|
|
210
|
+
],
|
|
211
|
+
"description": "Who approved it: an apply's approvedBy, a deploy record's approver."
|
|
212
|
+
},
|
|
213
|
+
"runId": {
|
|
214
|
+
"type": [
|
|
215
|
+
"string",
|
|
216
|
+
"null"
|
|
217
|
+
],
|
|
218
|
+
"description": "The run that applied it."
|
|
219
|
+
},
|
|
220
|
+
"runUrl": {
|
|
221
|
+
"type": [
|
|
222
|
+
"string",
|
|
223
|
+
"null"
|
|
224
|
+
],
|
|
225
|
+
"description": "A deploy record's link to its run. Null for an apply under an approval."
|
|
226
|
+
},
|
|
227
|
+
"gitSha": {
|
|
228
|
+
"type": [
|
|
229
|
+
"string",
|
|
230
|
+
"null"
|
|
231
|
+
],
|
|
232
|
+
"description": "The commit it applied."
|
|
233
|
+
},
|
|
234
|
+
"result": {
|
|
235
|
+
"type": [
|
|
236
|
+
"string",
|
|
237
|
+
"null"
|
|
238
|
+
],
|
|
239
|
+
"description": "How an apply under an approval ended: applied or failed, or null while it has no finished line. Null for a deploy record."
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
"failure": {
|
|
247
|
+
"type": "object",
|
|
248
|
+
"description": "Nothing was read. Exit code 1.",
|
|
249
|
+
"required": [
|
|
250
|
+
"$schema",
|
|
251
|
+
"contract",
|
|
252
|
+
"chant",
|
|
253
|
+
"error"
|
|
254
|
+
],
|
|
255
|
+
"properties": {
|
|
256
|
+
"$schema": {
|
|
257
|
+
"const": "https://intentius.io/chant/schemas/workspace/plan-stale/v1/plan-stale.schema.json"
|
|
258
|
+
},
|
|
259
|
+
"contract": {
|
|
260
|
+
"const": 1
|
|
261
|
+
},
|
|
262
|
+
"chant": {
|
|
263
|
+
"type": "string"
|
|
264
|
+
},
|
|
265
|
+
"error": {
|
|
266
|
+
"type": "object",
|
|
267
|
+
"required": [
|
|
268
|
+
"code",
|
|
269
|
+
"message"
|
|
270
|
+
],
|
|
271
|
+
"properties": {
|
|
272
|
+
"code": {
|
|
273
|
+
"enum": [
|
|
274
|
+
"not-a-git-repository",
|
|
275
|
+
"ledger-unreadable"
|
|
276
|
+
]
|
|
277
|
+
},
|
|
278
|
+
"message": {
|
|
279
|
+
"type": "string"
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
* latest deploy records name in `releaseDigest`, as the `releases` read
|
|
11
11
|
* (./releases.ts) says.
|
|
12
12
|
*
|
|
13
|
-
* Every green commit that is not revoked is a candidate.
|
|
13
|
+
* Every green commit that is not revoked is a candidate. With a lane (#4692),
|
|
14
|
+
* green and revoked are that lane's tags, `ci/green-<lane>/<sha>` and
|
|
15
|
+
* `ci/revoked-<lane>/<sha>`, as `release cut --lane` checks them. Its `changes` are
|
|
14
16
|
* the first-parent commits after the previous candidate up to and including
|
|
15
17
|
* it, so the candidates partition the walk. A revoked commit is listed under
|
|
16
18
|
* `skipped`, and its changes carry on into the next candidate. Commits after
|
|
@@ -29,10 +31,22 @@
|
|
|
29
31
|
* trailers name, or under no work item, and within that under its pull
|
|
30
32
|
* request, or under none for a commit that landed without one.
|
|
31
33
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
+
* Asked to (`forgeIssues`, `--forge-issues`, #4649), it also asks the forge
|
|
35
|
+
* which issues each change's pull request closes (./forge-work.ts), once per
|
|
36
|
+
* pull request, and puts the answer in the change's `closes`. A change no
|
|
37
|
+
* `Chant-Record` trailer gives a work item then lands under each issue its
|
|
38
|
+
* pull request closes. Without a forge or a token the pull request number
|
|
39
|
+
* stands alone, `resolved: false`.
|
|
40
|
+
*
|
|
41
|
+
* Otherwise it reads local refs and tags only and never fetches. Git is read
|
|
42
|
+
* through a local `git` subprocess.
|
|
34
43
|
*/
|
|
44
|
+
import type { ForgeWorkOptions, PullRequestCloses } from "./forge-work.js";
|
|
35
45
|
export declare const RELEASE_CANDIDATES_CONTRACT_VERSION = 1;
|
|
46
|
+
/** The first chant whose candidates carry `changes[].closes` and `groups[].issue` (#4649). */
|
|
47
|
+
export declare const RELEASE_CANDIDATES_CLOSES_FLOOR = "0.124.63";
|
|
48
|
+
/** The first chant whose candidates document carries `lane` and reads a lane's tags (#4692). */
|
|
49
|
+
export declare const RELEASE_CANDIDATES_LANE_FLOOR = "0.124.64";
|
|
36
50
|
export declare const RELEASE_CANDIDATES_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/release-candidates/v1/release-candidates.schema.json";
|
|
37
51
|
/** Why the read stopped. Closed; each code is in `reason-codes.ts`. */
|
|
38
52
|
export declare const RELEASE_CANDIDATES_ERROR_CODES: readonly ["not-a-git-repository", "ledger-unreadable"];
|
|
@@ -65,6 +79,12 @@ export interface CandidateChange {
|
|
|
65
79
|
pr: number | null;
|
|
66
80
|
/** The merge record `_merges/<sha>.json` (#4168 4.1), as stored, or null when there is none. */
|
|
67
81
|
merge: Record<string, unknown> | null;
|
|
82
|
+
/**
|
|
83
|
+
* The issues the forge says `pr` closes (#4649), or null when the read was
|
|
84
|
+
* not asked to (`--forge-issues`) or the change has no pull request. Added
|
|
85
|
+
* within contract 1 by chant {@link RELEASE_CANDIDATES_CLOSES_FLOOR}.
|
|
86
|
+
*/
|
|
87
|
+
closes: PullRequestCloses | null;
|
|
68
88
|
}
|
|
69
89
|
/** A candidate's changes under one pull request, or under none (`pr: null`) for commits that landed without one. */
|
|
70
90
|
export interface CandidatePullRequestGroup {
|
|
@@ -72,9 +92,16 @@ export interface CandidatePullRequestGroup {
|
|
|
72
92
|
/** Newest first. */
|
|
73
93
|
commits: string[];
|
|
74
94
|
}
|
|
75
|
-
/**
|
|
95
|
+
/**
|
|
96
|
+
* A candidate's changes under one work item: a `Chant-Record` work id
|
|
97
|
+
* (`work`), or an issue the change's pull request closes (`issue`, #4649), or
|
|
98
|
+
* under none (both null). Work ids come first, then issues, each in the order
|
|
99
|
+
* the oldest change names them.
|
|
100
|
+
*/
|
|
76
101
|
export interface CandidateGroup {
|
|
77
102
|
work: string | null;
|
|
103
|
+
/** The issue the forge says the changes' pull request closes, for changes with no work id; null otherwise. */
|
|
104
|
+
issue: number | null;
|
|
78
105
|
/** Pull requests in the order their oldest commit landed, then `pr: null`. */
|
|
79
106
|
pullRequests: CandidatePullRequestGroup[];
|
|
80
107
|
}
|
|
@@ -106,6 +133,8 @@ export type ReleaseCandidatesDocument = {
|
|
|
106
133
|
chant: string;
|
|
107
134
|
member: string | null;
|
|
108
135
|
branch: string;
|
|
136
|
+
/** The green lane whose tags were read (#4692), or null for `ci/green/<sha>`. Added within contract 1 by chant {@link RELEASE_CANDIDATES_LANE_FLOOR}. */
|
|
137
|
+
lane: string | null;
|
|
109
138
|
/** The tip of the branch as this clone knows it. */
|
|
110
139
|
tip: string | null;
|
|
111
140
|
environments: CandidateEnvironment[];
|
|
@@ -137,6 +166,10 @@ export interface ReleaseCandidatesQuery {
|
|
|
137
166
|
limit?: number;
|
|
138
167
|
/** Walk this branch of `ci.green.branch` (#4325) instead of the first. */
|
|
139
168
|
branch?: string;
|
|
169
|
+
/** Read this lane's tags (#4692), one `ci.green.lanes` declares, in place of `ci/green/` and `ci/revoked/`. */
|
|
170
|
+
lane?: string;
|
|
171
|
+
/** Ask the forge which issues each pull request closes (#4649), with these options. Left out, the forge is not read. */
|
|
172
|
+
forgeIssues?: ForgeWorkOptions;
|
|
140
173
|
}
|
|
141
174
|
/** The work ids and `<kind>:<id>` records a commit's `Chant-Record` trailers name. */
|
|
142
175
|
export declare function recordTrailers(trailers: Record<string, string[]>): {
|
|
@@ -149,9 +182,11 @@ export declare function prFromSubject(subject: string): number | null;
|
|
|
149
182
|
export declare function mergeRecordPr(merge: Record<string, unknown> | null): number | null;
|
|
150
183
|
/**
|
|
151
184
|
* Group changes, given newest first, by work item, then pull request, then
|
|
152
|
-
* commit. A change with work
|
|
153
|
-
* in the
|
|
154
|
-
*
|
|
185
|
+
* commit. A change with work ids lands in each one's group; one without
|
|
186
|
+
* lands in the group of each issue its pull request closes (#4649); the rest
|
|
187
|
+
* land in the group of neither, last. Work ids come before issues. Within a
|
|
188
|
+
* group, pull requests come in the order their oldest commit landed, and
|
|
189
|
+
* commits without one last.
|
|
155
190
|
*/
|
|
156
191
|
export declare function groupChanges(changes: readonly CandidateChange[]): CandidateGroup[];
|
|
157
192
|
/** Read the release candidates of the member at `query.cwd`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-candidates.d.ts","sourceRoot":"","sources":["../../src/workspace/release-candidates.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"release-candidates.d.ts","sourceRoot":"","sources":["../../src/workspace/release-candidates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAUH,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAExE,eAAO,MAAM,mCAAmC,IAAI,CAAC;AACrD,8FAA8F;AAC9F,eAAO,MAAM,+BAA+B,aAAa,CAAC;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AAyB,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAoJjH"}
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
* latest deploy records name in `releaseDigest`, as the `releases` read
|
|
11
11
|
* (./releases.ts) says.
|
|
12
12
|
*
|
|
13
|
-
* Every green commit that is not revoked is a candidate.
|
|
13
|
+
* Every green commit that is not revoked is a candidate. With a lane (#4692),
|
|
14
|
+
* green and revoked are that lane's tags, `ci/green-<lane>/<sha>` and
|
|
15
|
+
* `ci/revoked-<lane>/<sha>`, as `release cut --lane` checks them. Its `changes` are
|
|
14
16
|
* the first-parent commits after the previous candidate up to and including
|
|
15
17
|
* it, so the candidates partition the walk. A revoked commit is listed under
|
|
16
18
|
* `skipped`, and its changes carry on into the next candidate. Commits after
|
|
@@ -29,17 +31,29 @@
|
|
|
29
31
|
* trailers name, or under no work item, and within that under its pull
|
|
30
32
|
* request, or under none for a commit that landed without one.
|
|
31
33
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
+
* Asked to (`forgeIssues`, `--forge-issues`, #4649), it also asks the forge
|
|
35
|
+
* which issues each change's pull request closes (./forge-work.ts), once per
|
|
36
|
+
* pull request, and puts the answer in the change's `closes`. A change no
|
|
37
|
+
* `Chant-Record` trailer gives a work item then lands under each issue its
|
|
38
|
+
* pull request closes. Without a forge or a token the pull request number
|
|
39
|
+
* stands alone, `resolved: false`.
|
|
40
|
+
*
|
|
41
|
+
* Otherwise it reads local refs and tags only and never fetches. Git is read
|
|
42
|
+
* through a local `git` subprocess.
|
|
34
43
|
*/
|
|
35
44
|
import { execFileSync } from "node:child_process";
|
|
36
45
|
import { relative, resolve, sep } from "node:path";
|
|
46
|
+
import { NEXT_RELEASE } from "../release-floors.js";
|
|
37
47
|
import { latestPerComponent, readReleaseLedger } from "../lifecycle/release-ledger.js";
|
|
38
48
|
import { readAllReleases, readCuts } from "../lifecycle/release-store.js";
|
|
39
49
|
import { resolveMemberLedger } from "../lifecycle/member-ledger.js";
|
|
40
50
|
import { readBlobFromPath } from "../lifecycle/git.js";
|
|
41
51
|
import { greenBranches, readerVersion } from "./declaration.js";
|
|
42
52
|
export const RELEASE_CANDIDATES_CONTRACT_VERSION = 1;
|
|
53
|
+
/** The first chant whose candidates carry `changes[].closes` and `groups[].issue` (#4649). */
|
|
54
|
+
export const RELEASE_CANDIDATES_CLOSES_FLOOR = "0.124.63";
|
|
55
|
+
/** The first chant whose candidates document carries `lane` and reads a lane's tags (#4692). */
|
|
56
|
+
export const RELEASE_CANDIDATES_LANE_FLOOR = NEXT_RELEASE;
|
|
43
57
|
export const RELEASE_CANDIDATES_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/release-candidates/v1/release-candidates.schema.json";
|
|
44
58
|
/** Why the read stopped. Closed; each code is in `reason-codes.ts`. */
|
|
45
59
|
export const RELEASE_CANDIDATES_ERROR_CODES = ["not-a-git-repository", "ledger-unreadable"];
|
|
@@ -78,26 +92,39 @@ export function mergeRecordPr(merge) {
|
|
|
78
92
|
}
|
|
79
93
|
/**
|
|
80
94
|
* Group changes, given newest first, by work item, then pull request, then
|
|
81
|
-
* commit. A change with work
|
|
82
|
-
* in the
|
|
83
|
-
*
|
|
95
|
+
* commit. A change with work ids lands in each one's group; one without
|
|
96
|
+
* lands in the group of each issue its pull request closes (#4649); the rest
|
|
97
|
+
* land in the group of neither, last. Work ids come before issues. Within a
|
|
98
|
+
* group, pull requests come in the order their oldest commit landed, and
|
|
99
|
+
* commits without one last.
|
|
84
100
|
*/
|
|
85
101
|
export function groupChanges(changes) {
|
|
86
102
|
const oldestFirst = [...changes].reverse();
|
|
87
103
|
const groups = new Map();
|
|
88
|
-
const add = (work, pr, commit) => {
|
|
89
|
-
const
|
|
90
|
-
groups.
|
|
91
|
-
|
|
104
|
+
const add = (work, issue, pr, commit) => {
|
|
105
|
+
const key = work !== null ? `work:${work}` : issue !== null ? `issue:${issue}` : "";
|
|
106
|
+
const g = groups.get(key) ?? { work, issue, byPr: new Map() };
|
|
107
|
+
groups.set(key, g);
|
|
108
|
+
g.byPr.set(pr, [commit, ...(g.byPr.get(pr) ?? [])]);
|
|
92
109
|
};
|
|
93
|
-
for (const c of oldestFirst)
|
|
94
|
-
|
|
95
|
-
|
|
110
|
+
for (const c of oldestFirst) {
|
|
111
|
+
const issues = c.closes?.issues ?? [];
|
|
112
|
+
if (c.work.length > 0)
|
|
113
|
+
for (const work of c.work)
|
|
114
|
+
add(work, null, c.pr, c.commit);
|
|
115
|
+
else if (issues.length > 0)
|
|
116
|
+
for (const issue of issues)
|
|
117
|
+
add(null, issue, c.pr, c.commit);
|
|
118
|
+
else
|
|
119
|
+
add(null, null, c.pr, c.commit);
|
|
120
|
+
}
|
|
96
121
|
const nullLast = (keys) => [...keys.filter((k) => k !== null), ...keys.filter((k) => k === null)];
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
122
|
+
const all = [...groups.values()];
|
|
123
|
+
return [...all.filter((g) => g.work !== null), ...all.filter((g) => g.issue !== null), ...all.filter((g) => g.work === null && g.issue === null)].map((g) => ({
|
|
124
|
+
work: g.work,
|
|
125
|
+
issue: g.issue,
|
|
126
|
+
pullRequests: nullLast([...g.byPr.keys()]).map((pr) => ({ pr, commits: g.byPr.get(pr) })),
|
|
127
|
+
}));
|
|
101
128
|
}
|
|
102
129
|
/** Read the release candidates of the member at `query.cwd`. */
|
|
103
130
|
export async function releaseCandidatesDocument(query) {
|
|
@@ -116,6 +143,14 @@ export async function releaseCandidatesDocument(query) {
|
|
|
116
143
|
if (query.branch !== undefined && !(green && greenBranches(green).includes(query.branch))) {
|
|
117
144
|
throw new Error(`--branch ${query.branch} is not a branch ci.green judges${green ? ` (${greenBranches(green).join(", ")})` : ", and the declaration has no ci.green"}`);
|
|
118
145
|
}
|
|
146
|
+
// #4692: an unknown lane, or one with no ci.green, stops the read with the lanes declared.
|
|
147
|
+
let lane = null;
|
|
148
|
+
if (query.lane !== undefined) {
|
|
149
|
+
if (!green)
|
|
150
|
+
throw new Error(`--lane ${query.lane} names a ci.green lane, and the declaration has no ci.green`);
|
|
151
|
+
const { laneOf } = await import("./declaration.js");
|
|
152
|
+
lane = laneOf(green, query.lane).name;
|
|
153
|
+
}
|
|
119
154
|
const trunk = resolveTrunk(top, query.branch ?? green?.branch ?? null);
|
|
120
155
|
const tip = tryGit(top, ["rev-parse", "--verify", "--quiet", `refs/remotes/${trunk.remote}/${trunk.branch}^{commit}`]) ??
|
|
121
156
|
tryGit(top, ["rev-parse", "--verify", "--quiet", `refs/heads/${trunk.branch}^{commit}`]);
|
|
@@ -151,7 +186,7 @@ export async function releaseCandidatesDocument(query) {
|
|
|
151
186
|
.sort((a, b) => ((cutAt.get(b.releaseDigest) ?? "") < (cutAt.get(a.releaseDigest) ?? "") ? -1 : 1));
|
|
152
187
|
environments.push({ env, running });
|
|
153
188
|
}
|
|
154
|
-
const empty = { ...head, member: ledger.members.length > 0 ? ledger.members.join("/") : null, branch: trunk.branch, tip, environments, since: null, candidates: [], skipped: [], pending: [] };
|
|
189
|
+
const empty = { ...head, member: ledger.members.length > 0 ? ledger.members.join("/") : null, branch: trunk.branch, lane, tip, environments, since: null, candidates: [], skipped: [], pending: [] };
|
|
155
190
|
if (!tip)
|
|
156
191
|
return empty;
|
|
157
192
|
// The oldest commit any environment runs bounds the walk, when every environment runs one.
|
|
@@ -169,7 +204,7 @@ export async function releaseCandidatesDocument(query) {
|
|
|
169
204
|
}
|
|
170
205
|
// An environment's newest running commit on the line, by position (smaller is newer).
|
|
171
206
|
const newestRun = new Map(environments.map((e) => [e.env, Math.min(...runningCommits(e).map((c) => position.get(c)), Number.POSITIVE_INFINITY)]));
|
|
172
|
-
const tags = await judgedCiTags(top, green);
|
|
207
|
+
const tags = await judgedCiTags(top, green, lane ?? undefined);
|
|
173
208
|
const details = commitDetails(top, walk);
|
|
174
209
|
const merges = new Map();
|
|
175
210
|
for (const sha of walk) {
|
|
@@ -185,14 +220,20 @@ export async function releaseCandidatesDocument(query) {
|
|
|
185
220
|
// A merge record that is not JSON is left out.
|
|
186
221
|
}
|
|
187
222
|
}
|
|
223
|
+
// The merge record names its pull request in `source` (../lifecycle/merge-record.ts).
|
|
224
|
+
const prOf = (sha) => mergeRecordPr(merges.get(sha) ?? null) ?? prFromSubject(details.get(sha)?.subject ?? "");
|
|
225
|
+
// What each pull request closes, asked of the forge once each, when asked to (#4649).
|
|
226
|
+
let closed = new Map();
|
|
227
|
+
if (query.forgeIssues) {
|
|
228
|
+
const { forgeWorkReader } = await import("./forge-work.js");
|
|
229
|
+
closed = await forgeWorkReader(top, query.forgeIssues).closesAll(walk.map(prOf).filter((n) => n !== null));
|
|
230
|
+
}
|
|
188
231
|
const change = (sha) => {
|
|
189
232
|
const d = details.get(sha);
|
|
190
233
|
const { work, records } = recordTrailers(d?.trailers ?? {});
|
|
191
234
|
const merge = merges.get(sha) ?? null;
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
const subject = d?.subject ?? "";
|
|
195
|
-
return { commit: sha, subject, date: d?.date ?? "", work, records, pr: mergePr ?? prFromSubject(subject), merge };
|
|
235
|
+
const pr = prOf(sha);
|
|
236
|
+
return { commit: sha, subject: d?.subject ?? "", date: d?.date ?? "", work, records, pr, merge, closes: pr !== null ? (closed.get(pr) ?? null) : null };
|
|
196
237
|
};
|
|
197
238
|
const flagReader = await flagsReader(top, source.rootOnDisk);
|
|
198
239
|
const cutLabels = new Map();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://intentius.io/chant/schemas/workspace/release-candidates/v1/release-candidates.schema.json",
|
|
4
4
|
"title": "chant release candidates output",
|
|
5
|
-
"description": "What `chant release candidates --json` prints (#4168 4.2): the green commits of trunk a release can be cut from, newest first, each with the commits, work items, pull requests, merge records and flags it would ship since the previous candidate, and what each environment of the member runs. It reads local refs and tags and never fetches. Version 1 of the read contract. Readers ignore fields they do not know; a field is only ever added within a version. The codes are a closed list, each in the one closed list of `reason-codes.ts`. Contract version 1 of this document is written by chant 0.124.33 and newer.",
|
|
5
|
+
"description": "What `chant release candidates --json` prints (#4168 4.2): the green commits of trunk a release can be cut from, newest first, each with the commits, work items, pull requests, merge records and flags it would ship since the previous candidate, and what each environment of the member runs. It reads local refs and tags and never fetches; with `--forge-issues` it also asks the forge, once per pull request, which issues each pull request closes (#4649). Version 1 of the read contract. Readers ignore fields they do not know; a field is only ever added within a version. The codes are a closed list, each in the one closed list of `reason-codes.ts`. Contract version 1 of this document is written by chant 0.124.33 and newer.",
|
|
6
6
|
"oneOf": [
|
|
7
7
|
{
|
|
8
8
|
"$ref": "#/$defs/result"
|
|
@@ -49,6 +49,13 @@
|
|
|
49
49
|
"type": "string",
|
|
50
50
|
"description": "The trunk walked: ci.green.branch, else what origin/HEAD names."
|
|
51
51
|
},
|
|
52
|
+
"lane": {
|
|
53
|
+
"type": [
|
|
54
|
+
"string",
|
|
55
|
+
"null"
|
|
56
|
+
],
|
|
57
|
+
"description": "The green lane whose tags were read (#4692), from --lane or release.lane in the member's chant.config.ts: candidates carry ci/green-<lane>/<sha> and skipped commits ci/revoked-<lane>/<sha>. Null when ci/green/<sha> was read. Added by #4692, written by chant 0.124.64 and newer."
|
|
58
|
+
},
|
|
52
59
|
"tip": {
|
|
53
60
|
"type": [
|
|
54
61
|
"string",
|
|
@@ -251,7 +258,7 @@
|
|
|
251
258
|
"items": {
|
|
252
259
|
"$ref": "#/$defs/group"
|
|
253
260
|
},
|
|
254
|
-
"description": "The same changes by work item, then pull request, then commit (#4168 4.4). Work
|
|
261
|
+
"description": "The same changes by work item, then pull request, then commit (#4168 4.4). Work ids come first, in the order the oldest change names them, then the issues that changes with no work id close (`issue`, with `--forge-issues`), then `work: null` and `issue: null` for changes under neither. A change with two work items is under both."
|
|
255
262
|
},
|
|
256
263
|
"flags": {
|
|
257
264
|
"type": "array",
|
|
@@ -276,6 +283,13 @@
|
|
|
276
283
|
],
|
|
277
284
|
"description": "The work item id a `Chant-Record: work:<id>` trailer names, or null."
|
|
278
285
|
},
|
|
286
|
+
"issue": {
|
|
287
|
+
"type": [
|
|
288
|
+
"integer",
|
|
289
|
+
"null"
|
|
290
|
+
],
|
|
291
|
+
"description": "For changes with no work id: an issue their pull request closes, as `closes` says (#4649); null otherwise. Written by chant 0.124.63 and newer."
|
|
292
|
+
},
|
|
279
293
|
"pullRequests": {
|
|
280
294
|
"type": "array",
|
|
281
295
|
"items": {
|
|
@@ -354,6 +368,17 @@
|
|
|
354
368
|
"null"
|
|
355
369
|
],
|
|
356
370
|
"description": "The merge record `_merges/<sha>.json` on chant/lifecycle (#4168 4.1), as stored, or null when there is none."
|
|
371
|
+
},
|
|
372
|
+
"closes": {
|
|
373
|
+
"anyOf": [
|
|
374
|
+
{
|
|
375
|
+
"$ref": "#/$defs/closes"
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"type": "null"
|
|
379
|
+
}
|
|
380
|
+
],
|
|
381
|
+
"description": "What the forge says `pr` closes (#4649), when the read was asked to (`--forge-issues`) and the change has a pull request; null otherwise. Written by chant 0.124.63 and newer."
|
|
357
382
|
}
|
|
358
383
|
},
|
|
359
384
|
"description": "One first-parent commit."
|
|
@@ -399,6 +424,34 @@
|
|
|
399
424
|
"description": "The value per environment, as the working tree's record writes it."
|
|
400
425
|
}
|
|
401
426
|
}
|
|
427
|
+
},
|
|
428
|
+
"closes": {
|
|
429
|
+
"type": "object",
|
|
430
|
+
"required": [
|
|
431
|
+
"resolved",
|
|
432
|
+
"issues",
|
|
433
|
+
"reason"
|
|
434
|
+
],
|
|
435
|
+
"properties": {
|
|
436
|
+
"resolved": {
|
|
437
|
+
"type": "boolean",
|
|
438
|
+
"description": "Whether the forge answered. False without a forge chant reads, without a token, offline, or when the forge answered an error."
|
|
439
|
+
},
|
|
440
|
+
"issues": {
|
|
441
|
+
"type": "array",
|
|
442
|
+
"items": {
|
|
443
|
+
"type": "integer"
|
|
444
|
+
},
|
|
445
|
+
"description": "The issues of the repository the pull request closes, ascending. Empty when not resolved."
|
|
446
|
+
},
|
|
447
|
+
"reason": {
|
|
448
|
+
"type": [
|
|
449
|
+
"string",
|
|
450
|
+
"null"
|
|
451
|
+
],
|
|
452
|
+
"description": "Why the forge was not read, or null when it was."
|
|
453
|
+
}
|
|
454
|
+
}
|
|
402
455
|
}
|
|
403
456
|
}
|
|
404
457
|
}
|