Add device inventory query support#22
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a normalized “device inventory” layer on top of adb devices -l, introduces a new device-status command (inventory metadata + preflight/readiness), and adds --device-query for selecting a single target device in CLI routing (kept out of host/infrastructure contracts).
Changes:
- Introduces normalized device inventory models (
DeviceState) and inventory derivation fromDeviceListResult. - Adds
device-statuscommand and--device-queryparsing/selection in CLI routing. - Adds focused tests for inventory derivation,
device-statusenvelope contract, and--device-queryselection behavior; updates help/docs.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| Luotsi.Cli/Models/CommandResults.cs | Adds new command result records for normalized inventory and device-status output. |
| Luotsi.Cli/Infrastructure/Devices/DeviceInventory.cs | Implements normalization of adb devices -l rows into a richer DeviceState. |
| Luotsi.Cli/Cli/Routing/DeviceStatusResolver.cs | Resolves the selected device’s inventory entry and combines it with preflight readiness. |
| Luotsi.Cli/Cli/Routing/DeviceSelectorResolver.cs | Implements --device-query resolution before creating the “real” command host. |
| Luotsi.Cli/Cli/Routing/DeviceQuerySelector.cs | Adds query parsing (key=value clauses) and single-device selection/erroring. |
| Luotsi.Cli/Cli/Routing/AppCommandFamilyRouter.cs | Wires device-query resolution into default command routing before host creation. |
| Luotsi.Cli/Cli/Routing/AppCommandDispatcher.cs | Routes devices to inventory output and adds device-status command execution. |
| Luotsi.Cli/Cli/Help.cs | Documents device-status and the new --device-query option in CLI help text. |
| Luotsi.Cli/Cli/CliOptions.cs | Registers device-status as a known command token. |
| Luotsi.Cli.Tests/TestSupport.cs | Enhances the fake factory to capture created host configurations for assertions. |
| Luotsi.Cli.Tests/AdbReadinessTests.cs | Adds tests for inventory derivation, device-status contract, and device-query selection. |
| docs/commands.md | Documents the new device-status command in the command reference. |
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
Add
device-statusand--device-querysupport for selecting and reporting adb-visible devices.What changed
adb devices -ldevice-statuswith explicit inventory metadata plus readiness detailsdevice-statuscommand-envelope contract testValidation
dotnet build .\\Luotsi.slnAdbReadinessTests(23 passing)Notes
This keeps host interfaces focused on raw device operations while the CLI layer owns command-specific query and envelope behavior.