fix: initialize runtime-ready result by lane

This commit is contained in:
root
2026-07-04 00:47:04 +00:00
parent a3f6a7c8e2
commit 203bc16e0b
2 changed files with 7 additions and 3 deletions
+5 -1
View File
@@ -2244,7 +2244,6 @@ export HWLAB_TEKTON_PIPELINERUN="$(context.pipelineRun.name)"
export HWLAB_TEKTON_TASKRUN="$(context.taskRun.name)"
export HWLAB_TEKTON_TASK="gitops-promote"
export HWLAB_SOURCE_REVISION="$(params.revision)"
printf 'true' > /tekton/results/runtime-ready-required
echo '{"event":"ci-base-image","phase":"gitops-promote","image":"${ciToolsRunnerImage}","policy":"no-runtime-apt"}'
for tool in node git timeout; do command -v "$tool" >/dev/null 2>&1 || { echo '{"event":"ci-base-image","phase":"gitops-promote","ok":false,"reason":"missing-tool","tool":"'"$tool"'"}'; exit 31; }; done
${gitSshShellFunction()}
@@ -2254,6 +2253,11 @@ case "$lane" in
v[0-9][0-9]*) runtime_lane=true ;;
*) runtime_lane=false ;;
esac
if [ "$runtime_lane" = "true" ]; then
printf 'false' > /tekton/results/runtime-ready-required
else
printf 'true' > /tekton/results/runtime-ready-required
fi
source_head_url_for_setup="$(params.git-url)"
gitops_read_url_for_setup="$(params.git-url)"
if [ "$runtime_lane" = "true" ]; then
+2 -2
View File
@@ -194,7 +194,7 @@ test("v02 render follows TypeScript runtime checks and does not self-patch boots
const gitopsPromote = taskByName(pipelineJson, "gitops-promote");
assert.ok(gitopsPromote.taskSpec.results.some((result) => result.name === "runtime-ready-required"));
const gitopsPromoteScript = gitopsPromote.taskSpec.steps[0].script;
assert.match(gitopsPromoteScript, /printf 'true' > \/tekton\/results\/runtime-ready-required/u);
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);
assert.match(gitopsPromoteScript, /runtime-identity-only/u);
assert.match(gitopsPromoteScript, /skipped-runtime-unchanged/u);
assert.match(gitopsPromoteScript, /printf 'false' > \/tekton\/results\/runtime-ready-required/u);
@@ -613,7 +613,7 @@ test("v03 render keeps node identity as data instead of generated structure", as
assert.match(pipeline, /--ci-plan-path \/workspace\/source\/affected-services\.json/u);
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/u);
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);
assert.match(gitopsPromoteScript, /delegated-post-flush-closeout/u);
assert.ok(!generatedPaths.includes("runtime-v03/postgres.yaml"));
for (const relativePath of generatedPaths) {