Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.

feat(tenant): adopt OR Organisation as tenant identity (closes #405)#496

Merged
rubenvdlinde merged 3 commits into
developmentfrom
feature/migrate-tenant-to-or-tenant
May 20, 2026
Merged

feat(tenant): adopt OR Organisation as tenant identity (closes #405)#496
rubenvdlinde merged 3 commits into
developmentfrom
feature/migrate-tenant-to-or-tenant

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

(re-opened of #411 — accidentally closed by harness force-push; same branch, same content)

Implements migrate-tenant-to-or-tenant — the procest subset of consume-or-tenant-fleet-wide.

Investigation finding

The spec assumed procest had a parallel tenant schema. It doesn't. No schema in procest_register.json, no tenant_schema config key set, no tenant objects ever written. The old code path short-circuited to null in practice. Procest's tenant identity has always been NC groups with tenant_ prefix.

What

  • TenantService rewritten to consume OCA\OpenRegister\Db\OrganisationMapper + OCA\OpenRegister\Service\TenantLifecycleService. Public method signatures preserved so existing callers (TenantController, TenantMiddleware) are unchanged.
  • TenantMiddleware now reads the resolved tenant's status and blocks non-active organisations with HTTP 403 + {success: false, error: 'Organisation is <state>', status: '<state>'}. afterException() surfaces the envelope.
  • All OR dependencies resolve gracefully — null if openregister absent.

Not done (no-op for this codebase)

  • OCC migration command — no source data.
  • Schema deprecation — no schema exists.
  • Row-migration integration tests — nothing to migrate.

Scope inline in tasks.md.

Closes #405.

@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/procest @ 17c6ac7

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm ✅ 420/420
PHPUnit ⏭️
Newman ⏭️
Playwright

Quality workflow — 2026-05-19 03:35 UTC

Download the full PDF report from the workflow artifacts.

@rubenvdlinde rubenvdlinde force-pushed the feature/migrate-tenant-to-or-tenant branch from 38cd955 to 29099f5 Compare May 19, 2026 03:46
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/procest @ fe3fbd3

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm ✅ 420/420
PHPUnit ⏭️
Newman ⏭️
Playwright

Quality workflow — 2026-05-19 03:52 UTC

Download the full PDF report from the workflow artifacts.

Implements migrate-tenant-to-or-tenant — the procest subset of consume-or-tenant-fleet-wide.

Investigation: procest's tenant concept is vestigial. No tenant schema in
procest_register.json, tenant_schema config key never set, no tenant objects
ever written. Functional tenant identity is just NC groups with tenant_ prefix.
This is therefore an adoption, not a migration.

- lib/Service/TenantService.php — rewritten to consume OR's OrganisationMapper
  + TenantLifecycleService. Public method signatures preserved.
- lib/Middleware/TenantMiddleware.php — blocks non-active organisations with
  HTTP 403 + body { status: <state> }; afterException() surfaces the envelope.

No OCC migration (no source data), no schema deprecation (no schema), no row
migration tests (no rows). Scope adjustment documented in tasks.md.

Closes #405
@rubenvdlinde rubenvdlinde force-pushed the feature/migrate-tenant-to-or-tenant branch from 29099f5 to 39d8185 Compare May 19, 2026 04:05
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/procest @ 3599c11

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm ✅ 420/420
PHPUnit ⏭️
Newman ⏭️
Playwright ⏭️

Quality workflow — 2026-05-19 04:06 UTC

Download the full PDF report from the workflow artifacts.

@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/procest @ 4d18055

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm ✅ 420/420
PHPUnit ⏭️
Newman ⏭️
Playwright ⏭️

Quality workflow — 2026-05-19 04:11 UTC

Download the full PDF report from the workflow artifacts.

- Cosmetic auto-fixes via phpcbf (18 fixes):
    - "Expected 1 blank line after function; 2 found" ×12
    - "Array double arrow not aligned correctly" ×5
    - "No blank line found after control structure" ×2
    - "Expected 0 blank lines after function; 2 found" ×1
- Manual fix for `getTenantForUser()`:
    - findOrganisationsByUserId(\$userId) → findOrganisationsByUserId(userId: \$userId)
      (Conduction internal-call sniff: named params required)
- Manual fix for `provisionTenant()`:
    - Replace inline ternary with multi-line if/else block
      (Conduction sniff: inline IF statements not allowed)

Remaining 8 warnings (missing @SPEC PHPDoc tags) are non-blocking by
the CI handler script.
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/procest @ 1168738

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm ✅ 426/426
PHPUnit ⏭️
Newman ⏭️
Playwright ⏭️

Quality workflow — 2026-05-20 12:09 UTC

Download the full PDF report from the workflow artifacts.

composer audit was flagging 13 vulnerabilities across 2 packages:
- symfony/yaml v6.4.34 → v6.4.40 (fixes CVE-2026-45304 ReDoS,
  CVE-2026-45305 ReDoS, plus other 6.4.x advisories)
- twig/twig v3.23.0 → v3.26.0 (fixes a chain of sandbox-escape /
  template-injection advisories on 3.0-3.25.x)

Lock-only update; no composer.json changes.
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/procest @ 3033d90

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm ✅ 426/426
PHPUnit
Newman ⏭️
Playwright ⏭️

Coverage: 0% (0/81 statements)


Quality workflow — 2026-05-20 12:26 UTC

Download the full PDF report from the workflow artifacts.

rubenvdlinde added a commit that referenced this pull request May 20, 2026
Same fix landed in PR #491 and #496. Pulling it into this PR so
its CI doesn't carry the same red Security (composer) check.

- symfony/yaml v6.4.34 → v6.4.40 (CVE-2026-45304/45305 + others)
- twig/twig v3.23.0 → v3.26.0 (sandbox-escape advisories chain)
@rubenvdlinde rubenvdlinde merged commit adc890a into development May 20, 2026
46 of 47 checks passed
@rubenvdlinde rubenvdlinde deleted the feature/migrate-tenant-to-or-tenant branch May 20, 2026 22:44
rubenvdlinde added a commit that referenced this pull request May 20, 2026
* fix(eslint): collapse double blank lines in src/registry.js

eslint rule no-multiple-empty-lines was flagging two consecutive blank
lines between the PublicStatusPage entry and the Detail-tab components
section. Single blank line is the project convention.

Surfaced by procest#496 (the tenant-OR PR) eslint job, which runs
against the PR-merged-with-dev commit.

* chore(security): bump symfony/yaml + twig/twig past advisories

Same fix landed in PR #491 and #496. Pulling it into this PR so
its CI doesn't carry the same red Security (composer) check.

- symfony/yaml v6.4.34 → v6.4.40 (CVE-2026-45304/45305 + others)
- twig/twig v3.23.0 → v3.26.0 (sandbox-escape advisories chain)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant