Skip to content

chore(ogc): hide four layers from the public catalog - #871

Merged
jirhiker merged 1 commit into
stagingfrom
chore/bdms-977-979-hide-ogc-layers
Aug 22, 2026
Merged

chore(ogc): hide four layers from the public catalog#871
jirhiker merged 1 commit into
stagingfrom
chore/bdms-977-979-hide-ogc-layers

Conversation

@jirhiker

@jirhiker jirhiker commented Aug 22, 2026

Copy link
Copy Markdown
Member

Closes BDMS-977 (A16), BDMS-978 (A17), BDMS-979 (A18).

What

Three tickets, one shape: take a layer off the public /ogcapi catalog without touching its data.

Layer Why Ticket
avg_tds_wells mean of 1.9 observations per well — unreliable for half the catalog BDMS-977
latest_depth_to_water_wells redundant with water_well_summary BDMS-977
locations 11,174 features, 11,173 duplicating the 11 thing-type layers; one of the two largest layers served BDMS-978
other_things internal vocabulary ("Thing" is the data-model name, "other" names no feature class); 5 features BDMS-979

How

The first three are config entries, so they come out of core/pygeoapi-config.yml and stay in core/pygeoapi-config-internal.yml.

other_things is generated from THING_COLLECTIONS, which feeds both mounts. It gets an internal_only marker that _thing_collections_block honors and only the internal _write_config call opts into — so the public mount drops it and /ogcapi-internal keeps it.

No migration. Every backing relation is retained, and /ogcapi-internal still publishes all four to staff GIS clients. That internal usage is exactly what A18 asked us to check for before dropping ogc_other_things, so both ogc_other_things and ogc_internal_other_things stay.

Acceptance criteria

  • avg_tds_wells / latest_depth_to_water_wells / locations entries removed from core/pygeoapi-config.yml
  • other_things absent from the public catalog
  • All four absent from /ogcapi/collections (asserted in tests/test_ogc.py and tests/test_pygeoapi_mount.py)
  • Backing matviews, the location table, and both other_things views retained

Tests

  • tests/test_ogc.py::test_ogc_collections asserts the four ids are gone; the dead skipped test_ogc_locations_items_bbox is removed with the collection it targeted.
  • New tests/test_pygeoapi_mount.py::test_hidden_layers_are_internal_only — absent on public, present on internal.
  • Behave: the A1 @production scenario table drops the four rows a public client can no longer request (the SQL-level A1 scenarios still cover those views' release_status filter); the dormant A13 tables drop other_things. A18's two conditional scenarios collapse into one retention scenario recording the internal-use finding. A16/A17/A18 gain step definitions and the @production tag, so CI enforces them.
  • README's OGC examples pointed at locations; retargeted at water_wells.

Verification

  • uv run pytest --ignore=tests/transfers → 1055 passed, 80 skipped, 6 xpassed
  • uv run behave tests/features/ogc-cleanup-sprint1.feature --tags="@backend and @production and not @skip" → 20 passed, 0 failed
  • pre-commit (black, flake8) clean
  • The full CI behave subset also shows 6 failures and 3 errors in geojson-response, thing-query-parameters, thing-type-path-parameters, transducer-data-response, location-notes and well-notes. Pre-existing — reproduced on a clean tree with these changes stashed.

Deploy note

Removing a collection changes the public catalog for external consumers. The data is untouched and every layer remains available on /ogcapi-internal.

🤖 Generated with Claude Code

BDMS-977 (A16), BDMS-978 (A17) and BDMS-979 (A18) all take a layer off
the public /ogcapi catalog without touching its data:

* avg_tds_wells averages 1.9 observations per well, so the statistic is
  unreliable for half the catalog, and latest_depth_to_water_wells
  repeats what water_well_summary already publishes.
* locations exposes 11,174 features, 11,173 of which duplicate coverage
  the 11 thing-type layers already give, at the cost of being one of the
  two largest layers served.
* other_things is internal vocabulary: "Thing" is the data-model name
  for a monitoring point and "other" names no feature class. Five
  features.

The first three are config entries, so they come out of
core/pygeoapi-config.yml and stay in pygeoapi-config-internal.yml.
other_things is generated from THING_COLLECTIONS, which feeds both
mounts, so it gets an internal_only marker that _thing_collections_block
honors and only the internal _write_config call opts into.

All backing relations are retained. /ogcapi-internal still publishes all
four to staff GIS clients, which is the internal use A18 asked us to
check for before dropping ogc_other_things, so no migration here.

The A1 and A13 scenario tables lose the rows a public client can no
longer request; the SQL-level A1 scenarios still cover those views'
release_status filter. A16/A17/A18 scenarios get step definitions and
the @production tag so CI enforces them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Coverage

79.12% total — gate is 75%.

Coverage for the Python files changed in this PR
Name Stmts Miss Cover Missing
core/pygeoapi.py 158 20 87% 159, 163, 172, 177, 196, 203, 228-231, 376, 381, 469, 500, 518, 525, 527, 547, 549, 561
TOTAL 158 20 87%

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

Removes four OGC API collections from the public /ogcapi catalog while keeping their backing relations and continuing to serve them to staff via /ogcapi-internal, aligning the public catalog with reliability/usability goals without data removal.

Changes:

  • Removed locations, avg_tds_wells, and latest_depth_to_water_wells from the public core/pygeoapi-config.yml while retaining them in the internal catalog.
  • Added an internal_only marker for other_things in THING_COLLECTIONS, and taught config generation to include those collections only for the internal mount.
  • Updated pytest + Behave coverage and adjusted README OGC examples away from the removed locations collection.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
core/pygeoapi.py Adds internal_only handling in thing-collection config generation and enables it for /ogcapi-internal.
core/pygeoapi-config.yml Removes the three specified collections from the public pygeoapi resources list.
tests/test_ogc.py Asserts the four collections are absent from the public /ogcapi/collections response and removes the now-irrelevant locations bbox test.
tests/test_pygeoapi_mount.py Verifies the four collections are absent on the public mount and present on the internal mount.
tests/features/ogc-cleanup-sprint1.feature Updates scenario tables/tags and consolidates A18 retention expectations for internal usage.
tests/features/steps/ogc-cleanup-sprint1.py Adds step definitions validating public catalog absence and backing-relation retention.
README.md Retargets OGC example requests from locations to water_wells.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@jirhiker
jirhiker merged commit 12ec0b3 into staging Aug 22, 2026
11 checks passed
@jirhiker
jirhiker deleted the chore/bdms-977-979-hide-ogc-layers branch August 22, 2026 17:32
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