Repository navigation
test(rls): cover public.data_gap_events in the RLS coverage gate - #3589
Conversation
Signed-off-by: Christopher <131207452+PetrefiedThunder@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review.
|
|
Vercel preview access note removed (A-2177 secret-hygiene cleanup). |
PR Blocker ChecklistHead SHA: Status: Ready
|
PetrefiedThunder
left a comment
There was a problem hiding this comment.
Review of 153011f.
The change is correct. v135 (20261024_41f96588d87c) creates data_gap_events with tenant_id uuid not null. It runs ENABLE and FORCE row level security and creates policy tenant_isolation_data_gap_events on get_tenant_context(), with the sysadmin CASE arm. Listing the table in PUBLIC_TENANT_SCOPED_TABLES matches that.
This PR does not fix the red it was opened for. The EXTRA TABLE parity failure on #3551 is stale: #3551's merge predates f973979 (#3549), which added data_gap_events to docs/schema/expected_schema.json. Main's current red is the ingest-samples test, which #3585 targets.
Blocking: CI is not green on this head.
- The Repo-root security/RLS/isolation suite fails in tests/docs/test_ingest_samples_validate.py (EXPECTED_SAMPLES mismatch, inherited from main).
- PR Blocker Checklist and Head SHA Check Guard are cancelled-only.
- PR Gate: Backend and the Test jobs are still pending.
- Engine Review Pass failed.
Re-review once #3585 lands and this branch is updated.
REVIEW: FAIL codex 153011f
PetrefiedThunder
left a comment
There was a problem hiding this comment.
REVIEW: PASS deepseek 58ad189
Full review (no earlier DeepSeek pass). Reviewed by hand; no dsh headless run.
- tests/migrations/test_rls_coverage.py:125-127 adds "data_gap_events" to PUBLIC_TENANT_SCOPED_TABLES, with no other changes. I checked it against alembic revision 41f96588d87c (v135): tenant_id is uuid NOT NULL, RLS is ENABLE + FORCE, and policy tenant_isolation_data_gap_events uses get_tenant_context() with the sysadmin CASE arm. The entry is accurate.
- Remerge-diff of the head merge is empty.
- All real CI checks are green. The Postgres-backed gate test runs in CI.
- CI note: the only failing checks are gates that wait on an engine review of this head (Engine Review Pass: "No passing review from a non-author engine for current head SHA", plus the PR Blocker Checklist / Head SHA Check Guard aggregates). That is circular, so I am posting per C.Lee.
PetrefiedThunder
left a comment
There was a problem hiding this comment.
REVIEW: PASS deepseek 58ad189
This follows up my earlier hand review. A dsh headless run on the full PR diff (merge-base..58ad189) confirmed the PASS. Excerpt:
No concrete bugs found.
The diff adds `"data_gap_events"` to `PUBLIC_TENANT_SCOPED_TABLES` at `tests/migrations/test_rls_coverage.py:124-127`. That classification is correct: alembic revision `41f96588d87c` (v135) creates `public.data_gap_events` with `tenant_id uuid not null` (`alembic/versions/20261024_41f96588d87c_v135_data_gap_time_to_fix.py:31`), enables and forces RLS (`:73,76`), and installs `tenant_isolation_data_gap_events` with the sysadmin CASE arm first and `tenant_id = (select public.get_tenant_context())` otherwise (`:85-100`). The gate is non-vacuous: `test_listed_tables_all_exist` proves the table exists, and the NOT NULL/FORCE/policy assertions then run against it.
I applied the 4-line PR change to the current tree and ran `tests/migrations/test_rls_coverage.py` against a disposable real Postgres after `alembic upgrade head`; all 8 tests passed. The scratch DB and temporary edit were removed. The diff contains no invented data and no tenant-scoping defect.
VERDICT: PASS
PetrefiedThunder
left a comment
There was a problem hiding this comment.
REVIEW: PASS muse 58ad189
Test-only, 4 added lines: adds data_gap_events to PUBLIC_TENANT_SCOPED_TABLES in tests/migrations/test_rls_coverage.py.
Checked against alembic v135 (20261024_41f96588d87c) at this head: tenant_id uuid not null, ENABLE + FORCE RLS, and tenant_isolation_data_gap_events with the sysadmin CASE arm first and tenant_id = (select public.get_tenant_context()) in USING/WITH CHECK. The gate assertions match what the migration does. No fixtures or data are added. The merge commit 58ad189 only brings in main.
Not run locally: the suite needs the CI Postgres. The required gates (CI Status Gate, PR Gate Backend/Frontend/Workflow Contract) were still pending at review time.
Signed-off-by: C.Lee Sellers <chris@znc.dev>
PetrefiedThunder
left a comment
There was a problem hiding this comment.
REVIEW: PASS — delta re-review #3589 (data_gap_events RLS coverage)
Head reviewed: af880ecd52692ed4fda4e50ebada104fb8890b7c (claude/rls-data-gap-events).
Prior FAIL: #3589 (review) (153011ff3b9aa4746301d42e94d359ec53a14392).
Prior FAIL findings — status
| Finding | Status |
|---|---|
| Code change correct (v135 tenant_id / ENABLE+FORCE / tenant_isolation policy) | Still holds |
CI red: tests/docs/test_ingest_samples_validate.py EXPECTED_SAMPLES (from main) |
Fixed — #3585 (2eaad7532) on main; this head merges it; EXPECTED_SAMPLES gone |
| PR Blocker / Head SHA cancelled-only; backend pending; Engine Review Pass failed | Process/CI timing on that head — not a code defect; re-reviewed after main merge |
Delta verification
- Range / net patch
origin/main...HEAD: +4 / −0 intests/migrations/test_rls_coverage.pyonly — addsdata_gap_eventstoPUBLIC_TENANT_SCOPED_TABLES(comment + entry). Matches Lead’s claim. - Remerge-diff: merge
origin/maininto153011ff→ tree matches current HEAD for the PR file (empty remerge-diff). Blob fortest_rls_coverage.pyidentical across153011ff/58ad189a/af880ecd(420694e4…). Clean merge; no patch drift. - Tenant scope confirmed at this head:
- Alembic v135
20261024_41f96588d87c:tenant_id uuid NOT NULL; ENABLE + FORCE RLS;tenant_isolation_data_gap_eventswith sysadmin CASE arm +get_tenant_context(). - Matching Supabase
20261025033803_data_gap_time_to_fix.sql: same shape.
- Alembic v135
- Listed once in
PUBLIC_TENANT_SCOPED_TABLES; not inPUBLIC_TABLES_SCOPED_VIA_PARENT. No synthetic data in the delta.
Verdict
PASS on the delta against the prior FAIL. Does not merge or request reviews; required checks / different-engine policy remain Lead’s.
REVIEW: PASS codex af880ec
Adds
data_gap_events(created by #3572, alembic v135) toPUBLIC_TENANT_SCOPED_TABLESin tests/migrations/test_rls_coverage.py, so the gate checks it like the other curated public tenant tables.Matches what the migration does (alembic/versions/20261024_41f96588d87c_v135_data_gap_time_to_fix.py):
tenant_id uuid not nullenable row level securityandforce row level securitytenant_isolation_data_gap_eventsfor all, USING and WITH CHECK ontenant_id = (select public.get_tenant_context())with the sysadmin arm firstLocal: the suite skipped because the disposable testcontainers Postgres did not start on this machine; CI runs it against the service Postgres.
Note
Low Risk
Test-only change to the migration RLS regression suite; no runtime or schema behavior is modified.
Overview
Extends the public-schema RLS coverage gate (#2828) so
public.data_gap_events(from #3572 / alembic v135) is checked like other curated tenant tables.Adding it to
PUBLIC_TENANT_SCOPED_TABLESmakes CI assert NOT NULLtenant_id, FORCE ROW LEVEL SECURITY, and a policy that referencesget_tenant_context()—matching the migration’s posture and preventing ENABLE-without-FORCE or empty-policy regressions on this table.Reviewed by Cursor Bugbot for commit 153011f. Bugbot is set up for automated code reviews on this repo. Configure here.