@rallycry/conveyor-agent 11.0.19 → 11.0.21
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/{boot-4ZNOCKFZ.js → boot-Z3EBJ7GX.js} +2 -2
- package/dist/{chunk-SR66HQKB.js → chunk-37J5MMQT.js} +1 -1
- package/dist/chunk-4ZDIBDQC.js +4926 -0
- package/dist/{chunk-GZRZGBIK.js → chunk-5WQHDGIW.js} +16 -2
- package/dist/{chunk-GL2DIQEQ.js → chunk-Q4FQOJ7D.js} +23 -4
- package/dist/{chunk-N5LEVAGA.js → chunk-WPXSZKMS.js} +912 -3170
- package/dist/cli.js +9 -14
- package/dist/index.d.ts +2 -15
- package/dist/index.js +4 -4
- package/dist/{serve-boot-RU5BYIK4.js → serve-boot-IRRHYA7W.js} +3 -3
- package/package.json +1 -1
- package/skills/conveyor-build/SKILL.md +3 -4
- package/skills/conveyor-build/references/pack-path.md +13 -7
- package/skills/conveyor-review/SKILL.md +15 -2
- package/dist/chunk-WS7QRB37.js +0 -2590
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
|
+
POD_PROFILE_ENV,
|
|
2
3
|
awaitGitReady,
|
|
3
4
|
buildSessionPreviewPorts,
|
|
5
|
+
isPodProfile,
|
|
4
6
|
loadForwardPorts,
|
|
7
|
+
podProfileRunsWorkload,
|
|
5
8
|
readWorkspaceBytes,
|
|
6
9
|
statWorkspacePath,
|
|
7
10
|
workspacePathExists
|
|
8
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-4ZDIBDQC.js";
|
|
9
12
|
import {
|
|
10
13
|
reportBootMilestone
|
|
11
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-Q4FQOJ7D.js";
|
|
12
15
|
import {
|
|
13
16
|
runSetupCommand,
|
|
14
17
|
runStartCommand,
|
|
@@ -91,11 +94,21 @@ async function runDbSchemaSync(options) {
|
|
|
91
94
|
|
|
92
95
|
// src/setup/deps-sync.ts
|
|
93
96
|
import { join as join2 } from "path";
|
|
97
|
+
|
|
98
|
+
// src/setup/pod-profile-env.ts
|
|
99
|
+
function podRunsWorkload(env = process.env) {
|
|
100
|
+
const raw = env[POD_PROFILE_ENV]?.trim();
|
|
101
|
+
if (!raw || !isPodProfile(raw)) return true;
|
|
102
|
+
return podProfileRunsWorkload(raw);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// src/setup/deps-sync.ts
|
|
94
106
|
var INSTALLER_SCRIPT_CANDIDATES = ["scripts/install-deps.sh"];
|
|
95
107
|
var BUN_INSTALL = "bun install --frozen-lockfile";
|
|
96
108
|
var DEPS_SYNC_TIMEOUT_MS = 9e5;
|
|
97
109
|
var REGISTRY_KEY_ENV = "NPM_CACHE_READER_KEY";
|
|
98
110
|
function isDisabled2(env) {
|
|
111
|
+
if (!podRunsWorkload(env)) return true;
|
|
99
112
|
const flag = env.CONVEYOR_DEPS_SYNC?.trim().toLowerCase();
|
|
100
113
|
return flag === "0" || flag === "false";
|
|
101
114
|
}
|
|
@@ -276,6 +289,7 @@ function parseHostPort(value, defaultPort) {
|
|
|
276
289
|
}
|
|
277
290
|
function resolveSidecarTargets(env = process.env) {
|
|
278
291
|
const targets = [];
|
|
292
|
+
if (!podRunsWorkload(env)) return targets;
|
|
279
293
|
const databaseUrl = env.DATABASE_URL;
|
|
280
294
|
if (databaseUrl) {
|
|
281
295
|
try {
|
|
@@ -128,7 +128,7 @@ function errText(err) {
|
|
|
128
128
|
}
|
|
129
129
|
async function syncTaskBranchToRepo(deps, paths) {
|
|
130
130
|
const { git, log } = deps;
|
|
131
|
-
const { branch
|
|
131
|
+
const { branch } = deps.bundle.gitPlan;
|
|
132
132
|
try {
|
|
133
133
|
await git(["remote", "set-url", "origin", paths.remoteUrl], {
|
|
134
134
|
cwd: paths.repoDir,
|
|
@@ -140,6 +140,18 @@ async function syncTaskBranchToRepo(deps, paths) {
|
|
|
140
140
|
}
|
|
141
141
|
const credentialFailure = await persistCredentialHelper(deps, paths);
|
|
142
142
|
if (credentialFailure) return credentialFailure;
|
|
143
|
+
const [, resetSucceeded] = await Promise.all([
|
|
144
|
+
warmBaseBranch(deps, paths),
|
|
145
|
+
resetTrackedChanges(deps, paths)
|
|
146
|
+
]);
|
|
147
|
+
if (!resetSucceeded) return { state: "failed", reason: "pre-checkout reset failed" };
|
|
148
|
+
log.info(`[boot] Repo remote ready; agent will checkout ${branch}`);
|
|
149
|
+
return { state: "ready" };
|
|
150
|
+
}
|
|
151
|
+
async function warmBaseBranch(deps, paths) {
|
|
152
|
+
const { git, log } = deps;
|
|
153
|
+
const { baseBranch } = deps.bundle.gitPlan;
|
|
154
|
+
const started = performance.now();
|
|
143
155
|
try {
|
|
144
156
|
await git(["fetch", "origin", `+refs/heads/${baseBranch}:refs/remotes/origin/${baseBranch}`], {
|
|
145
157
|
cwd: paths.repoDir,
|
|
@@ -147,17 +159,24 @@ async function syncTaskBranchToRepo(deps, paths) {
|
|
|
147
159
|
});
|
|
148
160
|
} catch (err) {
|
|
149
161
|
log.warn(`[boot] WARN: fetch origin/${baseBranch} failed: ${errText(err)}`);
|
|
162
|
+
} finally {
|
|
163
|
+
log.info(`[boot] step=gitFetchBase ms=${Math.round(performance.now() - started)}`);
|
|
150
164
|
}
|
|
165
|
+
}
|
|
166
|
+
async function resetTrackedChanges(deps, paths) {
|
|
167
|
+
const { git, log } = deps;
|
|
168
|
+
const started = performance.now();
|
|
151
169
|
try {
|
|
152
170
|
await git(["reset", "--hard", "HEAD"], { cwd: paths.repoDir, timeoutMs: QUICK_GIT_TIMEOUT_MS });
|
|
171
|
+
return true;
|
|
153
172
|
} catch (err) {
|
|
154
173
|
log.error(
|
|
155
174
|
`[boot] ERROR: failed to clean tracked repo changes before checkout: ${errText(err)}`
|
|
156
175
|
);
|
|
157
|
-
return
|
|
176
|
+
return false;
|
|
177
|
+
} finally {
|
|
178
|
+
log.info(`[boot] step=gitResetTracked ms=${Math.round(performance.now() - started)}`);
|
|
158
179
|
}
|
|
159
|
-
log.info(`[boot] Repo remote ready; agent will checkout ${branch}`);
|
|
160
|
-
return { state: "ready" };
|
|
161
180
|
}
|
|
162
181
|
async function persistCredentialHelper(deps, paths) {
|
|
163
182
|
try {
|