[4.x] Add --skip-tenants option to HasTenantOptions#1436
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1436 +/- ##
============================================
+ Coverage 85.98% 86.00% +0.01%
Complexity 1175 1175
============================================
Files 185 185
Lines 3425 3429 +4
============================================
+ Hits 2945 2949 +4
Misses 480 480 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Hi @stancl Just checking in on this PR. Let me know if there’s any feedback or changes needed from my side, happy to update it. Thanks for your time! |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a ChangesTenant Skipping Functionality
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/CommandsTest.php`:
- Around line 519-540: The pest()->artisan(...) invocation in the test closure
(the migrate commands test that creates tenant1/2/3) lacks an exit-code
assertion; modify the call to chain an assertion (for example
->assertExitCode(0) or ->assertSuccessful()) onto the pest()->artisan(...)
expression so the test fails if the artisan command crashes before the
subsequent tenancy/schema expectations run.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 4729a91a-4d8b-45e5-8b47-efbd6a742e1e
📒 Files selected for processing (3)
src/Commands/Run.phpsrc/Concerns/HasTenantOptions.phptests/CommandsTest.php
Summary
Adds a --skip-tenants option to all tenant artisan commands (
tenants:run,tenants:migrate,tenants:rollback,tenants:seed,tenants:up,tenants:down).The option is the complement of the existing
--tenantsoption instead of specifying which tenants to include, you specify which to exclude.Changes
src/Concerns/HasTenantOptions.phpAdded--skip-tenants=*option togetOptions()and awhereNotInclause ingetTenantsQuery()to exclude the specified tenants from the query. Since all tenant commands share this trait, the option is available across all of them.src/Commands/Run.phpAdded--skip-tenants=*to the command signature so it appears intenants:run --help.Usage
# Works on all tenant commands php artisan tenants:migrate --skip-tenants=tenant3Summary by CodeRabbit
New Features
--skip-tenantsoption to tenant console commands to exclude specific tenants from execution.--skip-tenantscan be combined with--tenantsfor precise inclusion/exclusion control.Tests
--tenants+--skip-tenantsbehavior is correct.