Conversation
…h-3, support dataset - aggiunge guard opzionale repo_root in DatasetConfig per validare che effective_root resti dentro la repo in contesti CI - espone il guard tramite load_config(..., repo_root=...) - aggiunge docstring esplicito: il guard è pensato per caller esterni (es. CI di monorepo come dataset-incubator), non per uso generale - copre con test i layout reali: candidate depth-2, sources/* depth-3, support dataset, path assoluto dentro repo, errore fuori repo, retrocompatibilità senza guard Closes #54
Contributor
Author
|
@Gabrymi93 pronta per review. Il guard Note pre-review:
Closes #54 |
- _ensure_root_within_repo ora riceve path già risolti dal caller (docstring esplicito, no double expanduser/resolve nel guard) - call site in load_config_model risolve repo_root prima di passarlo - aggiunto check is_dir() su repo_root con errore esplicito se il path non esiste o non è una directory
Contributor
Author
|
Review mirata su `repo_root` guard e test path semantics fatta. Esito:
Verifiche locali:
Nota non bloccante:
|
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.
Closes #54
Cosa cambia
toolkit/core/config_models.pyrepo_rootcome parametro opzionale inDatasetConfigeffective_rootresti dentro la repo e fallisce con errore esplicito se escedataset-incubator), non è un cambio di semantica globale del toolkittoolkit/core/config.pyrepo_roottramiteload_config(..., repo_root=...)tests/test_config.pysources/*depth-3, support datasetPerché
Il bug post-rename in
dataset-incubator(PR #52) ha dimostrato che la semantica dieffective_rootpuò rompersi silenziosamente. Il guard aggiunge enforcement opzionale nei contesti CI senza toccare il comportamento standard.Il collegamento operativo lato
dataset-incubatorè tracciato indataciviclab/dataset-incubator#82(già implementato in PR #83).Verifica
pytest: 184 passedruff: pulito