Skip to content

fix: restore PostGIS via boost-serialization from EPEL 10#247

Merged
fatherlinux merged 6 commits into
masterfrom
fix/postgis-boost-serialization-dep
Apr 18, 2026
Merged

fix: restore PostGIS via boost-serialization from EPEL 10#247
fatherlinux merged 6 commits into
masterfrom
fix/postgis-boost-serialization-dep

Conversation

@fatherlinux
Copy link
Copy Markdown
Member

Summary

  • boost-serialization-1.83.0-5.el10 is now available in EPEL 10, satisfying the missing libboost_serialization.so.1.83.0 dep that broke postgis35_17 since 2026-04-09
  • Removes the silent || fallback in the Containerfile that allowed builds to succeed without PostGIS — causing Serper geographic grounding to silently degrade to ungrounded searches for every POI
  • Adds integration tests for PostGIS presence, boundary_geom column existence, and the actual grounding SQL so this class of silent failure is caught by CI going forward

Test plan

  • CI build succeeds with postgis35_17 installed (no fallback needed)
  • PostGIS extension is installed integration test passes
  • pois table has boundary_geom column integration test passes
  • Serper grounding query executes without error integration test passes
  • All other existing tests continue to pass

🤖 Generated with Claude Code

fatherlinux and others added 2 commits April 18, 2026 09:34
boost-serialization-1.83.0-5.el10 is available in EPEL 10 and satisfies
the missing libboost_serialization.so.1.83.0 dependency that broke
postgis35_17 installation since 2026-04-09.

Removes the silent || fallback that allowed builds to succeed without
PostGIS, which caused geographic grounding in serperService.js to silently
degrade to ungrounded searches for every POI.

Adds integration tests for PostGIS presence, boundary_geom column, and
the Serper grounding SQL so this class of silent failure cannot recur
without CI catching it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ive dep

Explicit boost-serialization install fails in UBI10 CI (package not found
without RHSM). With EPEL installed first, dnf can resolve the boost dep
automatically when installing postgis35_17.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the Containerfile to explicitly install boost-serialization as a dependency for PostGIS on RHEL 10 and adds integration tests to verify PostGIS installation and geographic grounding logic. Review feedback suggests optimizing the Containerfile by combining dnf install commands and identifies several issues in the new integration tests, including a geometry type mismatch in the test data insertion, missing geom column population for point POIs, and the need for more robust assertions to validate spatial query results.

Comment thread Containerfile
Comment on lines +29 to 30
dnf install -y postgresql17-server postgresql17 postgis35_17 && \
dnf clean all
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Combine these dnf install commands into a single execution. This reduces the number of image layers and minimizes metadata overhead, leading to a more efficient build process.

    dnf install -y boost-serialization \
        postgresql17-server postgresql17 postgis35_17 && \

Comment on lines +181 to +185
INSERT INTO pois (name, poi_type, latitude, longitude, boundary_geom)
VALUES (
'_test_boundary', 'boundary', 41.3, -81.6,
ST_MakeEnvelope(-82.0, 41.0, -81.0, 41.6, 4326)
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The boundary_geom column is defined as a MultiPolygon (per migration 022). Since ST_MakeEnvelope returns a Polygon, this insertion will fail due to a type mismatch. Wrap the envelope in ST_Multi() to ensure it matches the column's geometry type.

Suggested change
INSERT INTO pois (name, poi_type, latitude, longitude, boundary_geom)
VALUES (
'_test_boundary', 'boundary', 41.3, -81.6,
ST_MakeEnvelope(-82.0, 41.0, -81.0, 41.6, 4326)
)
INSERT INTO pois (name, poi_type, latitude, longitude, boundary_geom)
VALUES (
'_test_boundary', 'boundary', 41.3, -81.6,
ST_Multi(ST_MakeEnvelope(-82.0, 41.0, -81.0, 41.6, 4326))
)

Comment on lines +187 to +191
const testPoi = await pool.query(`
INSERT INTO pois (name, poi_type, latitude, longitude)
VALUES ('_test_point', 'point', 41.2, -81.5)
RETURNING id
`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The grounding query being tested (lines 196-217) retrieves the location for point POIs from the geom column. However, this test insert only populates latitude and longitude. In this test environment, the geom column won't be automatically updated, causing the query to find a NULL geometry and return no results. Populate the geom column explicitly to correctly test the spatial join logic.

Suggested change
const testPoi = await pool.query(`
INSERT INTO pois (name, poi_type, latitude, longitude)
VALUES ('_test_point', 'point', 41.2, -81.5)
RETURNING id
`);
const testPoi = await pool.query(`
INSERT INTO pois (name, poi_type, latitude, longitude, geom)
VALUES ('_test_point', 'point', 41.2, -81.5, ST_SetSRID(ST_MakePoint(-81.5, 41.2), 4326))
RETURNING id
`);


// A point POI uses lat/lon, not geom, so grounding via geom column won't
// match — but the query must execute without throwing.
expect(Array.isArray(result.rows)).toBe(true);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The assertion expect(Array.isArray(result.rows)).toBe(true) is insufficient as it passes even if the query returns an empty array (meaning grounding failed). To properly validate the PostGIS functionality, verify that the query returns exactly one row containing the expected boundary name.

      expect(result.rows.length).toBe(1);
      expect(result.rows[0].name).toBe('_test_boundary');

fatherlinux and others added 4 commits April 18, 2026 09:44
RHSM_ORG_ID and RHSM_ACTIVATION_KEY org secrets were present but never
used in the rotv build workflow. Without RHEL subscription, boost-serialization
(required by SFCGAL, required by postgis35_17) is not available in UBI10.

Registration is conditional (skipped in local builds without secrets) and
unregisters immediately after dnf install to avoid entitlement leakage in
the final image layer.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e profile

Replaces insecure ARG/build-args RHSM approach with --mount=type=secret
pattern as required by crunchtools/constitution container-image profile
Section II. Secrets are never embedded in image layer history.

Updates rotv constitution to document RHSM requirement and remove the
stale "no RHSM needed" claim for PostgreSQL/PostGIS installation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…hanges

Triggers on push to master when Containerfile.base is modified, and on
workflow_dispatch for manual rebuilds. Uses RHSM org secrets so
boost-serialization resolves from RHEL BaseOS, enabling postgis35_17.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Ensures rotv always builds on top of the newly pushed rotv-base rather
than racing against it. Same pattern used by ubi10-core → rotv cascade.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@fatherlinux fatherlinux merged commit 2f09460 into master Apr 18, 2026
2 of 4 checks passed
@fatherlinux fatherlinux deleted the fix/postgis-boost-serialization-dep branch April 18, 2026 13:53
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.

1 participant