fix(config): decouple ignore datasets fetching from config loading#792
Conversation
`Config.default()` no longer performs network I/O as a side effect: the field factory for `ignore_datasets_file` is now a pure path computation, and the download moves to a new `refresh_ignore_datasets_file` helper called lazily from `ExecutionSolver.build_from_db` at solve time. A new `Config.ignore_datasets_url` field (env `REF_IGNORE_DATASETS_URL`) controls where the file is fetched from; setting it to an empty string disables fetching entirely for offline and air-gapped deployments. A failed download no longer creates an empty placeholder file: an existing cached copy is reused unchanged (content and mtime preserved), and a solve with no cached copy raises `IgnoreDatasetsRefreshError` rather than silently running without ignore-dataset protections. Test fixtures now pin the in-tree `default_ignore_datasets.yaml` with fetching disabled, so tests are deterministic, offline, and exercise the shipped default file. Closes #549
|
Warning Review limit reached
Next review available in: 31 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Description
Resolves #549. This is a non-breaking re-cut of the salvageable core of #622, which had drifted too far behind
mainto rebase.Decouple fetching from
Configconstruction.Config.default()no longer performs network I/O as a side effect: the field factory forignore_datasets_fileis now a pure path computation, and the download moves to a newrefresh_ignore_datasets_file()helper called lazily fromExecutionSolver.build_from_dbat solve time. Read-only commands such asref providers listandref datasets listnever touch the network. This also removes the__validation_ignore_datasets.yamlshim fromConfig.validate(), which only existed to dodge the side-effecting factory.New
Config.ignore_datasets_urlfield (envREF_IGNORE_DATASETS_URL) controls where the file is fetched from. Setting it to an empty string disables fetching entirely, which is what offline / air-gapped HPC deployments need.ignore_datasets_fileis also now overridable viaREF_IGNORE_DATASETS_FILEand coerced to aPath.Fail-safe refresh. A failed download no longer creates an empty placeholder file (which previously suppressed the ignore list for six hours): an existing cached copy is reused unchanged, and a solve with no cached copy raises
IgnoreDatasetsRefreshErrorrather than silently running without ignore-dataset protections.Deterministic tests. Both test config fixtures now pin the in-tree
default_ignore_datasets.yamlwith fetching disabled, so tests exercise the shipped default file instead of whatever copy happens to be cached on the host, and a PR editing the file will correctly ripple into test results (the root cause of #590's cached-copy problem).The docs gain a "Grey list" section describing the mechanism, the lazy fetch behaviour, and the offline workflow. The section notes that the
ignore_datasets_*settings will be renamed togrey_list_*in a future release; the rename deliberately stays out of this PR to keep it non-breaking.Checklist
Please confirm that this pull request has done the following:
changelog/