fix(ci): stop rendering pre-flush runtime-ready for runtime lanes

This commit is contained in:
root
2026-07-04 03:06:53 +00:00
parent 034946085d
commit 7aed237c26
2 changed files with 9 additions and 16 deletions
+7 -4
View File
@@ -3280,6 +3280,12 @@ function imagePublishTaskSet(args = { lane: "node" }, deploy = null) {
function tektonPipeline(args = { lane: "node" }, deploy = null) {
const settings = ciLaneSettings(args);
const runtimePath = gitopsPathForProfile(args, settings.profile);
const preFlushRuntimeReadyTasks = isRuntimeLane(settings.lane)
? []
: [{
...runtimeReadyTask({ profile: settings.profile }),
when: [{ input: "$(tasks.gitops-promote.results.runtime-ready-required)", operator: "in", values: ["true"] }]
}];
return {
apiVersion: "tekton.dev/v1",
kind: "Pipeline",
@@ -3395,10 +3401,7 @@ function tektonPipeline(args = { lane: "node" }, deploy = null) {
{ name: "registry-prefix", value: "$(params.registry-prefix)" }
]
},
{
...runtimeReadyTask({ profile: settings.profile }),
when: [{ input: "$(tasks.gitops-promote.results.runtime-ready-required)", operator: "in", values: ["true"] }]
}
...preFlushRuntimeReadyTasks
]
}
};
+2 -12
View File
@@ -169,18 +169,7 @@ test("v02 render follows TypeScript runtime checks and does not self-patch boots
assert.match(runtimeReadySource, /process\.exitCode = 1/u);
assert.match(runtimeReadySource, /item\.metadata\?\.labels\?\.\["hwlab\.pikastech\.local\/source-commit"\]/u);
const runtimeReady = taskByName(pipelineJson, "runtime-ready");
assert.deepEqual(runtimeReady.when, [{ input: "$(tasks.gitops-promote.results.runtime-ready-required)", operator: "in", values: ["true"] }]);
const runtimeReadyScript = runtimeReady.taskSpec.steps[0].script;
assert.match(runtimeReadyScript, /HWLAB_RUNTIME_READY_TIMEOUT_MS="\$\(params\.timeout-ms\)"/u);
assert.match(runtimeReadyScript, /cd \/workspace\/source\/repo/u);
assert.match(runtimeReadyScript, /node scripts\/ci\/runtime-ready\.mjs/u);
assert.ok(runtimeReady.taskSpec.params.some((param) => param.name === "argo-application"));
assert.ok(runtimeReady.taskSpec.params.some((param) => param.name === "timeout-ms"));
assert.ok(runtimeReady.params.some((param) => param.name === "argo-application" && param.value === "hwlab-node-v02"));
assert.ok(runtimeReady.params.some((param) => param.name === "timeout-ms" && param.value === "$(params.runtime-ready-timeout-ms)"));
assert.ok(runtimeReady.workspaces?.some((workspace) => workspace.name === "source" && workspace.workspace === "source"));
assert.ok(runtimeReady.taskSpec.workspaces?.some((workspace) => workspace.name === "source"));
assert.ok(!pipelineJson.spec.tasks.some((task) => task.name === "runtime-ready"));
const planArtifacts = taskByName(pipelineJson, "plan-artifacts");
const planArtifactsScript = planArtifacts.taskSpec.steps[0].script;
@@ -611,6 +600,7 @@ test("v03 render keeps node identity as data instead of generated structure", as
const pipelineJson = JSON.parse(pipeline);
assert.match(pipeline, /--external-service-report-dir \/workspace\/source\/service-results/u);
assert.match(pipeline, /--ci-plan-path \/workspace\/source\/affected-services\.json/u);
assert.ok(!pipelineJson.spec.tasks.some((task) => task.name === "runtime-ready"));
const gitopsPromote = taskByName(pipelineJson, "gitops-promote");
const gitopsPromoteScript = gitopsPromote.taskSpec.steps[0].script;
assert.match(gitopsPromoteScript, /if \[ "\$runtime_lane" = "true" \]; then\s+printf 'false' > \/tekton\/results\/runtime-ready-required\s+else\s+printf 'true' > \/tekton\/results\/runtime-ready-required/u);