Skip to content

feat: PPT-526 seed the management partner and own the placeholder estate - #105

Draft
camreeves wants to merge 2 commits into
masterfrom
PPT-526-tenancy
Draft

camreeves wants to merge 2 commits into
masterfrom
PPT-526-tenancy

Conversation

@camreeves

Copy link
Copy Markdown
Contributor

Clean-install half of multi-tenancy (under PPT-526). Pairs with PlaceOS/models#332 and PlaceOS/rest-api#451. Draft until the set has been through a clean install on the test cluster.

What this does

  • start creates the management partner ("PlaceOS", management = true) and its staff organisation (partner_staff = true), and attaches the first domain to that organisation. With enforcement on, the seeded admin therefore has cluster reach from the first boot rather than reaching nothing.
  • Placeholder zones, system, module and trigger are created owned by that organisation, so a fresh non-production install has no unowned rows. The create:placeholders task does the same when a staff organisation exists.
  • Builds against the models branch through shard.override.yml, and the image clones that branch for its migrations, so a clean install from this image applies the tenancy schema.

Both seeding steps are idempotent in the same way as the existing ones: existing rows are reused, never changed, except that an unowned first domain is attached.

Verification

  • crystal build --no-codegen clean for start and sam.
  • The tenancy fixture in rest-api#451 (spec/spec_helpers/tenancy.cr) builds the same shape this seeds, and its specs show a staff-organisation admin resolving to cluster reach.

Plan: https://gist.github.com/camreeves/3fabfff92bcdef77a1dcb4b8d8ebfe7b

start creates the management partner and its staff organisation and
attaches the first domain to it, so the seeded admin has cluster reach
once tenancy enforcement is on. Placeholder rows are created owned by that
organisation. Builds and clones migrations from the models tenancy branch
until models #332 merges.
@github-actions github-actions Bot added type: enhancement new feature or request and removed type: enhancement new feature or request labels Oct 7, 2026
@github-actions github-actions Bot added the type: enhancement new feature or request label Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement new feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant