Skip to content

chore(transfers): deprecate NM_Aquifer/NM_Wells drivers, drop tests from CI - #865

Merged
jirhiker merged 1 commit into
stagingfrom
claude/deprecate-nm-transfer-logic-7f69f6
Aug 20, 2026
Merged

chore(transfers): deprecate NM_Aquifer/NM_Wells drivers, drop tests from CI#865
jirhiker merged 1 commit into
stagingfrom
claude/deprecate-nm-transfer-logic-7f69f6

Conversation

@jirhiker

Copy link
Copy Markdown
Member

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 — a DEPRECATED: module docstring plus a DeprecationWarning on the entry point:

Module Docstring Warning
transfer_geothermal.py run_geothermal_transfer
nmw_mirror_transfer.py transfer_nmw_mirror
export_nmw_csvs.py main
nmw_sql_dump.py — (pure parser; a warning per call would be noise)

Marked, not deleted. Live API routes still read the NMA_* and NMW_* 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 the oco scoped-transfer command.
  • 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/, which tests.yml already 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 in pyproject.toml, so the 75% gate is unaffected.

Tests for the NMA_*/NMW_* ORM models stay in tests/ proper and still gate CI, since live routes depend on those models.

Bug found by the move

test_nmw_mirror.py built ROOT by counting dirname levels from __file__, so relocating it one directory deeper broke its core/pygeoapi-config.yml lookup. It now resolves the repo root explicitly.

Verification

  • CI scope collects 890 tests; excluded transfer scope collects 87 and passes (82 pass, 5 deselected — see below).
  • black clean; flake8 clean under the project's --select set on everything touched.

Two pre-existing issues not fixed here, both in files this PR doesn't touch: an F401 in transfers/migrate_nmbgmr_site_names.py, and tests/transfers/test_contact_with_multiple_wells.py failing locally on missing GCS credentials (a stale local .env path, not a repo problem).

🤖 Generated with Claude Code

…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>
@github-actions

Copy link
Copy Markdown
Contributor

Coverage

79.03% total — gate is 75%.

No measured coverage for the Python files changed here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 and DeprecationWarning emission 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.

@jirhiker
jirhiker merged commit e425fa1 into staging Aug 20, 2026
10 checks passed
@jirhiker
jirhiker deleted the claude/deprecate-nm-transfer-logic-7f69f6 branch August 20, 2026 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants