Conversation
…related configurations
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a427cd60ef
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Integrates pygeoapi to serve OGC API - Features endpoints under /oapi, replacing the in-repo /ogc router, and updates application initialization, documentation, and tests accordingly.
Changes:
- Add
pygeoapi==0.22.0and its transitive dependencies to project dependencies and lockfiles. - Mount
pygeoapias a sub-application at/oapiwith generated config, plus DB views to back collections. - Update OGC-related tests and documentation from
/ogcto/oapi.
Reviewed changes
Copilot reviewed 9 out of 12 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
uv.lock |
Locks new dependencies introduced by adding pygeoapi and related packages. |
requirements.txt |
Exports updated runtime dependency set including pygeoapi and geospatial deps (e.g., rasterio). |
pyproject.toml |
Adds pygeoapi==0.22.0 to application dependencies. |
main.py |
Refactors app setup into create_app() and delegates middleware/admin setup to initializers. |
core/initializers.py |
Replaces /ogc router inclusion with mount_pygeoapi(app) and adds middleware/admin configurators. |
core/pygeoapi.py |
Implements mounting logic, config generation, and supporting-view creation for pygeoapi-backed collections. |
core/pygeoapi-config.yml |
Adds a pygeoapi configuration template for PostGIS-backed collections. |
tests/test_ogc.py |
Updates tests to hit /oapi endpoints and adjusts expectations for pygeoapi responses. |
api/README.md |
Updates API module documentation to reflect pygeoapi-mounted OGC endpoints. |
README.md |
Updates public docs and examples to use /oapi and references pygeoapi. |
CLAUDE.md |
Updates developer docs to reference /oapi instead of /ogc. |
.gitignore |
Ignores the generated .pygeoapi/ directory. |
…ensitive information Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…upporting views for groundwater monitoring
alembic/versions/d5e6f7a8b9c0_create_pygeoapi_supporting_views.py
Outdated
Show resolved
Hide resolved
alembic/versions/d5e6f7a8b9c0_create_pygeoapi_supporting_views.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 87d1b9ee5b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…PostgreSQL settings
alembic/versions/d5e6f7a8b9c0_create_pygeoapi_supporting_views.py
Outdated
Show resolved
Hide resolved
alembic/versions/d5e6f7a8b9c0_create_pygeoapi_supporting_views.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… session secret key for test environments
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 36 out of 39 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
tests/test_ogc.py:55
- The test file imports
override_authenticationfromtestsbut this fixture is module-scoped and applied viaautouse=True(line 36-37). However, if pygeoapi is not installed, the entire test module is skipped via thepytestmark(lines 30-33). This means the authentication override will never be set up or torn down when pygeoapi is missing. While this is functionally correct (tests are skipped), the fixture setup/teardown pattern might confuse future maintainers. Consider adding a docstring to the fixture explaining this behavior.
| def pytest_configure(): | ||
| load_dotenv(override=True) | ||
| os.environ.setdefault("POSTGRES_PORT", "54321") | ||
| # NOTE: This hardcoded secret key is for tests only and must NEVER be used in production. |
There was a problem hiding this comment.
The conftest.py and main initialization set a default SESSION_SECRET_KEY for tests, but this hardcoded secret is documented as test-only with a clear warning. However, the comment in conftest.py line 21-22 should use more emphatic language matching the rest of the codebase, such as "MUST NEVER" instead of "must NEVER" for consistency with security warnings elsewhere.
| # NOTE: This hardcoded secret key is for tests only and must NEVER be used in production. | |
| # NOTE: This hardcoded secret key is for tests only and MUST NEVER be used in production. |
Summary
Replaced the custom OGC implementation with a pygeoapi-based OGC API Features stack, mounted into FastAPI, and moved pygeoapi support objects to DB-managed views/migrations.
What changed
FastAPI + pygeoapi integration
PYGEOAPI_MOUNT_PATH(now/ogcapi).core/pygeoapi-config.yml/tmp/pygeoapiby default).OGC data model changes
DB/Alembic
d5e6f7a8b9c0...), including:ogc_*thing-type viewsogc_latest_depth_to_water_wells(materialized)ogc_avg_tds_wells(materialized; sourced fromNMA_MajorChemistry)WHERE FALSEstub behavior; migration now fails clearly when required source tables are missing.measuring_point_heightnulls are now treated as0(COALESCE) for depth-to-water BGS.$do$/$cmd$).CLI
refresh-pygeoapi-materialized-views--viewand--concurrentlyload_dotenv(override=True)so.envvalues win.Infra/workflows/env
PYGEOAPI_POSTGRES_HOSTPYGEOAPI_POSTGRES_PORTPYGEOAPI_POSTGRES_DBPYGEOAPI_POSTGRES_USERPYGEOAPI_POSTGRES_PASSWORDpygeoapito defaultapp_readgrant membership.docker/db/Dockerfileinstallspostgresql-17-cronpg_cronand setscron.database_name.Cleanup
.pygeoapiruntime artifacts from versioned code paths.Why
Notes
pg_cronmust be available on the target PostgreSQL server/instance for scheduled refresh setup.