Skip to content

fix(infra): make last-run/logs demo targets show what their help promises - #97

Merged
GMartin-Data merged 2 commits into
mainfrom
fix/make-demo-targets
Jun 5, 2026
Merged

GMartin-Data merged 2 commits into
mainfrom
fix/make-demo-targets

Conversation

@GMartin-Data

Copy link
Copy Markdown
Owner

Contexte

Les cibles de démo du Makefile (D114) doivent prouver visuellement le
bon déroulé du pipeline lors de la soutenance. Deux d'entre elles annonçaient
dans leur aide un comportement que leur sortie ne reflétait pas :

  • make last-run promet « statut SUCCEEDED attendu » mais n'affiche
    aucune colonne de statut (name, completionTime, creationTimestamp) —
    un run réussi était indistinguable d'un échec à l'écran.
  • make logs documente « Prouve l'enchaînement ingestion → dbt » mais
    --limit=5, partagé entre les events ingestion_end et dbt_invoked,
    ne laissait voir que 4 des 7 ingestion_end d'un run nominal.

Décisions techniques

Sujet Arbitrage
Champ de statut last-run status.succeededCount (rendu SUCCEEDED_COUNT par gcloud). Cloud Run v2 (Knative) n'expose pas d'enum littéral SUCCEEDED sur l'execution — le succès se lit via succeededCount ou conditions[type=Completed]. succeededCount est le plus lisible en table().
Wording de l'aide last-run Reformulé en succeededCount=1 attendu pour coller au vrai champ API plutôt qu'à un enum inexistant.
Nouvelle limite logs --limit=10 : 7 sources (ingestion_end émis une fois par source via main.py) + dbt_invoked + marge. Garde l'esprit « commande légère, une seule invocation » du Makefile.

Changements

  • Makefile (last-run) : ajout colonne status.succeededCount + aide alignée sur succeededCount=1.
  • Makefile (logs) : --limit=5 → --limit=10.

Validation

make last-run — la colonne SUCCEEDED_COUNT rend le succès explicite :

EXECUTION                   SUCCEEDED_COUNT  COMPLETION_TIME              CREATION_TIMESTAMP
datatalent-ingestion-2kbsg  1                2026-06-01T04:07:26.264474Z  2026-06-01T04:00:03.879146Z

make logs — l'enchaînement complet est désormais visible (7 ingestion_end + dbt_invoked) au lieu de 4 :

2026-06-01T04:07:22.876933Z	ingestion_end
2026-06-01T04:07:22.876916Z	dbt_invoked
2026-06-01T04:07:22.630177Z	ingestion_end
2026-06-01T04:07:14.491459Z	ingestion_end
2026-06-01T04:07:07.447381Z	ingestion_end
2026-06-01T04:07:05.130302Z	ingestion_end
2026-06-01T04:05:25.860666Z	ingestion_end
2026-06-01T04:02:42.240693Z	ingestion_end

grep confirmant les 7 sources émettant ingestion_end :

ingestion/urssaf_effectifs/ingest.py
ingestion/france_travail/ingest.py
ingestion/bmo/ingest.py
ingestion/adzuna/ingest.py
ingestion/geo/ingest.py
ingestion/urssaf_masse_salariale/ingest.py
ingestion/main.py  (event de fin globale)

Décisions liées

Refs : D114 (Makefile de démo).

The help text promised 'statut SUCCEEDED attendu' but the output columns
(name, completionTime, creationTimestamp) carried no status field, so a
successful run was indistinguishable from a failed one at a glance.

Add the status.succeededCount column (rendered as SUCCEEDED_COUNT by
gcloud) and align the help wording on the actual API field, since
Cloud Run v2 exposes no literal SUCCEEDED enum on executions.
A nominal run emits one ingestion_end per source (7 sources) plus one
dbt_invoked. With --limit=5 shared across both events, only 4 of the 7
ingestion_end lines surfaced, so 'make logs' failed to prove the full
ingestion -> dbt chain it documents.

Raise --limit to 10 (7 sources + dbt_invoked + margin) so the complete
handoff is visible in a single demo command.
@GMartin-Data
GMartin-Data merged commit 3f5b4dc into main Jun 5, 2026
6 checks passed
@GMartin-Data
GMartin-Data deleted the fix/make-demo-targets branch June 5, 2026 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant