Repository navigation
fix(dataset-config-check): configs accetta anche la directory del dataset - #45
Merged
Merged
Conversation
…aset `detect-changed-datasets` restituisce directory, e i consumer le passano così (22 repo in org): il loop faceva `[ ! -f "$cfg" ]` e saltava ogni voce con "SKIP (no dataset.yml)", lasciando il job verde senza aver validato nessun config — in un template l'errore si propaga a ogni repo nuovo. Il componente ora risolve le directory in <dir>/dataset.yml; i path a dataset.yml restano invariati (fix backward compatible, nessun consumer da toccare). L'esclusione (`exclude`) continua a lavorare sul nome della dir. Verificato eseguendo il blocco `run:` estratto dal workflow con stub di toolkit: dir con config -> OK, dir senza config -> SKIP, path mancante -> SKIP, globs e years espliciti invariati. actionlint + test_01_static verdi.
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.
Sintesi
dataset-config-check-reusabledichiaraconfigscome lista di path adataset.yml, madetect-changed-datasetsrestituisce directory e i consumer le passano così. Il loop fa[ ! -f "$cfg" ]→SKIP (no dataset.yml)su ogni voce: il job resta verde senza aver validato nulla. Il componente ora risolve le directory in<dir>/dataset.yml, così i consumer esistenti tornano a validare senza essere toccati.Contesto collegato
N/A — emerso dalla review di
dataciviclab/project-template#18, dove lo stesso pattern rendeva vacuo il check del template.Cosa cambia
configs: ogni voce che è una directory condataset.ymlviene risolta in<dir>/dataset.yml; i path adataset.ymlrestano invariati (fix backward compatible, nessun consumer da modificare).excludecontinua a lavorare sul nome della directory del dataset (calcolato dopo la normalizzazione, quindidatasets/foo→foo).configsaggiornata.Impatto
Verifica
run:estratto dal workflow ed eseguito su directory temporanee con stub ditoolkit:datasets/foo(condataset.yml) →→ datasets/foo/dataset.yml (years: 2022) ✅ OKdatasets/bar(senza config) →SKIPSKIPexclude: foo→(skip: foo)globseyearsespliciti → invariateactionlint(config del repo): 0 issuepytest tests/test_01_static.py: 24 passedControlli
run:regressioncon link all'issue — N/ANote per chi revisiona
configs: ${{ needs.detect.outputs.dirs }}(indice-pa,mercati-italia,costituzione-italiana,bilancio-pubblico,open-coesione, …). Dopo questo fix i loro log mostreranno i risultati reali del preflight.⚠️ FAILED … (non blocking)e chiude con✅ Preflight completato. Il fix non cambia questa policy: nessun repo diventa rosso. Se il check deve bloccare un merge è una decisione separata (una riga di codice, ma cambia il comportamento di tutti i consumer).tests/tools/snapshot_contracts.py --checksegnaladataset-config-check-reusable(per questo commit) edetect-changed-datasets(già diverso prima, per l'inputdatasetsdi ADR-002). Lo snapshot va rigenerato quando la baseline Fase 0A viene committata: in questo repocontracts/etests/non sono tracciati sumain, quindi non sono inclusi nella PR.