processmaker icon indicating copy to clipboard operation
processmaker copied to clipboard

Refactor SwitchTenant task

Open nolanpro opened this issue 2 months ago • 2 comments

Refactor how we switch tenants

ci:multitenancy ci:deploy ci:k8s-branch:remove-tenant-specific-cache


[!NOTE] Refactors tenant switching to set env/config per-tenant, adds cache settings prefixing and JSON-enabled tenants:verify, integrates DB switch task, and removes legacy bootstrap/queue Horizon listen logic.

  • Multitenancy Core:
    • Switching: ProcessMaker\Multitenancy\SwitchTenant now saves landlord config, sets APP_URL, updates app.instance, app.url, filesystem roots, lang path, decrypts and sets app.key, and resets logging; forgetCurrent() restores landlord paths/keys.
    • Cache Prefixing: New ProcessMaker\Multitenancy\PrefixCacheTask prefixes default cache and cache_settings store per-tenant; registered in config/multitenancy.php alongside SwitchTenantDatabaseTask.
    • Queues: New MakeQueueTenantAwareAction avoids exceptions when multitenancy is disabled; wired in config/multitenancy.php.
  • CLI:
    • tenants:verify: Adds --json output, structured tables/logging, expected per-tenant validations (paths, configs, env vars), and error aggregation.
  • App/Providers Cleanup:
    • Remove TenantBootstrapper integration and Application::bootstrapWith override; delete HorizonListen command and related Horizon bootstrap/event hooks from ProcessMakerServiceProvider.
  • Config/Tests:
    • Add MULTITENANCY=false to phpunit.xml.
    • Keep PackageManifest singleton override; no other provider registration changes.

Written by Cursor Bugbot for commit a64fbed91b36ed3be9f01622a2dc8d0f7b368e4d. This will update automatically on new commits. Configure here.

nolanpro avatar Nov 26 '25 21:11 nolanpro

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

QA server K8S was successfully deployed https://tenant-1.ci-be8634c205.engk8s.processmaker.net

vladyrichter avatar Nov 27 '25 00:11 vladyrichter