fix(train): use correct Argo Events label selector for CI workflow lookup

Argo Events labels workflows with events.argoproj.io/trigger, not
workflows.argoproj.io/workflow-template. Fixed find_ci_workflow() so
ci-train preset can actually find CI pipeline runs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jgrusewski
2026-03-09 22:35:16 +01:00
parent d67f696971
commit 88c83c17ce

View File

@@ -172,10 +172,10 @@ find_ci_workflow() {
local sha="$1"
local short_sha="${sha:0:8}"
# List recent ci-pipeline workflows and find the one matching our commit.
# Argo labels the workflow with the template name; we also grep for the SHA
# in the workflow spec parameters.
# Argo Events labels workflows with events.argoproj.io/trigger (not
# workflows.argoproj.io/workflow-template), so use that selector.
kubectl -n "${NAMESPACE}" get workflows \
-l "workflows.argoproj.io/workflow-template=ci-pipeline" \
-l "events.argoproj.io/trigger=ci-pipeline" \
-o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.phase}{"\t"}{range .spec.arguments.parameters[*]}{.name}={.value}{","}{end}{"\n"}{end}' \
2>/dev/null \
| grep "commit-sha=${sha}\|commit-sha=${short_sha}" \