fix: skip prepare-source npm install
This commit is contained in:
@@ -1116,11 +1116,9 @@ function prepareSourceScript() {
|
||||
"export HWLAB_TEKTON_TASK=\"prepare-source\"",
|
||||
"export HWLAB_SOURCE_REVISION=\"$(params.revision)\"",
|
||||
dependencyProxyProbeScript("prepare-source-proxy-preflight", "http://deb.debian.org/debian/dists/bookworm/InRelease"),
|
||||
curlDownloadProbeFunction(),
|
||||
`echo '{"event":"ci-base-image","phase":"prepare-source","image":"${ciToolsRunnerImage}","policy":"no-runtime-apk"}'`,
|
||||
"for tool in node npm git python3 ssh curl timeout; do command -v \"$tool\" >/dev/null 2>&1 || { echo '{\"event\":\"ci-base-image\",\"ok\":false,\"reason\":\"missing-tool\",\"tool\":\"'\"$tool\"'\"}'; exit 31; }; done",
|
||||
"for tool in node git ssh ssh-keyscan timeout; do command -v \"$tool\" >/dev/null 2>&1 || { echo '{\"event\":\"ci-base-image\",\"ok\":false,\"reason\":\"missing-tool\",\"tool\":\"'\"$tool\"'\"}'; exit 31; }; done",
|
||||
"node -e 'console.log(JSON.stringify({event:\"ci-base-image\",phase:\"prepare-source\",ok:true,node:process.version}))'",
|
||||
"curl_dependency_probe \"prepare-source-pre-npm\" \"https://registry.npmjs.org/npm/latest\"",
|
||||
gitSshShellFunction(),
|
||||
"git_ssh_setup",
|
||||
"git_read_url=\"$(params.git-read-url)\"",
|
||||
@@ -1178,9 +1176,7 @@ function prepareSourceScript() {
|
||||
" echo '{\"event\":\"gitops-artifact-catalog\",\"phase\":\"prepare-source\",\"status\":\"seeded-v02-skeleton\"}'",
|
||||
"fi",
|
||||
"ci_timing_emit catalog-fetch succeeded \"$catalog_fetch_started_ms\"",
|
||||
"npm_ci_started_ms=\"$(ci_now_ms)\"",
|
||||
"npm ci --ignore-scripts",
|
||||
"ci_timing_emit npm-ci succeeded \"$npm_ci_started_ms\"",
|
||||
"echo '{\"event\":\"prepare-source-dependencies\",\"status\":\"skipped\",\"reason\":\"ci-tools-image-provides-required-node-runtime\"}'",
|
||||
`echo ${shellSingleQuote(`G14 prepare-source complete; validation task count=${primitiveValidationTasks.length}`)}`
|
||||
];
|
||||
return `${lines.join("\n")}\n`;
|
||||
|
||||
@@ -74,6 +74,10 @@ test("v02 render follows TypeScript runtime checks and does not self-patch boots
|
||||
assert.match(prepareSourceScript, /git_timed source-clone 180 git clone --branch "\$\(params\.source-branch\)" "\$git_read_url"/u);
|
||||
assert.match(prepareSourceScript, /git_timed catalog-ls-remote 45 git ls-remote --exit-code --heads "\$git_read_url"/u);
|
||||
assert.match(prepareSourceScript, /git remote set-url gitops-catalog "\$git_read_url"/u);
|
||||
assert.match(prepareSourceScript, /prepare-source-dependencies/u);
|
||||
assert.doesNotMatch(prepareSourceScript, /npm ci --ignore-scripts/u);
|
||||
assert.doesNotMatch(prepareSourceScript, /prepare-source-pre-npm/u);
|
||||
assert.doesNotMatch(prepareSourceScript, /dependency-curl-probe-start/u);
|
||||
|
||||
const pipelineGitReadParam = pipelineJson.spec.params.find((param) => param.name === "git-read-url");
|
||||
assert.equal(pipelineGitReadParam?.default, "http://git-mirror-http.devops-infra.svc.cluster.local/pikasTech/HWLAB.git");
|
||||
|
||||
Reference in New Issue
Block a user