@bridge_gpt/mcp-server 0.2.73 → 0.2.74
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/README.md +5 -5
- package/build/agent-launchers/claude-executor-adapter.js +12 -0
- package/build/agents.generated.js +3 -3
- package/build/bridge-config.js +7 -1
- package/build/bridge-permissions.js +3 -0
- package/build/command-provisioning.js +4 -3
- package/build/commands.generated.js +5 -5
- package/build/conductor/bridge-api-client.js +26 -1
- package/build/conductor/command-drift.js +1 -1
- package/build/conductor/declared-extras.js +335 -0
- package/build/conductor/doctor.js +2 -0
- package/build/conductor/driver-pass-output.js +104 -0
- package/build/conductor/driver-pass.js +571 -0
- package/build/conductor/epic-branch-ci-inspection.js +61 -16
- package/build/conductor/epic-implementer-cli.js +33 -0
- package/build/conductor/epic-server-sfcc-upload.js +1567 -0
- package/build/conductor/epic-server-sfcc.js +58 -80
- package/build/conductor/epic-server.js +57 -4
- package/build/conductor/gate-discovery.js +46 -6
- package/build/conductor/gate-settings-review.js +51 -14
- package/build/credential-delivery.js +280 -0
- package/build/credential-launch-safety.js +142 -0
- package/build/credential-materialization.js +91 -16
- package/build/credential-references-node-deps.js +29 -0
- package/build/credential-references.js +1394 -0
- package/build/credential-references.test-fixtures.js +211 -0
- package/build/credential-scan-conventions.js +145 -0
- package/build/credential-scan.js +517 -0
- package/build/credential-store.js +50 -0
- package/build/credentials-cli.js +252 -3
- package/build/dependency-install-declarations.js +47 -1
- package/build/docs.generated.js +8 -1
- package/build/doctor.js +41 -0
- package/build/drive-epic.js +297 -37
- package/build/epic-branch-ci-summary.js +18 -1
- package/build/epic-capability-statement.js +71 -3
- package/build/epic-ci-workflow-drift.js +52 -13
- package/build/epic-ci-workflow-install.js +31 -6
- package/build/epic-ci-workflow-v3.js +273 -0
- package/build/epic-ci-workflow.js +128 -7
- package/build/epic-implementer-bin.js +161 -70
- package/build/epic-launch-context.js +102 -7
- package/build/epic-server-record.js +30 -15
- package/build/executor/credential-delivery-step.js +168 -0
- package/build/executor/deps.js +3 -1
- package/build/executor/env.js +39 -1
- package/build/executor/epic-server-context.js +23 -7
- package/build/executor/guarded-fast-forward-push.js +13 -8
- package/build/executor/job-runner.js +159 -17
- package/build/executor/permissions.js +85 -3
- package/build/executor/prompt-spec.js +37 -3
- package/build/executor-launch.js +4 -2
- package/build/git-exclude-lock.js +187 -0
- package/build/index.js +398 -269
- package/build/install-bridge-conductor-answers.js +84 -21
- package/build/install-bridge-conductor-apply.js +30 -1
- package/build/install-bridge-conductor-assessment.js +375 -48
- package/build/install-bridge-conductor-compact.js +27 -2
- package/build/install-bridge-conductor-contracts.js +10 -1
- package/build/install-bridge-conductor-gate.js +124 -11
- package/build/install-bridge-conductor-setup.js +46 -8
- package/build/install-bridge-conductor.js +625 -113
- package/build/install-bridge.js +88 -11
- package/build/install-doctor.js +38 -8
- package/build/install-sfcc-detection.js +120 -0
- package/build/install-sfcc-setup.js +185 -0
- package/build/mcp-grant-candidates.js +108 -96
- package/build/mcp-invoke.js +168 -4
- package/build/mcp-provisioning.js +21 -4
- package/build/mcp-server-invocation.js +13 -0
- package/build/merge-workflow-install.js +9 -1
- package/build/pipelines.generated.js +2 -1
- package/build/plane/status.js +8 -2
- package/build/printed-remedy-commands.js +5 -0
- package/build/project-root.js +40 -0
- package/build/readme.generated.js +1 -1
- package/build/repository-state-paths.js +5 -2
- package/build/repository-toolchains.js +6 -3
- package/build/setup-epic.js +116 -15
- package/build/sfcc/credentials.js +3 -2
- package/build/sfcc/hostname.js +98 -2
- package/build/sfcc/tool-wrapper.js +6 -95
- package/build/start-tickets.js +193 -29
- package/build/test-support/executor-source-files.js +200 -0
- package/build/testing-config-client.js +25 -2
- package/build/third-party-mcp-targets.js +35 -4
- package/build/version.generated.js +3 -3
- package/build/with-credentials.js +208 -0
- package/build/worktree-credential-delivery.js +340 -0
- package/package.json +1 -1
|
@@ -19,13 +19,48 @@
|
|
|
19
19
|
* BAPI-1546: `recipe` says whether repository epic-server GUIDANCE was found at
|
|
20
20
|
* setup. It never means a run recipe was proven or that an epic server is live:
|
|
21
21
|
* the driver proves its recipe per run, and a missing server is a hand-off.
|
|
22
|
+
*
|
|
23
|
+
* BAPI-1668: the stored payload stays value-only. It gains one optional,
|
|
24
|
+
* closed-vocabulary flag, `sfcc_upload` ("available" | "absent"), published only
|
|
25
|
+
* when the epic-server record carries an approved SFCC sandbox. This module also
|
|
26
|
+
* exports the planner-facing verification guidance text
|
|
27
|
+
* (`EPIC_SERVER_VERIFICATION_LEAD`, `EPIC_SERVER_VERIFICATION_GUIDANCE`,
|
|
28
|
+
* `EPIC_SERVER_LOCAL_SFCC_UPLOAD_GUIDANCE`) and `renderEpicServerVerificationGuidance`.
|
|
29
|
+
* Planners read the Python renderer; this TypeScript copy is the contract both
|
|
30
|
+
* runtimes are tested against, and a parity test compares the literals.
|
|
31
|
+
* The guidance is advisory configured capability, never runtime proof or
|
|
32
|
+
* authorization.
|
|
22
33
|
*/
|
|
23
34
|
import { isGrantableServerName, MCP_GRANT_MAX_SERVERS } from "./mcp-grant.js";
|
|
24
35
|
export const EPIC_CAPABILITY_STATEMENT_VERSION = 1;
|
|
25
36
|
const MODES = ["none", "local", "sfcc_shared_active", "unknown"];
|
|
26
37
|
const RECIPES = ["present", "absent", "unknown"];
|
|
27
38
|
const GRANT_STATES = ["present", "absent", "unusable"];
|
|
28
|
-
const KEYS = [
|
|
39
|
+
const KEYS = [
|
|
40
|
+
"version",
|
|
41
|
+
"approved_servers",
|
|
42
|
+
"epic_server_mode",
|
|
43
|
+
"recipe",
|
|
44
|
+
"grant_state",
|
|
45
|
+
"written_at",
|
|
46
|
+
"sfcc_upload",
|
|
47
|
+
];
|
|
48
|
+
const SFCC_UPLOAD_STATES = ["available", "absent"];
|
|
49
|
+
/**
|
|
50
|
+
* Planner-facing verification guidance. This is the TypeScript copy of the
|
|
51
|
+
* contract the Python renderer emits. Do NOT append it to the implement-worker
|
|
52
|
+
* prompt: the existing epic-server worker builders own those instructions, and a
|
|
53
|
+
* second copy would let the two drift. Each value is one single-line
|
|
54
|
+
* double-quoted literal so the parity test can extract it.
|
|
55
|
+
*/
|
|
56
|
+
export const EPIC_SERVER_VERIFICATION_LEAD = "How e2e_tests and rendered_ui_review steps are verified in this mode:";
|
|
57
|
+
export const EPIC_SERVER_VERIFICATION_GUIDANCE = {
|
|
58
|
+
none: "No epic server is configured for this repository. A step that needs the running application cannot run here. Plan it as a recorded, visible hand-off item, and still write its test code.",
|
|
59
|
+
local: "The run has one local epic server, shared by turns. Plan these steps as runnable. The worker takes a turn at its own head with epic-implementer epic-server turn acquire, runs the check against the address that turn prints, then releases the turn. Do not plan steps that install, build, start, or stop a dev server, or that choose a port or origin. The recipe line above does not change this, because the driver proves the recipe at run start. If the server is unavailable at run time, the worker records the hand-off itself.",
|
|
60
|
+
sfcc_shared_active: "The run uses one shared SFCC sandbox and one shared code version for the whole epic. Plan these steps as runnable. Before each check, the worker uploads only the cartridge files its ticket changed with epic-implementer epic-server sfcc-upload, then runs the check against the sandbox storefront origin it is given at run time. Do not plan a whole-cartridge upload, a new or per-ticket code version, a code version switch, a Managed Runtime (MRT) push, or the repository deploy workflow. Storefront Next React code outside the cartridges is not uploaded. If the upload fails, the worker records the hand-off itself.",
|
|
61
|
+
unknown: "The epic server setting could not be read. Treat it as not configured. Plan a step that needs the running application as a recorded, visible hand-off item, and still write its test code.",
|
|
62
|
+
};
|
|
63
|
+
export const EPIC_SERVER_LOCAL_SFCC_UPLOAD_GUIDANCE = "This repository also has an approved SFCC sandbox. Before each turn, the worker uploads only the cartridge files its ticket changed with epic-implementer epic-server sfcc-upload, so the local app, which calls the sandbox APIs, sees them. Do not plan a whole-cartridge upload, a new or per-ticket code version, a code version switch, or a Managed Runtime (MRT) push. If the upload fails, the worker records the hand-off itself.";
|
|
29
64
|
/**
|
|
30
65
|
* Build the statement from what was read. A usable grant is `present` even when
|
|
31
66
|
* it approves no extra server; an absent or unusable grant lists no servers.
|
|
@@ -51,7 +86,7 @@ export function buildEpicCapabilityStatement(grant, epicServer, now) {
|
|
|
51
86
|
mode = epicServer.record.mode;
|
|
52
87
|
recipe = epicServer.record.recipe ?? "unknown";
|
|
53
88
|
}
|
|
54
|
-
|
|
89
|
+
const statement = {
|
|
55
90
|
version: EPIC_CAPABILITY_STATEMENT_VERSION,
|
|
56
91
|
approved_servers: approved,
|
|
57
92
|
epic_server_mode: mode,
|
|
@@ -59,6 +94,11 @@ export function buildEpicCapabilityStatement(grant, epicServer, now) {
|
|
|
59
94
|
grant_state: grantState,
|
|
60
95
|
written_at: now.toISOString(),
|
|
61
96
|
};
|
|
97
|
+
// Independent of mode. Omitted (never "absent" or null) when no sandbox is recorded.
|
|
98
|
+
if (epicServer.state === "ok" && epicServer.record.sfcc !== undefined) {
|
|
99
|
+
statement.sfcc_upload = "available";
|
|
100
|
+
}
|
|
101
|
+
return statement;
|
|
62
102
|
}
|
|
63
103
|
/**
|
|
64
104
|
* Strictly validate a statement (unknown keys, an unsupported version, a bad
|
|
@@ -96,7 +136,12 @@ export function validateEpicCapabilityStatement(raw) {
|
|
|
96
136
|
Number.isNaN(Date.parse(writtenAt))) {
|
|
97
137
|
return null;
|
|
98
138
|
}
|
|
99
|
-
|
|
139
|
+
const hasUpload = Object.prototype.hasOwnProperty.call(doc, "sfcc_upload");
|
|
140
|
+
if (hasUpload &&
|
|
141
|
+
(typeof doc.sfcc_upload !== "string" || !SFCC_UPLOAD_STATES.includes(doc.sfcc_upload))) {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
const result = {
|
|
100
145
|
version: EPIC_CAPABILITY_STATEMENT_VERSION,
|
|
101
146
|
approved_servers: [...servers],
|
|
102
147
|
epic_server_mode: doc.epic_server_mode,
|
|
@@ -104,4 +149,27 @@ export function validateEpicCapabilityStatement(raw) {
|
|
|
104
149
|
grant_state: doc.grant_state,
|
|
105
150
|
written_at: writtenAt,
|
|
106
151
|
};
|
|
152
|
+
if (hasUpload)
|
|
153
|
+
result.sfcc_upload = doc.sfcc_upload;
|
|
154
|
+
return result;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* The lead line plus the validated mode's guidance paragraph, joined by one
|
|
158
|
+
* newline, or null when the statement is invalid. In `local` mode with
|
|
159
|
+
* `sfcc_upload` "available", the local upload sentence follows the paragraph
|
|
160
|
+
* after one space. No capability bullets, leading blank line, or trailing newline.
|
|
161
|
+
*
|
|
162
|
+
* This is the TypeScript copy of the planner-facing contract. It must NOT be
|
|
163
|
+
* appended to the implement-worker prompt: the epic-server worker instruction
|
|
164
|
+
* builders own those instructions.
|
|
165
|
+
*/
|
|
166
|
+
export function renderEpicServerVerificationGuidance(statement) {
|
|
167
|
+
const valid = validateEpicCapabilityStatement(statement);
|
|
168
|
+
if (valid === null)
|
|
169
|
+
return null;
|
|
170
|
+
let paragraph = EPIC_SERVER_VERIFICATION_GUIDANCE[valid.epic_server_mode];
|
|
171
|
+
if (valid.epic_server_mode === "local" && valid.sfcc_upload === "available") {
|
|
172
|
+
paragraph = `${paragraph} ${EPIC_SERVER_LOCAL_SFCC_UPLOAD_GUIDANCE}`;
|
|
173
|
+
}
|
|
174
|
+
return `${EPIC_SERVER_VERIFICATION_LEAD}\n${paragraph}`;
|
|
107
175
|
}
|
|
@@ -16,18 +16,21 @@
|
|
|
16
16
|
* Leaf module: no filesystem, network, or subprocess access, and no YAML parser.
|
|
17
17
|
* Nothing here logs file content.
|
|
18
18
|
*/
|
|
19
|
-
import { EPIC_CI_COMMAND_LINE_PREFIX, EPIC_CI_COMMAND_STEP_NAME, EPIC_CI_WORKFLOW_PATH, EPIC_CI_WORKFLOW_TOOLCHAINS_MARKER_KEY, renderEpicImplementerCiWorkflow, } from "./epic-ci-workflow.js";
|
|
19
|
+
import { EPIC_CI_COMMAND_LINE_PREFIX, EPIC_CI_COMMAND_STEP_NAME, EPIC_CI_WORKFLOW_DEPENDENCY_INSTALL_MARKER_KEY, EPIC_CI_WORKFLOW_PATH, EPIC_CI_WORKFLOW_TOOLCHAINS_MARKER_KEY, renderEpicImplementerCiWorkflow, serializeEpicCiDependencyInstall, } from "./epic-ci-workflow.js";
|
|
20
20
|
import { renderEpicCiWorkflowV1 } from "./epic-ci-workflow-v1.js";
|
|
21
21
|
import { renderEpicCiWorkflowV2 } from "./epic-ci-workflow-v2.js";
|
|
22
|
+
import { renderEpicCiWorkflowV3 } from "./epic-ci-workflow-v3.js";
|
|
23
|
+
import { parseDependencyInstallStrict } from "./dependency-install-declarations.js";
|
|
22
24
|
import { parseRepositoryToolchains, } from "./repository-toolchains.js";
|
|
23
25
|
import { TestCommandValidationError, validateTestCommand } from "./test-command-validation.js";
|
|
24
26
|
/**
|
|
25
27
|
* Renderers for every OLDER published version, keyed by version.
|
|
26
28
|
*
|
|
27
|
-
* Version 1 is frozen in `epic-ci-workflow-v1.ts
|
|
28
|
-
* `epic-ci-workflow-v2.ts`,
|
|
29
|
-
* recognizable. Version 1 uses only a command, because it
|
|
30
|
-
* toolchain;
|
|
29
|
+
* Version 1 is frozen in `epic-ci-workflow-v1.ts`, version 2 in
|
|
30
|
+
* `epic-ci-workflow-v2.ts`, and version 3 in `epic-ci-workflow-v3.ts`, each unchanged,
|
|
31
|
+
* so their exact bytes stay recognizable. Version 1 uses only a command, because it
|
|
32
|
+
* provisioned no toolchain; versions 2 and 3 also need the toolchain set their header
|
|
33
|
+
* records. This map
|
|
31
34
|
* is the published-version preservation contract: a version is added here only
|
|
32
35
|
* by freezing the renderer that shipped, and an entry is never edited or removed,
|
|
33
36
|
* or customers' installed files would stop being recognized as upgradeable.
|
|
@@ -37,6 +40,7 @@ import { TestCommandValidationError, validateTestCommand } from "./test-command-
|
|
|
37
40
|
export const EPIC_CI_WORKFLOW_HISTORICAL_RENDERERS = new Map([
|
|
38
41
|
[1, (command) => renderEpicCiWorkflowV1(command)],
|
|
39
42
|
[2, (command, toolchains) => (toolchains === null ? null : renderEpicCiWorkflowV2(command, toolchains))],
|
|
43
|
+
[3, (command, toolchains) => (toolchains === null ? null : renderEpicCiWorkflowV3(command, toolchains))],
|
|
40
44
|
]);
|
|
41
45
|
/**
|
|
42
46
|
* Extract and validate the command from the fixed stored-command step; `null`
|
|
@@ -97,15 +101,41 @@ export function extractEpicCiWorkflowToolchains(content) {
|
|
|
97
101
|
return null;
|
|
98
102
|
return parseRepositoryToolchains(markers[0].slice(prefix.length));
|
|
99
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* BAPI-1677 — extract the approved install entries from a version-4 header; `null` if
|
|
106
|
+
* the marker is absent, duplicated, malformed, not in the one canonical form, or
|
|
107
|
+
* refused by the shared rules. A marker-only claim is not enough: the caller must
|
|
108
|
+
* still reproduce the whole file from it.
|
|
109
|
+
*/
|
|
110
|
+
export function extractEpicCiWorkflowDependencyInstall(content) {
|
|
111
|
+
const prefix = "# " + EPIC_CI_WORKFLOW_DEPENDENCY_INSTALL_MARKER_KEY + ": ";
|
|
112
|
+
const markers = content.split("\n").filter((line) => line.startsWith(prefix));
|
|
113
|
+
if (markers.length !== 1)
|
|
114
|
+
return null;
|
|
115
|
+
const raw = markers[0].slice(prefix.length);
|
|
116
|
+
let parsed;
|
|
117
|
+
try {
|
|
118
|
+
parsed = JSON.parse(raw);
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
if (!Array.isArray(parsed))
|
|
124
|
+
return null;
|
|
125
|
+
const entries = parseDependencyInstallStrict(parsed);
|
|
126
|
+
if (entries === null || serializeEpicCiDependencyInstall(entries) !== raw)
|
|
127
|
+
return null;
|
|
128
|
+
return entries;
|
|
129
|
+
}
|
|
100
130
|
/**
|
|
101
131
|
* Classify `existing` (`null` when absent) against the proposal for
|
|
102
|
-
* `proposedCommand` and `
|
|
103
|
-
* line-ending differences are differences.
|
|
132
|
+
* `proposedCommand`, `proposedToolchains`, and `proposedDependencyInstall`. Comparison
|
|
133
|
+
* is on raw bytes; line-ending differences are differences.
|
|
104
134
|
*/
|
|
105
|
-
export function classifyEpicCiWorkflowContent(existing, proposedCommand, proposedToolchains) {
|
|
135
|
+
export function classifyEpicCiWorkflowContent(existing, proposedCommand, proposedToolchains, proposedDependencyInstall = []) {
|
|
106
136
|
if (existing === null)
|
|
107
137
|
return "not_installed";
|
|
108
|
-
if (existing === renderEpicImplementerCiWorkflow(proposedCommand, proposedToolchains))
|
|
138
|
+
if (existing === renderEpicImplementerCiWorkflow(proposedCommand, proposedToolchains, proposedDependencyInstall))
|
|
109
139
|
return "identical";
|
|
110
140
|
const extracted = extractEpicCiWorkflowCommand(existing);
|
|
111
141
|
if (extracted === null)
|
|
@@ -124,9 +154,18 @@ export function classifyEpicCiWorkflowContent(existing, proposedCommand, propose
|
|
|
124
154
|
if (rendered !== null && existing === rendered)
|
|
125
155
|
return "managed_version_older";
|
|
126
156
|
}
|
|
127
|
-
// Another current-version rendering of a different command or
|
|
128
|
-
|
|
129
|
-
|
|
157
|
+
// Another current-version rendering of a different command, toolchain set, or install list.
|
|
158
|
+
const dependencyInstall = extractEpicCiWorkflowDependencyInstall(existing);
|
|
159
|
+
if (toolchains !== null && dependencyInstall !== null) {
|
|
160
|
+
let rendered = null;
|
|
161
|
+
try {
|
|
162
|
+
rendered = renderEpicImplementerCiWorkflow(extracted, toolchains, dependencyInstall);
|
|
163
|
+
}
|
|
164
|
+
catch {
|
|
165
|
+
rendered = null;
|
|
166
|
+
}
|
|
167
|
+
if (rendered === existing)
|
|
168
|
+
return "managed_command_differs";
|
|
130
169
|
}
|
|
131
170
|
return "modified_or_unrecognized";
|
|
132
171
|
}
|
|
@@ -135,6 +174,6 @@ export const EPIC_CI_WORKFLOW_CLASSIFICATION_TEXT = {
|
|
|
135
174
|
not_installed: `${EPIC_CI_WORKFLOW_PATH} is not installed`,
|
|
136
175
|
identical: `${EPIC_CI_WORKFLOW_PATH} already matches the stored test command`,
|
|
137
176
|
managed_version_older: `${EPIC_CI_WORKFLOW_PATH} is an older Bridge-managed version and can be upgraded`,
|
|
138
|
-
managed_command_differs: `${EPIC_CI_WORKFLOW_PATH} was rendered by Bridge for a different test command or toolchain set and can be updated`,
|
|
177
|
+
managed_command_differs: `${EPIC_CI_WORKFLOW_PATH} was rendered by Bridge for a different test command or toolchain set, or a different install list, and can be updated`,
|
|
139
178
|
modified_or_unrecognized: `${EPIC_CI_WORKFLOW_PATH} has been modified or is not a file Bridge rendered`,
|
|
140
179
|
};
|
|
@@ -36,6 +36,7 @@ import { EPIC_CI_GATE_JOB_TIMEOUT_MINUTES, EPIC_CI_TEST_JOB_TIMEOUT_MINUTES, EPI
|
|
|
36
36
|
import { EPIC_CI_WORKFLOW_CLASSIFICATION_TEXT, classifyEpicCiWorkflowContent, } from "./epic-ci-workflow-drift.js";
|
|
37
37
|
import { describeToolchainSet, RepositoryToolchainError, validateRepositoryToolchains, } from "./repository-toolchains.js";
|
|
38
38
|
import { installArtifactSet, } from "./merge-workflow-install.js";
|
|
39
|
+
import { parseDependencyInstallStrict } from "./dependency-install-declarations.js";
|
|
39
40
|
import { TestCommandValidationError, validateTestCommand } from "./test-command-validation.js";
|
|
40
41
|
/** Managed branch for a fresh installation. */
|
|
41
42
|
export const EPIC_CI_WORKFLOW_INSTALL_BRANCH = "bridge/epic-implementer-ci-v" + String(EPIC_CI_WORKFLOW_RENDERER_VERSION);
|
|
@@ -55,10 +56,12 @@ export const EPIC_CI_WORKFLOW_UPGRADE_BRANCH = "bridge/epic-implementer-ci-upgra
|
|
|
55
56
|
export const EPIC_CI_WORKFLOW_HISTORICAL_INSTALL_BRANCHES = [
|
|
56
57
|
"bridge/epic-implementer-ci-v1",
|
|
57
58
|
"bridge/epic-implementer-ci-v2",
|
|
59
|
+
"bridge/epic-implementer-ci-v3",
|
|
58
60
|
];
|
|
59
61
|
export const EPIC_CI_WORKFLOW_HISTORICAL_UPGRADE_BRANCHES = [
|
|
60
62
|
"bridge/epic-implementer-ci-upgrade-v1",
|
|
61
63
|
"bridge/epic-implementer-ci-upgrade-v2",
|
|
64
|
+
"bridge/epic-implementer-ci-upgrade-v3",
|
|
62
65
|
];
|
|
63
66
|
export const EPIC_CI_WORKFLOW_HISTORICAL_BRANCHES = [
|
|
64
67
|
...EPIC_CI_WORKFLOW_HISTORICAL_INSTALL_BRANCHES,
|
|
@@ -102,7 +105,7 @@ function markdownFence(text) {
|
|
|
102
105
|
* validated command and the resolved toolchains, so a raw server response,
|
|
103
106
|
* executor output, or a qualification log has no way in.
|
|
104
107
|
*/
|
|
105
|
-
export function renderEpicCiWorkflowPrBody(upgrade, toolchains, testCommand) {
|
|
108
|
+
export function renderEpicCiWorkflowPrBody(upgrade, toolchains, testCommand, dependencyInstall = []) {
|
|
106
109
|
const command = validateTestCommand(testCommand);
|
|
107
110
|
const setup = describeToolchainSet(toolchains);
|
|
108
111
|
return [
|
|
@@ -144,6 +147,20 @@ export function renderEpicCiWorkflowPrBody(upgrade, toolchains, testCommand) {
|
|
|
144
147
|
? setup.map((line) => "- " + line)
|
|
145
148
|
: ["- None. No supported dependency file was found, so nothing is installed."]),
|
|
146
149
|
"",
|
|
150
|
+
...(dependencyInstall.length > 0
|
|
151
|
+
? [
|
|
152
|
+
"These approved commands run in this order. One that runs a toolchain's manager at the",
|
|
153
|
+
"repository root replaces that manager's fixed install line above. Every other fixed",
|
|
154
|
+
"install line still runs. The test trial and every worker use the same commands:",
|
|
155
|
+
"",
|
|
156
|
+
...dependencyInstall.flatMap((entry) => [
|
|
157
|
+
"- In `" + entry.cwd + "`:",
|
|
158
|
+
"",
|
|
159
|
+
...markdownFence(entry.argv.join(" ")),
|
|
160
|
+
"",
|
|
161
|
+
]),
|
|
162
|
+
]
|
|
163
|
+
: ["No install commands are approved, so the fixed install lines above run.", ""]),
|
|
147
164
|
"Where no setup is listed for an ecosystem, nothing is installed for it. A test command that",
|
|
148
165
|
"needs more than the steps above must install it itself. Rust uses the toolchain the runner",
|
|
149
166
|
"provides. The version fallbacks are fixed in the generated file, not read from the network.",
|
|
@@ -182,6 +199,8 @@ export function buildEpicCiWorkflowArtifactSet(testCommand, toolchains,
|
|
|
182
199
|
* behavior.
|
|
183
200
|
*/
|
|
184
201
|
build = {}) {
|
|
202
|
+
// BAPI-1677: the sealed entries the owner approved. Never derived here.
|
|
203
|
+
const dependencyInstall = build.dependencyInstall ?? [];
|
|
185
204
|
return {
|
|
186
205
|
setName: "epic-ci-workflow",
|
|
187
206
|
installBranch: EPIC_CI_WORKFLOW_INSTALL_BRANCH,
|
|
@@ -191,7 +210,7 @@ build = {}) {
|
|
|
191
210
|
installPrTitle: EPIC_CI_WORKFLOW_INSTALL_COMMIT_SUBJECT,
|
|
192
211
|
upgradePrTitle: EPIC_CI_WORKFLOW_UPGRADE_COMMIT_SUBJECT,
|
|
193
212
|
historicalBranches: EPIC_CI_WORKFLOW_HISTORICAL_BRANCHES,
|
|
194
|
-
renderPrBody: (upgrade) => renderEpicCiWorkflowPrBody(upgrade, toolchains, testCommand),
|
|
213
|
+
renderPrBody: (upgrade) => renderEpicCiWorkflowPrBody(upgrade, toolchains, testCommand, dependencyInstall),
|
|
195
214
|
validateOptions: () => {
|
|
196
215
|
try {
|
|
197
216
|
validateTestCommand(testCommand);
|
|
@@ -209,15 +228,17 @@ build = {}) {
|
|
|
209
228
|
return { ok: false, reason: "toolchains_invalid" };
|
|
210
229
|
throw err;
|
|
211
230
|
}
|
|
231
|
+
if (parseDependencyInstallStrict([...dependencyInstall]) === null)
|
|
232
|
+
return { ok: false, reason: "dependency_install_invalid" };
|
|
212
233
|
return { ok: true, progress: [] };
|
|
213
234
|
},
|
|
214
235
|
artifacts: [
|
|
215
236
|
{
|
|
216
237
|
relPath: EPIC_CI_WORKFLOW_PATH,
|
|
217
|
-
render: () => renderEpicImplementerCiWorkflow(testCommand, toolchains),
|
|
238
|
+
render: () => renderEpicImplementerCiWorkflow(testCommand, toolchains, dependencyInstall),
|
|
218
239
|
progressLabel: "workflow",
|
|
219
240
|
classify: (existing) => {
|
|
220
|
-
const classification = classifyEpicCiWorkflowContent(existing, testCommand, toolchains);
|
|
241
|
+
const classification = classifyEpicCiWorkflowContent(existing, testCommand, toolchains, dependencyInstall);
|
|
221
242
|
const text = EPIC_CI_WORKFLOW_CLASSIFICATION_TEXT[classification];
|
|
222
243
|
if (classification === "modified_or_unrecognized") {
|
|
223
244
|
return { state: "conflict", reason: "workflow_modified_or_unrecognized", text };
|
|
@@ -247,14 +268,18 @@ build = {}) {
|
|
|
247
268
|
* and opening it changes no gate.
|
|
248
269
|
*/
|
|
249
270
|
export async function installEpicCiWorkflow(testCommand, toolchains, options, deps) {
|
|
250
|
-
const { createOnly, ...engineOptions } = options;
|
|
251
|
-
return await installArtifactSet(buildEpicCiWorkflowArtifactSet(testCommand, toolchains,
|
|
271
|
+
const { createOnly, dependencyInstall, ...engineOptions } = options;
|
|
272
|
+
return await installArtifactSet(buildEpicCiWorkflowArtifactSet(testCommand, toolchains, {
|
|
273
|
+
...(createOnly === true ? { createOnly: true } : {}),
|
|
274
|
+
...(dependencyInstall !== undefined ? { dependencyInstall } : {}),
|
|
275
|
+
}), engineOptions, deps);
|
|
252
276
|
}
|
|
253
277
|
const REFUSALS = new Set([
|
|
254
278
|
"workflow_modified_or_unrecognized",
|
|
255
279
|
"consent_declined",
|
|
256
280
|
"test_command_invalid",
|
|
257
281
|
"toolchains_invalid",
|
|
282
|
+
"dependency_install_invalid",
|
|
258
283
|
"historical_managed_pr_open",
|
|
259
284
|
]);
|
|
260
285
|
/** Map an install result to its status. `null` means the install was not attempted. */
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The FROZEN version-3 Epic Implementer CI workflow renderer (BAPI-1677).
|
|
3
|
+
*
|
|
4
|
+
* Version 3 (BAPI-1603) runs only for epic-targeted pull requests and installs
|
|
5
|
+
* dependencies with fixed toolchain lines. Version 4 installs the commands the owner
|
|
6
|
+
* approved. Customers hold files this renderer wrote, and the drift classifier
|
|
7
|
+
* recognizes such a file only by reproducing its ENTIRE bytes, so this module is a
|
|
8
|
+
* published contract: its output for a given command and toolchain set must never
|
|
9
|
+
* change, whatever happens to the current renderer (`epic-ci-workflow.ts`). It
|
|
10
|
+
* therefore owns every literal it emits and imports nothing from the current
|
|
11
|
+
* renderer. Only the validators and the canonical toolchain serializer are shared,
|
|
12
|
+
* and a change to either of those is a compatibility break for every renderer
|
|
13
|
+
* version, not only this one.
|
|
14
|
+
*
|
|
15
|
+
* Do not edit this file to change what the workflow does. A behavior change is a
|
|
16
|
+
* new renderer version in `epic-ci-workflow.ts`, with this function left as is.
|
|
17
|
+
*
|
|
18
|
+
* Leaf module: no filesystem, network, or subprocess access.
|
|
19
|
+
*/
|
|
20
|
+
import { serializeRepositoryToolchains, validateRepositoryToolchains, } from "./repository-toolchains.js";
|
|
21
|
+
import { validateTestCommand } from "./test-command-validation.js";
|
|
22
|
+
const V3_WORKFLOW_PATH = ".github/workflows/epic-implementer-ci.yml";
|
|
23
|
+
const V3_RENDERER_VERSION = 3;
|
|
24
|
+
const V3_VERSION_MARKER_KEY = "x-bridge-ci-renderer-version";
|
|
25
|
+
const V3_TOOLCHAINS_MARKER_KEY = "x-bridge-ci-toolchains";
|
|
26
|
+
const V3_COMMAND_STEP_NAME = "Run the stored test command";
|
|
27
|
+
/** The pinned action majors version 3 wrote. */
|
|
28
|
+
const V3_ACTION_CHECKOUT = "actions/checkout@v7";
|
|
29
|
+
const V3_ACTION_SETUP_NODE = "actions/setup-node@v7";
|
|
30
|
+
const V3_ACTION_SETUP_PYTHON = "actions/setup-python@v7";
|
|
31
|
+
const V3_ACTION_SETUP_GO = "actions/setup-go@v6";
|
|
32
|
+
const V3_ACTION_SETUP_PNPM = "pnpm/action-setup@v4";
|
|
33
|
+
const V3_ACTION_SETUP_BUN = "oven-sh/setup-bun@v2";
|
|
34
|
+
const V3_ACTION_SETUP_UV = "astral-sh/setup-uv@v6";
|
|
35
|
+
/** The fixed fallbacks version 3 wrote when a repository declared nothing. */
|
|
36
|
+
const V3_NODE_FALLBACK_MAJOR = "24";
|
|
37
|
+
const V3_PYTHON_FALLBACK_MINOR = "3.12";
|
|
38
|
+
const V3_PNPM_FALLBACK_MAJOR = "10";
|
|
39
|
+
const V3_YARN_BERRY_FALLBACK_MAJOR = "4";
|
|
40
|
+
const V3_BUN_VERSION_RANGE = "1.x";
|
|
41
|
+
const V3_POETRY_VERSION = "2.1.3";
|
|
42
|
+
const V3_WORKFLOW_NAME = "epic-implementer-ci";
|
|
43
|
+
const V3_CHECK_NAME = "epic-implementer-ci / gate";
|
|
44
|
+
const V3_TEST_JOB_TIMEOUT_MINUTES = 30;
|
|
45
|
+
const V3_GATE_JOB_TIMEOUT_MINUTES = 5;
|
|
46
|
+
const V3_COMMAND_LINE_PREFIX = " run: ";
|
|
47
|
+
/**
|
|
48
|
+
* Characters `JSON.stringify` leaves raw that a YAML parser may read as a line
|
|
49
|
+
* break or a byte-order mark (YAML 1.1 treats U+0085, U+2028 and U+2029 as
|
|
50
|
+
* breaks), plus DEL and the C1 controls. They are escaped as `\uXXXX`, which is
|
|
51
|
+
* still valid JSON and a valid YAML double-quoted escape.
|
|
52
|
+
*/
|
|
53
|
+
const YAML_UNSAFE_RAW = /[\u007f-\u009f\u2028\u2029\ufeff]/g;
|
|
54
|
+
/** Encode the command as one JSON string that is also a safe YAML scalar. */
|
|
55
|
+
function encodeCommandScalar(testCommand) {
|
|
56
|
+
return JSON.stringify(testCommand).replace(YAML_UNSAFE_RAW, (ch) => "\\u" + ch.charCodeAt(0).toString(16).padStart(4, "0"));
|
|
57
|
+
}
|
|
58
|
+
function nodeSetupLines(node) {
|
|
59
|
+
return [
|
|
60
|
+
" - name: Set up Node.js",
|
|
61
|
+
" uses: " + V3_ACTION_SETUP_NODE,
|
|
62
|
+
" with:",
|
|
63
|
+
node === "fixed"
|
|
64
|
+
? ' node-version: "' + V3_NODE_FALLBACK_MAJOR + '"'
|
|
65
|
+
: " node-version-file: " + node,
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
function pythonSetupLines(python) {
|
|
69
|
+
return [
|
|
70
|
+
" - name: Set up Python",
|
|
71
|
+
" uses: " + V3_ACTION_SETUP_PYTHON,
|
|
72
|
+
" with:",
|
|
73
|
+
python === "fixed"
|
|
74
|
+
? ' python-version: "' + V3_PYTHON_FALLBACK_MINOR + '"'
|
|
75
|
+
: " python-version-file: " + python,
|
|
76
|
+
];
|
|
77
|
+
}
|
|
78
|
+
function javaScriptSetupLines(js) {
|
|
79
|
+
switch (js.manager) {
|
|
80
|
+
case "npm":
|
|
81
|
+
return [...nodeSetupLines(js.node), " - name: Install dependencies", " run: npm ci"];
|
|
82
|
+
case "pnpm":
|
|
83
|
+
return [
|
|
84
|
+
" - name: Set up pnpm",
|
|
85
|
+
" uses: " + V3_ACTION_SETUP_PNPM,
|
|
86
|
+
// A declared `packageManager` is read by the action itself at CI runtime.
|
|
87
|
+
// Passing `version:` as well makes it fail with "Multiple versions of pnpm
|
|
88
|
+
// specified" whenever the two strings differ (a Corepack `+sha` suffix is
|
|
89
|
+
// enough), so the input is given only for the fixed fallback.
|
|
90
|
+
...(js.pnpm.source === "default" ? [" with:", ' version: "' + V3_PNPM_FALLBACK_MAJOR + '"'] : []),
|
|
91
|
+
...nodeSetupLines(js.node),
|
|
92
|
+
" - name: Install dependencies",
|
|
93
|
+
" run: pnpm install --frozen-lockfile",
|
|
94
|
+
];
|
|
95
|
+
case "yarn":
|
|
96
|
+
if (js.generation === "classic") {
|
|
97
|
+
return [...nodeSetupLines(js.node), " - name: Install dependencies", " run: yarn install --frozen-lockfile"];
|
|
98
|
+
}
|
|
99
|
+
// Corepack reads a declared Yarn version from package.json at CI runtime;
|
|
100
|
+
// the activation below is only the fallback major when none is declared.
|
|
101
|
+
return [
|
|
102
|
+
...nodeSetupLines(js.node),
|
|
103
|
+
" - name: Enable Corepack",
|
|
104
|
+
" run: corepack enable",
|
|
105
|
+
" - name: Activate Yarn",
|
|
106
|
+
" run: corepack prepare yarn@" + V3_YARN_BERRY_FALLBACK_MAJOR + " --activate",
|
|
107
|
+
" - name: Install dependencies",
|
|
108
|
+
" run: yarn install --immutable",
|
|
109
|
+
];
|
|
110
|
+
case "bun":
|
|
111
|
+
return [
|
|
112
|
+
" - name: Set up Bun",
|
|
113
|
+
" uses: " + V3_ACTION_SETUP_BUN,
|
|
114
|
+
" with:",
|
|
115
|
+
' bun-version: "' + V3_BUN_VERSION_RANGE + '"',
|
|
116
|
+
" - name: Install dependencies",
|
|
117
|
+
" run: bun install --frozen-lockfile",
|
|
118
|
+
];
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
const PROJECT_ENVIRONMENT_PATH_LINES = [
|
|
122
|
+
" - name: Add the project environment to PATH",
|
|
123
|
+
' run: echo "$GITHUB_WORKSPACE/.venv/bin" >> "$GITHUB_PATH"',
|
|
124
|
+
];
|
|
125
|
+
function pythonSetupLinesFor(py) {
|
|
126
|
+
const setup = pythonSetupLines(py.python);
|
|
127
|
+
switch (py.manager) {
|
|
128
|
+
case "uv":
|
|
129
|
+
return [
|
|
130
|
+
...setup,
|
|
131
|
+
" - name: Set up uv",
|
|
132
|
+
" uses: " + V3_ACTION_SETUP_UV,
|
|
133
|
+
" - name: Install dependencies",
|
|
134
|
+
" run: uv sync --frozen",
|
|
135
|
+
...PROJECT_ENVIRONMENT_PATH_LINES,
|
|
136
|
+
];
|
|
137
|
+
case "poetry":
|
|
138
|
+
return [
|
|
139
|
+
...setup,
|
|
140
|
+
" - name: Install Poetry",
|
|
141
|
+
" run: python -m pip install poetry==" + V3_POETRY_VERSION,
|
|
142
|
+
" - name: Configure Poetry",
|
|
143
|
+
" run: poetry config virtualenvs.in-project true",
|
|
144
|
+
" - name: Install dependencies",
|
|
145
|
+
" run: poetry install",
|
|
146
|
+
...PROJECT_ENVIRONMENT_PATH_LINES,
|
|
147
|
+
];
|
|
148
|
+
case "pip":
|
|
149
|
+
return [...setup, " - name: Install dependencies", " run: pip install -r requirements.txt"];
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
/** The setup steps for a validated set, in the fixed JavaScript, Python, Go order. */
|
|
153
|
+
function toolchainSetupLines(toolchains) {
|
|
154
|
+
const lines = [];
|
|
155
|
+
if (toolchains.javascript !== null)
|
|
156
|
+
lines.push(...javaScriptSetupLines(toolchains.javascript));
|
|
157
|
+
if (toolchains.python !== null)
|
|
158
|
+
lines.push(...pythonSetupLinesFor(toolchains.python));
|
|
159
|
+
if (toolchains.go !== null) {
|
|
160
|
+
lines.push(" - name: Set up Go", " uses: " + V3_ACTION_SETUP_GO, " with:", " go-version-file: " + toolchains.go.dependencyFile);
|
|
161
|
+
}
|
|
162
|
+
return lines;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Render the version-3 workflow for `testCommand` and the resolved `toolchains`.
|
|
166
|
+
* Deterministic: the same inputs always give the same bytes. Throws
|
|
167
|
+
* `TestCommandValidationError` for a bad command and `RepositoryToolchainError`
|
|
168
|
+
* for a toolchain set outside the closed vocabulary.
|
|
169
|
+
*/
|
|
170
|
+
export function renderEpicCiWorkflowV3(testCommand, toolchains) {
|
|
171
|
+
const command = validateTestCommand(testCommand);
|
|
172
|
+
const validated = validateRepositoryToolchains(toolchains);
|
|
173
|
+
const lines = [
|
|
174
|
+
"# ===========================================================================",
|
|
175
|
+
"# Epic Implementer CI gate — MANAGED FILE",
|
|
176
|
+
"#",
|
|
177
|
+
"# Generated by Bridge (`" + V3_WORKFLOW_PATH + "`). Do not hand-edit: the",
|
|
178
|
+
"# installer compares this file byte for byte against what it renders and",
|
|
179
|
+
"# refuses to overwrite a modified or unrecognized copy.",
|
|
180
|
+
"#",
|
|
181
|
+
"# " + V3_VERSION_MARKER_KEY + ": " + String(V3_RENDERER_VERSION),
|
|
182
|
+
"# " + V3_TOOLCHAINS_MARKER_KEY + ": " + serializeRepositoryToolchains(validated),
|
|
183
|
+
"#",
|
|
184
|
+
"# WHAT THIS WORKFLOW IS",
|
|
185
|
+
"#",
|
|
186
|
+
"# It publishes one required check, `" + V3_CHECK_NAME + "`, that the",
|
|
187
|
+
"# Bridge Epic Implementer reads before it merges a child pull request. The",
|
|
188
|
+
"# check is green only when the repository's stored test command passes.",
|
|
189
|
+
"#",
|
|
190
|
+
"# SCOPE: EPIC-TARGETED, SAME-REPOSITORY PULL REQUESTS ONLY",
|
|
191
|
+
"#",
|
|
192
|
+
"# The workflow runs only for pull requests that target an `epic/**` branch:",
|
|
193
|
+
"# the child pull requests the Epic Implementer merges into an epic branch. It",
|
|
194
|
+
"# does not run for other pull requests, including the final pull request into",
|
|
195
|
+
"# the default branch.",
|
|
196
|
+
"#",
|
|
197
|
+
"# The `tests` job runs only when the pull request head is this repository.",
|
|
198
|
+
"# A fork pull request never checks out or runs repository code; the gate",
|
|
199
|
+
"# passes for it immediately and says so. Nothing here uses a secret, and the",
|
|
200
|
+
"# token is read-only.",
|
|
201
|
+
"#",
|
|
202
|
+
"# DEPENDENCIES",
|
|
203
|
+
"#",
|
|
204
|
+
"# The setup steps before the test command were chosen from the lockfiles in",
|
|
205
|
+
"# the root of the repository's default branch when this file was generated;",
|
|
206
|
+
"# the toolchains line above records the choice. They install dependencies and",
|
|
207
|
+
"# nothing else. When no supported dependency file was found, nothing is",
|
|
208
|
+
"# installed for that ecosystem and the command must install what it needs",
|
|
209
|
+
"# itself.",
|
|
210
|
+
"#",
|
|
211
|
+
"# THE TEST COMMAND",
|
|
212
|
+
"#",
|
|
213
|
+
"# The command below is the repository's stored test command, run with bash",
|
|
214
|
+
"# from the repository root after the setup steps. To change it, save a new",
|
|
215
|
+
"# command through Bridge setup (`--test-command`) and re-run the installer; do",
|
|
216
|
+
"# not edit it here.",
|
|
217
|
+
"# ===========================================================================",
|
|
218
|
+
"name: " + V3_WORKFLOW_NAME,
|
|
219
|
+
"",
|
|
220
|
+
"on:",
|
|
221
|
+
" pull_request:",
|
|
222
|
+
" branches: ['epic/**']",
|
|
223
|
+
"",
|
|
224
|
+
"permissions:",
|
|
225
|
+
" contents: read",
|
|
226
|
+
"",
|
|
227
|
+
"jobs:",
|
|
228
|
+
" tests:",
|
|
229
|
+
" name: tests",
|
|
230
|
+
" if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}",
|
|
231
|
+
" runs-on: ubuntu-latest",
|
|
232
|
+
" timeout-minutes: " + String(V3_TEST_JOB_TIMEOUT_MINUTES),
|
|
233
|
+
" steps:",
|
|
234
|
+
" - name: Check out the pull request",
|
|
235
|
+
" uses: " + V3_ACTION_CHECKOUT,
|
|
236
|
+
" with:",
|
|
237
|
+
" persist-credentials: false",
|
|
238
|
+
...toolchainSetupLines(validated),
|
|
239
|
+
" - name: " + V3_COMMAND_STEP_NAME,
|
|
240
|
+
" shell: bash",
|
|
241
|
+
V3_COMMAND_LINE_PREFIX + encodeCommandScalar(command),
|
|
242
|
+
"",
|
|
243
|
+
" gate:",
|
|
244
|
+
" name: " + V3_CHECK_NAME,
|
|
245
|
+
" needs: [tests]",
|
|
246
|
+
" if: ${{ always() }}",
|
|
247
|
+
" runs-on: ubuntu-latest",
|
|
248
|
+
" timeout-minutes: " + String(V3_GATE_JOB_TIMEOUT_MINUTES),
|
|
249
|
+
" steps:",
|
|
250
|
+
" - name: Aggregate the Epic Implementer CI result",
|
|
251
|
+
" env:",
|
|
252
|
+
" HEAD_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name }}",
|
|
253
|
+
" THIS_REPOSITORY: ${{ github.repository }}",
|
|
254
|
+
" TESTS_RESULT: ${{ needs.tests.result }}",
|
|
255
|
+
" run: |",
|
|
256
|
+
" if [ -z \"$HEAD_REPOSITORY\" ] || [ -z \"$THIS_REPOSITORY\" ]; then",
|
|
257
|
+
" echo \"The pull request head repository could not be identified; the gate fails.\"",
|
|
258
|
+
" exit 1",
|
|
259
|
+
" fi",
|
|
260
|
+
" if [ \"$HEAD_REPOSITORY\" != \"$THIS_REPOSITORY\" ]; then",
|
|
261
|
+
" echo \"Fork pull request: repository code is never run for a fork, so the gate passes without running tests.\"",
|
|
262
|
+
" exit 0",
|
|
263
|
+
" fi",
|
|
264
|
+
" echo \"Tests: $TESTS_RESULT\"",
|
|
265
|
+
" if [ \"$TESTS_RESULT\" = \"success\" ]; then",
|
|
266
|
+
" exit 0",
|
|
267
|
+
" fi",
|
|
268
|
+
" echo \"The stored test command did not conclude 'success'; the gate fails.\"",
|
|
269
|
+
" exit 1",
|
|
270
|
+
"",
|
|
271
|
+
];
|
|
272
|
+
return lines.join("\n");
|
|
273
|
+
}
|