chore(transfers): deprecate NM_Aquifer/NM_Wells drivers, drop tests from CI - #865
Merged
Merged
Conversation
…rom CI Both legacy migration drivers are frozen. NM_Aquifer (transfers/transfer.py) was already marked; bring the NM_Wells path to the same pattern with a DEPRECATED: module docstring and a DeprecationWarning on each entry point: transfer_geothermal.run_geothermal_transfer, nmw_mirror_transfer.transfer_nmw_mirror, and export_nmw_csvs.main. nmw_sql_dump is a pure parser, so it gets the docstring but no per-call warning. The code stays runnable rather than deleted because live API routes still read the NMA_* and NMW_* tables, so backfills and re-runs must remain possible. services/scoped_transfer.py imports ~25 of the NM_Aquifer transferers directly to back the `oco scoped-transfer` command; it is left untouched and documented as explicitly not deprecated. Move the root-level transfer tests into tests/transfers/, which tests.yml already excludes via --ignore=tests/transfers, so they no longer gate a pull request. transfers/* was already omitted from the coverage total, so the gate is unaffected. test_nmw_mirror.py derived ROOT by counting dirname levels from __file__ and broke one directory deeper; it now resolves the repo root explicitly. Tests for the NMA_*/NMW_* ORM models stay in tests/ proper and still gate CI, since live routes depend on those models. CI scope collects 890 tests; the excluded transfer scope collects 87 and passes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Coverage✅ 79.03% total — gate is 75%. No measured coverage for the Python files changed here. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR formalizes the deprecation of the legacy NM_Aquifer and NM_Wells transfer drivers by adding explicit deprecation messaging/warnings, and by relocating their tests to a non-CI-gated location so day-to-day PR validation remains focused on the live API surface.
Changes:
- Added
DEPRECATED:module docstrings andDeprecationWarningemission to NM_Wells driver entry points to freeze the legacy migration path while keeping it runnable for backfills. - Moved transfer-script-focused tests under
tests/transfers/(already excluded from CI) and documented the rationale in the workflow and README docs. - Updated runbooks/spec/docs to reflect the new deprecation status and updated test locations.
Reviewed changes
Copilot reviewed 13 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| transfers/transfer_geothermal.py | Adds deprecation module docstring + DeprecationWarning on the geothermal driver entry point. |
| transfers/README.md | Documents transfers/ as deprecated, clarifies what remains supported, and how to run excluded tests. |
| transfers/nmw_sql_dump.py | Marks the SQL-dump parser module as part of the deprecated NM_Wells path via docstring. |
| transfers/nmw_mirror_transfer.py | Adds DeprecationWarning on the mirror loader entry point and updates module docstring. |
| transfers/export_nmw_csvs.py | Adds deprecation module docstring + DeprecationWarning on the export script entry point. |
| tests/transfers/test_well_transfer.py | Relocated transfer tests into the non-CI-gated transfers test suite. |
| tests/transfers/test_transfer_legacy_dates.py | Relocated legacy-date transfer tests into the non-CI-gated transfers test suite. |
| tests/transfers/test_thing_transfer.py | Relocated thing transfer tests into the non-CI-gated transfers test suite. |
| tests/transfers/test_sensor_transfer.py | Relocated sensor transfer tests into the non-CI-gated transfers test suite. |
| tests/transfers/test_nmw_mirror.py | Fixes repo-root resolution after relocation and keeps NM_Wells mirror coverage in the transfer test suite. |
| tests/transfers/test_minor_trace_chemistry_transfer.py | Relocated chemistry transfer tests into the non-CI-gated transfers test suite. |
| tests/transfers/test_contact_transfer_email_utils.py | Relocated contact transfer email utility tests into the non-CI-gated transfers test suite. |
| tests/transfers/README.md | Adds documentation for why these tests are excluded from CI and how to run them manually. |
| tests/README.md | Clarifies that tests/transfers/ is for deprecated transfer scripts and excluded from CI. |
| SPEC.md | Updates references to the relocated NM_Wells mirror tests. |
| docs/nm_wells-transfer-runbook.md | Adds an explicit deprecation banner and updates test paths/commands. |
| docs/nm_wells-migration.md | Adds an explicit deprecation banner clarifying the document is retained as a design record. |
| CLAUDE.md | Updates repo guidance to reflect the deprecation and non-CI-gated transfer tests. |
| .github/workflows/tests.yml | Documents the existing --ignore=tests/transfers flag rationale in CI. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Freezes both legacy migration drivers and takes their tests off the PR gate.
Deprecation
NM_Aquifer (
transfers/transfer.py) was already marked. This brings the NM_Wells path to the same pattern — aDEPRECATED:module docstring plus aDeprecationWarningon the entry point:transfer_geothermal.pyrun_geothermal_transfernmw_mirror_transfer.pytransfer_nmw_mirrorexport_nmw_csvs.pymainnmw_sql_dump.pyMarked, not deleted. Live API routes still read the
NMA_*andNMW_*tables, so backfills and re-runs have to stay possible.Two things deliberately left alone, and now documented as explicitly not deprecated so the next reader doesn't assume the whole directory is dead:
services/scoped_transfer.py— imports ~25 NM_Aquifer transferers directly to back theoco scoped-transfercommand.transfers/seed_geothermal.py— generates fake data for dev; it doesn't read a legacy source, so it isn't transfer logic.Tests off CI
Moved 7 transfer test files into
tests/transfers/, whichtests.ymlalready excludes via--ignore=tests/transfers. No workflow logic change was needed — just a comment explaining why that flag is there.transfers/*was already omitted from the coverage total inpyproject.toml, so the 75% gate is unaffected.Tests for the
NMA_*/NMW_*ORM models stay intests/proper and still gate CI, since live routes depend on those models.Bug found by the move
test_nmw_mirror.pybuiltROOTby countingdirnamelevels from__file__, so relocating it one directory deeper broke itscore/pygeoapi-config.ymllookup. It now resolves the repo root explicitly.Verification
blackclean;flake8clean under the project's--selectset on everything touched.Two pre-existing issues not fixed here, both in files this PR doesn't touch: an
F401intransfers/migrate_nmbgmr_site_names.py, andtests/transfers/test_contact_with_multiple_wells.pyfailing locally on missing GCS credentials (a stale local.envpath, not a repo problem).🤖 Generated with Claude Code