Skip to content

test(plugin-security,plugin-auth,plugin-approvals): narrow the blanket pre-18 tenant-column relax rigs to the residue tables they model #25132

Open

Description

@objectstack-fleet

carries item B6 of #25128; #25128 keeps item C1 (the three stale "stays NULL on single-tenant" comments in packages/objectql and packages/spec).

Filing gate ③, carried from #25128. This is a follow-up that 7b-0 owes (#24940, merged as 5e9b100743). It is B6 of that PR's contract review 6317931247, which did not block the landing.

B6: narrow the blanket relax rigs

Since 7b-0, a table the driver creates has a NOT NULL tenant column. Tests that model a pre-18 store (where the column was nullable) relax that column through the pre-18 testkits.

Measured on origin/main 4e2c42f363, the blanket form relaxEveryRegisteredTenantColumn( / relaxEveryTenantColumn( appears 47 times in 40 test files:

Package Files
plugin-security 27
plugin-auth 11
plugin-approvals 2

Each package's own pre-18-tenant-column.testkit.ts already exports the named form, relaxTenantColumns(engine, tables).

Each rig is a legitimate pre-18 model, and no assertion is weakened by it. But the blanket form also relaxes tables that hold no organization-less residue. So an unstamped production write inside such a rig lands, where it should fail. The rig loses the power to catch exactly the bug 7b-0 exists to refuse.

Fix:

  • Replace each blanket call with relaxTenantColumns(engine, [the tables the test seeds organization-less]), for example sys_permission_set, sys_position, sys_user_permission_set and the holdings.
  • Keep the one-line justification comment.
  • Spot-check a rig by removing its relax: only the named tables' seeds should fail.

Test files only. No behavior change.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions