Repository navigation
chore(infra): archive historical marts to marts_archive (D112) - #84
Merged
Merged
Conversation
Add marts_archive dataset to the bigquery module. Move fct_offres_enrichies and fct_contexte_territorial out of marts via CREATE TABLE AS SELECT + DROP, restoring the invariant that marts.* contains only dbt-produced tables.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contexte
Suite à la validation prod du fix dbt no-op (D111, PR #83), l'inspection
de
marts.*a révélé deux tables artefacts du périmètre antérieur àD94 :
fct_offres_enrichies(10269 rows) etfct_contexte_territorial(8115 rows). Plus pilotées par dbt depuis la refonte en mart unifié
fct_offres. Conservation en l'état → risque de confusion sémantique(branchement dashboard sur la mauvaise table = mode de défaillance
silencieux refusé par D72/D111 ailleurs dans le système).
Décision (D112)
Voie C2 retenue après arbitrage A/B/C2/D (cf. D112 dans notes-projet.md
pour la justification complète) : migration vers un dataset
marts_archivedédié, pour restaurer l'invariant fort«
marts.*= ce que dbt produit aujourd'hui, point ».Changements
infra/main.tf: ajout"marts_archive"à la listedataset_idsdu module
bigquery/.Note importante sur la non-reproductibilité
Le contenu de
marts_archive(les 2 tables migrées) n'est pas pilotableen Terraform — ce sont des données historiques figées, pas de l'infra.
Sur une infra GCP fraîche,
terraform applycréera un datasetmarts_archivevide, ce qui est conforme à la doctrine D5 (datasetsgérés en IaC, contenu géré par dbt ou hors-IaC).
Validation
Gestes manuels exécutés en série, traçabilité ci-dessous.
1. Terraform plan + apply
2. Copie des tables (CREATE TABLE AS SELECT)
3. Vérification intégrité row_count
fct_offres_enrichiesfct_contexte_territorial4. Drop des sources + état final
```
$ bq ls marts
tableId → fct_offres (seule table, partitioning + clustering préservés)
$ bq ls marts_archive
tableId → fct_contexte_territorial, fct_offres_enrichies
```
5. terraform plan zéro diff post-changements
Décisions liées
hors repo).
fct_offresqui a refondu les marts antérieurs(origine de l'orphelinat).
marts_archivequi dérive doctrinalement. À acter au prochain refreshde D5.
Refs : D5, D94, D112.