fix(resources:get): skip remote container selection for array options#58
Merged
miguelsanchez-upsun merged 2 commits intomainfrom Apr 29, 2026
Merged
Conversation
ResourcesGetCommand defines --app and --worker as VALUE_IS_ARRAY (filters, not selectors). When the command is run without those options the empty default ([]) reached Selector::selectRemoteContainer, where it cleared the !== null check and was cast to a string, producing several "Array to string conversion" warnings followed by: Worker not found: Array (in app: Array) In Selector::getSelection, treat array-typed --app as a signal to skip the whole remote container block. The calling command filters services itself via ResourcesUtil::filterServices, so no per-container selection is needed. Add an integration test that runs resources:get against a mocked API and asserts the command exits successfully with no array-cast warnings.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a regression where resources:get could fail when --app / --worker are defined as VALUE_IS_ARRAY filters, by preventing the selector’s remote-container selection logic from treating the default empty array as a string worker/app name.
Changes:
- Update
Selector::getSelection()to skip remote-container selection when--appis array-typed. - Add an integration test that runs
resources:getagainst the mock API and asserts successful execution without array-cast warnings.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
legacy/src/Selector/Selector.php |
Avoids remote-container selection when --app is an array (filter-style) option, preventing array-to-string casting and downstream selection errors. |
integration-tests/resources_get_test.go |
Regression test covering resources:get execution with mocked endpoints and asserting no “Array to string conversion” / “Worker not found” errors. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
miguelsanchez-upsun
approved these changes
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
resources:getfailed withWorker not found: Array (in app: Array)(preceded by severalArray to string conversionwarnings) when run without--appor--worker.ResourcesGetCommanddefines those options asVALUE_IS_ARRAY(they are filters, not selectors). The empty default[]reachedSelector::selectRemoteContainer, where it cleared the!== nullguard and was then cast to a string.The fix is in
Selector::getSelection: when--appis array-typed, skip the whole remote-container block. The calling command filters services itself viaResourcesUtil::filterServices, so no per-container selection is needed.Adds an integration test that runs
resources:getagainst a mocked API and asserts the command exits successfully with no array-cast warnings.🤖 Generated with Claude Code