Skip to content

Allow running a specific operation by filename - #2

Merged
stevebauman merged 2 commits into
masterfrom
feat/run-selected-operation
Oct 4, 2026
Merged

stevebauman merged 2 commits into
masterfrom
feat/run-selected-operation

Conversation

@stevebauman

Copy link
Copy Markdown
Member

operations:run currently executes every pending operation, which makes it difficult to test one anonymous operation through the real runner. I've added an optional operation argument so you can select a single file:

$this->artisan('operations:run', [
    'operation' => '2026_10_03_120000_backfill_company_names',
])->assertSuccessful();

The argument uses the exact filename without .php, consistent with operations:forget. Selection happens before files are loaded, so unrelated operations never execute. The selected operation keeps the runner's transaction behavior and completion checks, including skipping a second run after completion. Without an argument, all pending operations still run in filename order.

Empty, invalid, missing, and partial names fail with a nonzero exit code. Paths and .php extensions are rejected. The README includes a Pest example and test database setup guidance.

Validation: all 58 package tests pass (229 assertions), and Pint passes on PHP 8.4 / Laravel 13. The published commit is verified by GitHub and its tree matches the tested local index.

Fixes #1

@stevebauman
stevebauman marked this pull request as ready for review October 4, 2026 17:23
@stevebauman
stevebauman merged commit 630e2e8 into master Oct 4, 2026
8 checks passed
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.

Run a specific operation by filename

1 participant