Skip to content

Fix tenants:seed command name - #1478

Open
lucasmichot wants to merge 3 commits into
archtechx:masterfrom
lucasmichot:fix/1474-tenants-seed-command-name
Open

Fix tenants:seed command name#1478
lucasmichot wants to merge 3 commits into
archtechx:masterfrom
lucasmichot:fix/1474-tenants-seed-command-name

Conversation

@lucasmichot

@lucasmichot lucasmichot commented Aug 5, 2026

Copy link
Copy Markdown

Fixes #1474.

Replaces the version_compare check in Seed::__construct() with a configure() override that calls setName('tenants:seed'). configure() always runs after the command name is set by Symfony's Command constructor, regardless of whether the installed Laravel version's SeedCommand sets its name via $name (pre-13.24) or $signature (13.24+), so this works across versions without checking app()->version().

configure() is also the general place to add, remove, or tweak a parent command's arguments/options ($this->addArgument(), $this->addOption(), or $this->getDefinition()->remove*()), since it's guaranteed to run after the parent's own definition is built and before the command executes. Worth keeping in mind for other commands here that extend Laravel's built-in ones and need to adjust their inherited signature.

Summary by CodeRabbit

  • Bug Fixes

    • Fixed tenant database seeding command registration so it no longer replaces Laravel’s built-in database seeding command.
    • Preserved separate access to both tenant seeding and standard database seeding commands.
  • Tests

    • Added coverage confirming each seeding command resolves and operates independently.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e72dd6cc-f5a3-4eda-be7e-57b02ade75f1

📥 Commits

Reviewing files that changed from the base of the PR and between c747612 and 5a5ab2b.

📒 Files selected for processing (1)
  • src/Commands/Seed.php
💤 Files with no reviewable changes (1)
  • src/Commands/Seed.php

📝 Walkthrough

Walkthrough

Seed now preserves inherited Laravel seed command configuration, adds tenant options only when needed, and explicitly registers the command as tenants:seed. Tests verify that db:seed and tenants:seed remain separately registered.

Changes

Tenant seed command

Layer / File(s) Summary
Command initialization and naming
src/Commands/Seed.php
Seed initializes SeedCommand, conditionally adds tenant options, preserves inherited configuration, and sets the command name to tenants:seed.
Command registration validation
tests/CommandsTest.php
Tests verify that db:seed uses Laravel’s SeedCommand and tenants:seed uses the tenancy Seed command.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Poem

A rabbit checks the seed command’s name,
Laravel’s db:seed stays the same.
Tenant options join the queue,
tenants:seed comes through.
Two commands hop without a fight. 🐇

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary fix to the tenants:seed command name.
Linked Issues check ✅ Passed The changes set tenants:seed explicitly and test that Laravel's db:seed command remains intact, satisfying issue #1474.
Out of Scope Changes check ✅ Passed The production and test changes directly support the command registration fix described in issue #1474.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.64%. Comparing base (e0990a4) to head (5a5ab2b).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1478      +/-   ##
============================================
- Coverage     86.65%   86.64%   -0.01%     
- Complexity     1220     1221       +1     
============================================
  Files           186      186              
  Lines          3589     3588       -1     
============================================
- Hits           3110     3109       -1     
  Misses          479      479              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Replaces the version_compare hack with a configure() override that
sets the command name, which works regardless of whether the
installed Laravel version's SeedCommand uses $name or $signature.
@lucasmichot
lucasmichot force-pushed the fix/1474-tenants-seed-command-name branch from 54f9c54 to d2c96bb Compare August 5, 2026 10:04
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tenants:seed command registers as db:seed on Laravel 13.24 (SeedCommand switched from $name to $signature)

1 participant