ci: drop excluded charts from the install-test matrix
A chart in ci/excluded-charts.txt got an install-test job that ran the script, printed SKIP and exited 0. GitHub knows only the exit code, so the check list showed "Install-test satisfactory OK" for a chart whose image was never pulled - indistinguishable from one that really came up in the cluster (#231). detect-changed-charts now removes those charts before the matrix is built, so no job exists for them and nothing claims they passed. An absence says nothing by itself, so the detect job writes every excluded chart of the PR with its documented justification into the job summary. A "Skipped" would only say "not run"; the reason is the question a review actually asks. The list is not parsed in YAML. The workflow calls ci/run-install-test.sh --list-excluded, the one parser, and compares whole strings with jq, so a chart name is never read as a pattern. The script's own exclusion branch now goes through the same excluded_reason() helper instead of a grep that used the chart name as a regex; it stays for local runs, where the CI filter does not apply. Not viable, and recorded at the matrix as a comment: deciding per chart in an "if" on the install-test job, which would give a visible Skipped entry instead of an absent one. GitHub rejects it - jobs.<id>.if is evaluated before the matrix is expanded, so the matrix context does not exist there ("context \"matrix\" is not allowed here. available contexts are \"github\", \"inputs\", \"needs\", \"vars\"."). Run 33650724109 on the closed PR #233 ended in failure with zero jobs created.
This commit is contained in:
2 files changed
+82
-13
No files matched your search
+10
-6
@@ -69,12 +69,16 @@ if [ -f "$CI_DIR/$CHART/settings.env" ]; then
|
||||
fi
|
||||
|
||||
# --- Exclusion list ---------------------------------------------------------
|
||||
if [ -f "$CI_DIR/excluded-charts.txt" ]; then
|
||||
REASON="$(grep -E "^$CHART([[:space:]]|$)" "$CI_DIR/excluded-charts.txt" | sed -E "s/^$CHART[[:space:]]*//" || true)"
|
||||
if [ -n "$REASON" ]; then
|
||||
echo "SKIP: chart '$CHART' is excluded from the install-test: $REASON"
|
||||
exit 0
|
||||
fi
|
||||
# Through excluded_reason(), i.e. the same parser --list-excluded uses, so a
|
||||
# local run and the workflow matrix can never disagree about which charts are
|
||||
# excluded. In CI this branch is no longer reached: the detect job drops the
|
||||
# excluded charts before the matrix is built, so no install-test job exists for
|
||||
# them (#231). It stays for local runs, where "ci/run-install-test.sh
|
||||
# satisfactory" should say why it does nothing instead of trying.
|
||||
REASON="$(excluded_reason "$CHART")"
|
||||
if [ -n "$REASON" ]; then
|
||||
echo "SKIP: chart '$CHART' is excluded from the install-test: $REASON"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ ! -d "$ROOT/$CHART" ] || [ ! -f "$ROOT/$CHART/Chart.yaml" ]; then
|
||||
|
||||
Reference in new issue
Block a user