Skip to content

Commit 8a4a0cf

Browse files
authored
Improve error handling for missing relation files
Updated the validation for required CSV files in the pipeline to fail-closed if any are missing.
1 parent 7a8490c commit 8a4a0cf

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

.github/workflows/pipeline.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,19 @@ jobs:
106106
REL="explorer/data/relations"
107107
echo "Using live Explorer relations: $REL"
108108
fi
109-
# Sanity: required CSVs must exist (or pipeline will fail-closed later)
110-
for f in persona_incarico_ente__incarichi_nominativi_shard.csv \
111-
awards__affidamenti_diretti.csv \
112-
cig_ente__affidamenti_diretti.csv; do
113-
if [ ! -f "$REL/$f" ]; then
114-
echo "::warning::Missing relation file: $f (adapter will skip it)"
115-
fi
116-
done
117-
echo "path=$REL" >> "$GITHUB_OUTPUT"
109+
missing=0for f in persona_incarico_ente__incarichi_nominativi_shard.csv \
110+
awards__affidamenti_diretti.csv \
111+
cig_ente__affidamenti_diretti.csv; do
112+
if [ ! -f "$REL/$f" ]; then
113+
echo "::error::Missing required relation file: $REL/$f"
114+
missing=1
115+
fi
116+
done
117+
if [ "$missing" != 0 ]; then
118+
echo "::error::Fail-closed: required Explorer relation CSVs are missing."
119+
exit 1
120+
fi
121+
echo "path=$REL" >> "$GITHUB_OUTPUT"
118122

119123
- name: Step 1 — Adapt Explorer relations → generator input
120124
run: |

0 commit comments

Comments
 (0)