@kungfu-tech/buildchain 3.0.3-alpha.0 → 3.0.3-alpha.2
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/AGENTS.md +1 -1
- package/CONTRIBUTING.md +1 -1
- package/README.md +32 -1
- package/actions/promote-buildchain-ref/README.md +90 -19
- package/actions/report-buildchain-issue/README.md +19 -1
- package/actions/run-lifecycle/README.md +5 -0
- package/actions/validate-config/README.md +19 -1
- package/bin/buildchain.mjs +41 -241
- package/bin/internal/command-registry.mjs +82 -0
- package/bin/internal/trust-release-cli.mjs +1 -0
- package/contracts/auditable-demo-media-profiles-v1.json +116 -1
- package/contracts/buildchain-v2-residuals-v1.json +0 -45
- package/contracts/evidence/auditable-demo-responsive-web-delivery-v1.json +143 -0
- package/contracts/evidence/auditable-demo-web-delivery-v1.json +7 -3
- package/contracts/fixtures/auditable-demo-responsive-web-delivery-v1/complete-transcript.txt +2 -0
- package/contracts/fixtures/auditable-demo-responsive-web-delivery-v1/public-projection.json +16 -0
- package/contracts/fixtures/auditable-demo-responsive-web-delivery-v1/scene.json +12 -0
- package/dist/site/buildchain-contract.json +161 -42
- package/dist/site/buildchain-site.json +180 -84
- package/dist/site/capability-registry.json +6 -6
- package/dist/site/cli-registry.json +932 -98
- package/dist/site/controller-registry.json +97 -5
- package/dist/site/kfd-claims.json +316 -23
- package/dist/site/kfd-upstream-aggregate.json +1 -1
- package/dist/site/manual-registry.json +20 -20
- package/dist/site/node-api-registry.json +371 -56
- package/dist/site/page-registry.json +155 -59
- package/dist/site/public-surface-audit.json +286 -24
- package/dist/site/publication-registry.json +4 -4
- package/dist/site/release-provenance.json +3 -0
- package/dist/site/site-manifest.json +24 -24
- package/dist/site/workflow-registry.json +570 -79
- package/docs/MAP.md +22 -4
- package/docs/auditable-demo.md +35 -12
- package/docs/aws-us-elastic-runner-burst-plane.md +381 -0
- package/docs/cli.md +143 -12
- package/docs/consumer-issue-reporting.md +19 -1
- package/docs/github-governance-authority.md +2 -2
- package/docs/lifecycle-protocol.md +20 -2
- package/docs/migration-inventory.md +24 -5
- package/docs/ownership.md +19 -1
- package/docs/publication-artifacts.md +185 -18
- package/docs/publication-authority.md +4 -4
- package/docs/publish-transaction.md +78 -31
- package/docs/release-candidate.md +24 -0
- package/docs/release-flow.md +50 -32
- package/docs/release-governance.md +31 -31
- package/docs/release-passport.md +4 -0
- package/docs/release-propagation.md +57 -12
- package/docs/reusable-build-surface.md +95 -27
- package/docs/runtime-train-validation.md +20 -2
- package/docs/stable-candidate-patrol.md +6 -6
- package/docs/toolkit-observability.md +22 -0
- package/docs/versioning.md +6 -4
- package/docs/web-surface-deployments.md +62 -0
- package/package.json +7 -5
- package/packages/core/README.md +61 -4
- package/packages/core/buildchain-contract.js +8 -4
- package/packages/core/cache-evidence.js +1 -0
- package/packages/core/diagnostics.js +105 -30
- package/packages/core/github-governance-authority.js +10 -25
- package/packages/core/index.js +40 -0
- package/packages/core/paper-fleet.js +260 -0
- package/packages/core/paper-repository.js +210 -0
- package/packages/core/paper-work.js +365 -0
- package/packages/core/paper.js +3180 -0
- package/packages/core/public-surface-audit.js +26 -75
- package/packages/core/public-surface-cli.js +117 -0
- package/packages/core/publication-artifact.js +1 -6
- package/packages/core/publication-authority.js +1 -0
- package/packages/core/publication-reproducibility.js +947 -0
- package/packages/core/publication-sealed-bundle.js +190 -0
- package/packages/core/publish-transaction.js +147 -17
- package/packages/core/release-candidate.js +234 -0
- package/packages/core/release-passport.js +483 -201
- package/packages/core/release-propagation.js +175 -1
- package/scripts/auditable-demo.mjs +119 -5
- package/scripts/aws-codebuild-toolchain.mjs +285 -0
- package/scripts/aws-macos-jit-core.mjs +378 -0
- package/scripts/aws-macos-jit.mjs +123 -0
- package/scripts/aws-runner-burst-core.mjs +248 -0
- package/scripts/aws-runner-burst.mjs +79 -0
- package/scripts/aws-windows-jit-core.mjs +374 -0
- package/scripts/aws-windows-jit.mjs +121 -0
- package/scripts/build-contract-core.mjs +69 -6
- package/scripts/build-standalone-binary.mjs +23 -0
- package/scripts/buildchain-cli-help.mjs +256 -0
- package/scripts/buildchain-contract-lock.mjs +1 -1
- package/scripts/check-internal-architecture.mjs +69 -2
- package/scripts/check-inventory.mjs +69 -2
- package/scripts/check-javascript-syntax.mjs +31 -0
- package/scripts/check-maintainability.mjs +371 -0
- package/scripts/compiler-cache-evidence.mjs +221 -0
- package/scripts/dev-alpha-candidate-patrol.mjs +268 -43
- package/scripts/finalize-native-artifact-signing-result.mjs +75 -4
- package/scripts/generate-channel-promotion-workflow.mjs +3 -12
- package/scripts/generate-release-candidate-passport.mjs +4 -0
- package/scripts/generate-site-bundle.mjs +68 -188
- package/scripts/import-artifact-signing-results.mjs +64 -5
- package/scripts/inspect-artifact-signing-requests.mjs +7 -0
- package/scripts/maintainability-metrics.mjs +339 -0
- package/scripts/npm-publish-transaction.mjs +57 -6
- package/scripts/paper-work-fleet-cli.mjs +563 -0
- package/scripts/paper.mjs +631 -0
- package/scripts/promotion-channel-router.mjs +16 -4
- package/scripts/publication-reproducibility.mjs +62 -0
- package/scripts/release-propagation.mjs +39 -0
- package/scripts/resolve-build-contract.mjs +6 -0
- package/scripts/route-offline-runners.mjs +236 -0
- package/scripts/run-lifecycle-core.mjs +62 -1
- package/scripts/runtime-ref-core.mjs +23 -2
- package/scripts/seal-artifact-signing-requests.mjs +13 -6
- package/scripts/site-capability-metadata.mjs +202 -0
- package/scripts/stable-candidate-qualification.mjs +42 -0
- package/scripts/web-surface-core.mjs +272 -86
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import {
|
|
3
|
+
PAPER_WORK_BRANCH_PATTERN,
|
|
4
|
+
gitResult,
|
|
5
|
+
gitValue,
|
|
6
|
+
normalizedWorkBranch,
|
|
7
|
+
paperDevelopmentRef,
|
|
8
|
+
paperWorkSource,
|
|
9
|
+
remoteBranchObservation,
|
|
10
|
+
rootedPlan,
|
|
11
|
+
workCheck,
|
|
12
|
+
} from "./paper-repository.js";
|
|
13
|
+
|
|
14
|
+
export const PAPER_WORK_START_PLAN_CONTRACT =
|
|
15
|
+
"kungfu-buildchain-paper-work-start-plan";
|
|
16
|
+
export const PAPER_WORK_SUBMIT_PLAN_CONTRACT =
|
|
17
|
+
"kungfu-buildchain-paper-work-submit-plan";
|
|
18
|
+
|
|
19
|
+
function failedActions(checks) {
|
|
20
|
+
return checks
|
|
21
|
+
.filter((entry) => entry.status === "fail")
|
|
22
|
+
.map((entry) => ({
|
|
23
|
+
id: `repair-${entry.id}`,
|
|
24
|
+
command: entry.correctiveCommand,
|
|
25
|
+
description: entry.message,
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function createPaperWorkStartPlan({
|
|
30
|
+
cwd = process.cwd(),
|
|
31
|
+
topic = "",
|
|
32
|
+
branch = "",
|
|
33
|
+
} = {}) {
|
|
34
|
+
const resolvedCwd = path.resolve(cwd);
|
|
35
|
+
const source = paperWorkSource(resolvedCwd);
|
|
36
|
+
const targetBranch = normalizedWorkBranch(topic, branch);
|
|
37
|
+
const developmentRef = paperDevelopmentRef(resolvedCwd);
|
|
38
|
+
const remoteDevelopment = remoteBranchObservation(
|
|
39
|
+
resolvedCwd,
|
|
40
|
+
developmentRef,
|
|
41
|
+
);
|
|
42
|
+
const remoteTarget = targetBranch
|
|
43
|
+
? remoteBranchObservation(resolvedCwd, targetBranch)
|
|
44
|
+
: { observed: false, sha: "" };
|
|
45
|
+
const localTarget = targetBranch
|
|
46
|
+
? gitValue(resolvedCwd, [
|
|
47
|
+
"rev-parse",
|
|
48
|
+
"--verify",
|
|
49
|
+
`refs/heads/${targetBranch}`,
|
|
50
|
+
])
|
|
51
|
+
: "";
|
|
52
|
+
const remoteCommitPresent = remoteDevelopment.sha
|
|
53
|
+
? gitResult(resolvedCwd, [
|
|
54
|
+
"cat-file",
|
|
55
|
+
"-e",
|
|
56
|
+
`${remoteDevelopment.sha}^{commit}`,
|
|
57
|
+
]).ok
|
|
58
|
+
: false;
|
|
59
|
+
const checks = [
|
|
60
|
+
workCheck(
|
|
61
|
+
"repository.canonical-origin",
|
|
62
|
+
source.canonical,
|
|
63
|
+
"The paper repository has exactly one canonical kungfu-systems origin.",
|
|
64
|
+
"git remote -v",
|
|
65
|
+
),
|
|
66
|
+
workCheck(
|
|
67
|
+
"source.clean",
|
|
68
|
+
source.clean,
|
|
69
|
+
"The worktree is clean.",
|
|
70
|
+
"git status --short",
|
|
71
|
+
),
|
|
72
|
+
workCheck(
|
|
73
|
+
"source.development-ref",
|
|
74
|
+
source.branch === developmentRef,
|
|
75
|
+
`The current branch is the configured development ref ${developmentRef}.`,
|
|
76
|
+
`git switch ${developmentRef}`,
|
|
77
|
+
),
|
|
78
|
+
workCheck(
|
|
79
|
+
"remote.development-ref",
|
|
80
|
+
remoteDevelopment.ok,
|
|
81
|
+
`origin/${developmentRef} resolves to an exact commit.`,
|
|
82
|
+
`git fetch origin ${developmentRef}`,
|
|
83
|
+
),
|
|
84
|
+
workCheck(
|
|
85
|
+
"source.remote-aligned",
|
|
86
|
+
Boolean(remoteDevelopment.sha) && source.head === remoteDevelopment.sha,
|
|
87
|
+
"HEAD equals the exact remote development commit.",
|
|
88
|
+
`git fetch origin ${developmentRef} && git merge --ff-only origin/${developmentRef}`,
|
|
89
|
+
),
|
|
90
|
+
workCheck(
|
|
91
|
+
"source.remote-commit-present",
|
|
92
|
+
remoteCommitPresent,
|
|
93
|
+
"The exact remote development commit is present locally.",
|
|
94
|
+
`git fetch origin ${developmentRef}`,
|
|
95
|
+
),
|
|
96
|
+
workCheck(
|
|
97
|
+
"target.safe-name",
|
|
98
|
+
Boolean(targetBranch),
|
|
99
|
+
"The work branch uses an allowed non-protected prefix and safe slug.",
|
|
100
|
+
"use feature|fix|docs|chore|ci|refactor/<slug>",
|
|
101
|
+
),
|
|
102
|
+
workCheck(
|
|
103
|
+
"target.absent",
|
|
104
|
+
Boolean(targetBranch) &&
|
|
105
|
+
remoteTarget.observed &&
|
|
106
|
+
!localTarget &&
|
|
107
|
+
!remoteTarget.sha,
|
|
108
|
+
"The work branch does not already exist locally or remotely.",
|
|
109
|
+
"choose a fresh work branch name",
|
|
110
|
+
),
|
|
111
|
+
];
|
|
112
|
+
const ok = checks.every((entry) => entry.status === "pass");
|
|
113
|
+
return rootedPlan({
|
|
114
|
+
schemaVersion: 1,
|
|
115
|
+
contract: PAPER_WORK_START_PLAN_CONTRACT,
|
|
116
|
+
ok,
|
|
117
|
+
cwd: resolvedCwd,
|
|
118
|
+
dryRun: true,
|
|
119
|
+
source: {
|
|
120
|
+
...source,
|
|
121
|
+
developmentRef,
|
|
122
|
+
remoteDevelopmentSha: remoteDevelopment.sha,
|
|
123
|
+
},
|
|
124
|
+
target: { branch: targetBranch, startSha: remoteDevelopment.sha },
|
|
125
|
+
checks,
|
|
126
|
+
mutation: {
|
|
127
|
+
kind: "local-branch-create",
|
|
128
|
+
force: false,
|
|
129
|
+
command: targetBranch
|
|
130
|
+
? `git switch -c ${targetBranch} ${remoteDevelopment.sha || `<origin/${developmentRef}>`}`
|
|
131
|
+
: "",
|
|
132
|
+
},
|
|
133
|
+
nextActions: ok
|
|
134
|
+
? [
|
|
135
|
+
{
|
|
136
|
+
id: "create-work-branch",
|
|
137
|
+
command: `buildchain paper work start ${targetBranch} --branch ${targetBranch} --execute --json`,
|
|
138
|
+
description:
|
|
139
|
+
"Create the local work branch from the exact observed remote development commit.",
|
|
140
|
+
},
|
|
141
|
+
]
|
|
142
|
+
: failedActions(checks),
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export function executePaperWorkStart(plan) {
|
|
147
|
+
if (!plan || plan.contract !== PAPER_WORK_START_PLAN_CONTRACT || !plan.ok) {
|
|
148
|
+
return {
|
|
149
|
+
...plan,
|
|
150
|
+
ok: false,
|
|
151
|
+
dryRun: false,
|
|
152
|
+
errorCode: "paper-work-start-blocked",
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
const fresh = createPaperWorkStartPlan({
|
|
156
|
+
cwd: plan.cwd,
|
|
157
|
+
branch: plan.target.branch,
|
|
158
|
+
});
|
|
159
|
+
if (!fresh.ok || fresh.planRoot !== plan.planRoot) {
|
|
160
|
+
return {
|
|
161
|
+
...fresh,
|
|
162
|
+
ok: false,
|
|
163
|
+
dryRun: false,
|
|
164
|
+
errorCode: "paper-work-start-race",
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
const switched = gitResult(plan.cwd, [
|
|
168
|
+
"switch",
|
|
169
|
+
"-c",
|
|
170
|
+
plan.target.branch,
|
|
171
|
+
plan.target.startSha,
|
|
172
|
+
]);
|
|
173
|
+
return {
|
|
174
|
+
...fresh,
|
|
175
|
+
ok: switched.ok,
|
|
176
|
+
dryRun: false,
|
|
177
|
+
created: switched.ok,
|
|
178
|
+
errorCode: switched.ok ? "" : "paper-work-branch-create-failed",
|
|
179
|
+
stderr: switched.ok ? "" : switched.error || switched.stderr,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export function createPaperWorkSubmitPlan({
|
|
184
|
+
cwd = process.cwd(),
|
|
185
|
+
pullRequests = [],
|
|
186
|
+
pullRequestObservation = { ok: true },
|
|
187
|
+
} = {}) {
|
|
188
|
+
const resolvedCwd = path.resolve(cwd);
|
|
189
|
+
const source = paperWorkSource(resolvedCwd);
|
|
190
|
+
const developmentRef = paperDevelopmentRef(resolvedCwd);
|
|
191
|
+
const remoteDevelopment = remoteBranchObservation(
|
|
192
|
+
resolvedCwd,
|
|
193
|
+
developmentRef,
|
|
194
|
+
);
|
|
195
|
+
const remoteWork = source.branch
|
|
196
|
+
? remoteBranchObservation(resolvedCwd, source.branch)
|
|
197
|
+
: { observed: false, sha: "" };
|
|
198
|
+
const developmentAncestor =
|
|
199
|
+
Boolean(remoteDevelopment.sha) &&
|
|
200
|
+
gitResult(resolvedCwd, [
|
|
201
|
+
"merge-base",
|
|
202
|
+
"--is-ancestor",
|
|
203
|
+
remoteDevelopment.sha,
|
|
204
|
+
source.head,
|
|
205
|
+
]).ok;
|
|
206
|
+
const remoteWorkAncestor =
|
|
207
|
+
remoteWork.observed &&
|
|
208
|
+
(!remoteWork.sha ||
|
|
209
|
+
gitResult(resolvedCwd, [
|
|
210
|
+
"merge-base",
|
|
211
|
+
"--is-ancestor",
|
|
212
|
+
remoteWork.sha,
|
|
213
|
+
source.head,
|
|
214
|
+
]).ok);
|
|
215
|
+
const wrongBasePullRequests = pullRequests.filter(
|
|
216
|
+
(entry) =>
|
|
217
|
+
entry.headRefName === source.branch &&
|
|
218
|
+
entry.baseRefName !== developmentRef,
|
|
219
|
+
);
|
|
220
|
+
const matchingPullRequest = pullRequests.find(
|
|
221
|
+
(entry) =>
|
|
222
|
+
entry.headRefName === source.branch &&
|
|
223
|
+
entry.baseRefName === developmentRef,
|
|
224
|
+
);
|
|
225
|
+
const checks = [
|
|
226
|
+
workCheck(
|
|
227
|
+
"repository.canonical-origin",
|
|
228
|
+
source.canonical,
|
|
229
|
+
"The paper repository has exactly one canonical kungfu-systems origin.",
|
|
230
|
+
"git remote -v",
|
|
231
|
+
),
|
|
232
|
+
workCheck(
|
|
233
|
+
"source.clean",
|
|
234
|
+
source.clean,
|
|
235
|
+
"The worktree is clean.",
|
|
236
|
+
"git status --short",
|
|
237
|
+
),
|
|
238
|
+
workCheck(
|
|
239
|
+
"source.safe-work-branch",
|
|
240
|
+
PAPER_WORK_BRANCH_PATTERN.test(source.branch),
|
|
241
|
+
"The current branch is an allowed non-protected work branch.",
|
|
242
|
+
"buildchain paper work start <topic>",
|
|
243
|
+
),
|
|
244
|
+
workCheck(
|
|
245
|
+
"source.committed",
|
|
246
|
+
/^[0-9a-f]{40}$/i.test(source.head),
|
|
247
|
+
"The submitted source resolves to an exact commit.",
|
|
248
|
+
"git status --short",
|
|
249
|
+
),
|
|
250
|
+
workCheck(
|
|
251
|
+
"remote.development-ref",
|
|
252
|
+
remoteDevelopment.ok,
|
|
253
|
+
`origin/${developmentRef} resolves to an exact commit.`,
|
|
254
|
+
`git fetch origin ${developmentRef}`,
|
|
255
|
+
),
|
|
256
|
+
workCheck(
|
|
257
|
+
"source.contains-development",
|
|
258
|
+
developmentAncestor,
|
|
259
|
+
"The work branch contains the exact remote development commit.",
|
|
260
|
+
`git fetch origin ${developmentRef} && git rebase origin/${developmentRef}`,
|
|
261
|
+
),
|
|
262
|
+
workCheck(
|
|
263
|
+
"remote.work-fast-forward",
|
|
264
|
+
remoteWorkAncestor,
|
|
265
|
+
"The remote work branch is absent or can be advanced without force.",
|
|
266
|
+
`git fetch origin ${source.branch}`,
|
|
267
|
+
),
|
|
268
|
+
workCheck(
|
|
269
|
+
"pull-request.target",
|
|
270
|
+
wrongBasePullRequests.length === 0,
|
|
271
|
+
`No open pull request targets a branch other than ${developmentRef}.`,
|
|
272
|
+
"close or retarget the conflicting pull request",
|
|
273
|
+
),
|
|
274
|
+
workCheck(
|
|
275
|
+
"pull-request.observed",
|
|
276
|
+
pullRequestObservation.ok === true,
|
|
277
|
+
"Open pull requests for the source branch were observed successfully.",
|
|
278
|
+
"gh auth status",
|
|
279
|
+
),
|
|
280
|
+
];
|
|
281
|
+
const ok = checks.every((entry) => entry.status === "pass");
|
|
282
|
+
return rootedPlan({
|
|
283
|
+
schemaVersion: 1,
|
|
284
|
+
contract: PAPER_WORK_SUBMIT_PLAN_CONTRACT,
|
|
285
|
+
ok,
|
|
286
|
+
cwd: resolvedCwd,
|
|
287
|
+
dryRun: true,
|
|
288
|
+
repository: source.repository,
|
|
289
|
+
source: {
|
|
290
|
+
branch: source.branch,
|
|
291
|
+
sha: source.head,
|
|
292
|
+
remoteSha: remoteWork.sha,
|
|
293
|
+
},
|
|
294
|
+
target: { branch: developmentRef, sha: remoteDevelopment.sha },
|
|
295
|
+
pullRequest: matchingPullRequest || null,
|
|
296
|
+
checks,
|
|
297
|
+
mutation: {
|
|
298
|
+
kind: "normal-push-and-pull-request",
|
|
299
|
+
force: false,
|
|
300
|
+
pushCommand: `git push --set-upstream origin HEAD:refs/heads/${source.branch}`,
|
|
301
|
+
pullRequestCommand: matchingPullRequest
|
|
302
|
+
? ""
|
|
303
|
+
: `gh pr create --repo ${source.repository} --base ${developmentRef} --head ${source.branch}`,
|
|
304
|
+
},
|
|
305
|
+
nextActions: ok
|
|
306
|
+
? [
|
|
307
|
+
{
|
|
308
|
+
id: matchingPullRequest ? "reuse-pull-request" : "submit-work",
|
|
309
|
+
command: matchingPullRequest
|
|
310
|
+
? ""
|
|
311
|
+
: "buildchain paper work submit --execute --json",
|
|
312
|
+
description: matchingPullRequest
|
|
313
|
+
? "Continue the existing correctly targeted pull request."
|
|
314
|
+
: "Push without force and open a pull request to the configured development ref.",
|
|
315
|
+
url: matchingPullRequest?.url || "",
|
|
316
|
+
},
|
|
317
|
+
]
|
|
318
|
+
: failedActions(checks),
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
export function executePaperWorkSubmitPush(plan) {
|
|
323
|
+
if (!plan || plan.contract !== PAPER_WORK_SUBMIT_PLAN_CONTRACT || !plan.ok) {
|
|
324
|
+
return {
|
|
325
|
+
...plan,
|
|
326
|
+
ok: false,
|
|
327
|
+
dryRun: false,
|
|
328
|
+
pushed: false,
|
|
329
|
+
errorCode: "paper-work-submit-blocked",
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
const currentHead = gitValue(plan.cwd, ["rev-parse", "HEAD"]);
|
|
333
|
+
const currentBranch = gitValue(plan.cwd, ["branch", "--show-current"]);
|
|
334
|
+
const currentClean =
|
|
335
|
+
gitResult(plan.cwd, ["status", "--porcelain"]).stdout === "";
|
|
336
|
+
const target = remoteBranchObservation(plan.cwd, plan.target.branch);
|
|
337
|
+
if (
|
|
338
|
+
currentHead !== plan.source.sha ||
|
|
339
|
+
currentBranch !== plan.source.branch ||
|
|
340
|
+
!currentClean ||
|
|
341
|
+
target.sha !== plan.target.sha
|
|
342
|
+
) {
|
|
343
|
+
return {
|
|
344
|
+
...plan,
|
|
345
|
+
ok: false,
|
|
346
|
+
dryRun: false,
|
|
347
|
+
pushed: false,
|
|
348
|
+
errorCode: "paper-work-submit-race",
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
const pushed = gitResult(plan.cwd, [
|
|
352
|
+
"push",
|
|
353
|
+
"--set-upstream",
|
|
354
|
+
"origin",
|
|
355
|
+
`HEAD:refs/heads/${plan.source.branch}`,
|
|
356
|
+
]);
|
|
357
|
+
return {
|
|
358
|
+
...plan,
|
|
359
|
+
ok: pushed.ok,
|
|
360
|
+
dryRun: false,
|
|
361
|
+
pushed: pushed.ok,
|
|
362
|
+
errorCode: pushed.ok ? "" : "paper-work-push-failed",
|
|
363
|
+
stderr: pushed.ok ? "" : pushed.error || pushed.stderr,
|
|
364
|
+
};
|
|
365
|
+
}
|