feat(#15): geo+json conformance (PostGIS) + exact CI test gate#62
Merged
Conversation
…ollection rendering Fixes the three geojson conformance failures (1616/1617/1618): * mix bier.fixtures.load now requires PostGIS: it runs CREATE EXTENSION IF NOT EXISTS postgis and creates/seeds test.shops from the frozen fragment's commented PostGIS block (spec/ stays untouched; the loader owns the dependency). * Bier.Introspection.postgis?/1 detects the installed extension; the flag is captured in the Bier.SchemaCache snapshot. * Relation GET/HEAD reads offer application/geo+json only when postgis is installed (otherwise the Accept keeps yielding 406 PGRST107). * Bier.QueryExecutor gains a :geojson format on the flat read path: rows render via ST_AsGeoJSON(record) and aggregate into a GeoJSON FeatureCollection, mirroring PostgREST's asGeoJsonF. A relation without a geometry column fails with SQLSTATE 22023 'geometry column is missing' (400), exactly as PostgREST (case 1618). * Documents the local PostGIS requirement in CONTRIBUTING.md and docs/CONFORMANCE_IMPL.md; adds test/bier/geojson_test.exs covering detection and both aggregation outcomes. Full suite is now green locally: 707 tests, 0 failures. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…het) With the geo+json cases fixed the conformance suite passes outright, so the BASELINE_FAILURES regression ratchet no longer earns its keep: * the postgres service now uses postgis/postgis:<pg>-3.5 (the official postgres image + PostGIS), required by mix bier.fixtures.load's CREATE EXTENSION postgis. * the 'conformance regression ratchet' step is replaced by a plain mix test — any failure fails the job. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Closes #15.
What
Makes "the conformance suite passes" literally true: fixes the last 3 failing conformance cases — the PostGIS/geojson trio (1616/1617/1618) — and replaces CI's failure-count ratchet with an exact
mix testgate.geo+json support (cases 1616/1617/1618)
lib/mix/tasks/bier.fixtures.load.ex): runsCREATE EXTENSION IF NOT EXISTS postgisand creates/seedstest.shopsfrom the frozen fragment's commented PostGIS block.spec/**stays untouched — the loader owns the dependency, as the fragment keeps the block commented precisely because postgis may be unavailable standalone.Bier.Introspection.postgis?/1detects the installed extension; the flag rides theBier.SchemaCachesnapshot.GET/HEADreads offerapplication/geo+jsononly when postgis is installed (without it the Accept still yields 406 PGRST107, matching the cases' preconditions).Bier.QueryExecutorgains a:geojsonformat on the flat read path — rows render viaST_AsGeoJSON(record)and aggregate into a GeoJSONFeatureCollection, mirroring PostgREST'sasGeoJsonF. A relation without a geometry column fails with SQLSTATE 22023geometry column is missing→ 400 (case 1618), straight through the existingPgErrormapping.CI: ratchet removed (exact gate)
postgres:<pg>topostgis/postgis:<pg>-3.5(official image + PostGIS; tags 15-3.5/16-3.5/17-3.5 verified on Docker Hub).BASELINE_FAILURESregression-ratchet step is deleted and replaced with a plainmix teststep (the comment about the alias loading fixtures is kept). Any test failure now fails the job.Docs
Verification
mix testlocally (exclusive DB grant for this change): 707 tests, 0 failures — including--only area:content_negotiation(39/39).test/bier/geojson_test.exscovers postgis detection, the FeatureCollection aggregation againsttest.shops, and the 22023 error on a geometry-less relation.mix format --check-formatted,mix compile --warnings-as-errors(dev+test),mix credo --strict,mix docs --warnings-as-errors.ST_AsGeoJSON(record)on a geometry-less row raises22023: geometry column is missing.🤖 Generated with Claude Code