Skip to content

Feature/experiment#16

Merged
annurdien merged 7 commits into
mainfrom
feature/experiment
Jul 17, 2026
Merged

Feature/experiment#16
annurdien merged 7 commits into
mainfrom
feature/experiment

Conversation

@annurdien

@annurdien annurdien commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

  • Unit tests pass
  • Integration tests pass
  • Manual testing performed

Test Configuration:

  • OS: [e.g. macOS, Linux, Windows]
  • Go version: [e.g. 1.21.0]
  • Device types tested: [e.g. iOS Simulator, Android Emulator]

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Screenshots (if applicable):

Please add screenshots to help explain your changes.

Additional Notes:

Add any other notes about the pull request here.

- Introduces DeviceManager interface for generic platform operations
- Migrates iOS logic to IOSManager and Android logic to AndroidManager
- Standardizes executeDeviceAction looping over managers
- Refactors app.go, media.go, and dashboard.go to use manager lookups
- Fix shell injection in create.go and logs.go
- Fix config directory creation to not fallback to /tmp
- Fix copy heuristic for device detection
- Fix silent error swallowing across device teardowns and generations
- Merge shutdown command into stop command as alias
- Extract hardcoded strings into constants
- Update CI configuration to run all tests
- Ignore coverage output files
Copilot AI review requested due to automatic review settings July 16, 2026 10:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors device operations into a unified DeviceManager abstraction (iOS + Android), updates command implementations to use the new manager layer, and improves safety by removing shell-based log filtering. It also updates config path APIs to return errors and adjusts tests/CI accordingly.

Changes:

  • Introduces DeviceManager interface with new IOSManager and AndroidManager implementations and routes device commands through them.
  • Reworks log streaming to avoid sh -c | grep (shell injection surface) by handling filtering inside the TUI log viewer.
  • Updates config helpers (GetConfigDir/GetConfigPath) to return (string, error) and updates tests and CLI commands to handle errors; expands CI test scope to go test -race ./....

Reviewed changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/integration_test.go Updates integration tests for new config helper error-returning signatures.
tests/config_test.go Updates unit tests to handle (string, error) config helpers.
cmd/ui.go Normalizes device/platform display strings and state formatting.
cmd/root.go Removes the standalone shutdown command registration (now handled via aliases).
cmd/media.go Switches active-device detection to the unified FindRunningDevice.
cmd/manager.go Adds the new manager registry and unified FindRunningDevice implementation.
cmd/logs.go Removes shell-based grep piping and passes filter into the TUI viewer.
cmd/log_viewer.go Adds viewer-side filtering support for streamed logs.
cmd/list_benchmark_test.go Adds benchmarks for simulator/emulator listing and runtime formatting.
cmd/ios_manager.go Implements iOS device operations behind DeviceManager.
cmd/android_manager.go Implements Android device operations behind DeviceManager.
cmd/device.go Refactors stop/restart/delete/erase/clone/start to use the manager interface; folds shutdown into stop aliases.
cmd/dashboard.go Updates dashboard stop behavior to use managers.
cmd/create.go Removes sh -c usage for AVD creation and improves error handling in the wizard.
cmd/copy.go Adjusts argument parsing heuristics for optional device argument.
cmd/constants.go Adds NameIOS/NameAndroid constants for display normalization.
cmd/config.go Updates config directory/path helpers to return errors and threads that through config load/save.
cmd/config_cmd.go Updates config path command to handle config-path errors.
cmd/completion.go Adds error handling for shell completion generation.
cmd/app.go Switches install/uninstall device resolution to the unified FindRunningDevice.
.gitignore Updates ignore rules for coverage artifacts.
.github/workflows/ci.yml Expands race-test scope from ./tests/ to ./....
Comments suppressed due to low confidence (1)

cmd/logs.go:108

  • This if filter != "" { ... } block is empty. Since filtering is always handled by runLogViewer, remove the conditional to avoid empty-branch lints and simplify the control flow.
	}

	stdout, err := logCmd.StdoutPipe()
	if err != nil {
		return err

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmd/logs.go Outdated
Comment thread cmd/create.go
Comment thread cmd/ui.go

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 23 changed files in this pull request and generated 5 comments.

Comment thread cmd/app.go Outdated
Comment thread cmd/device.go
Comment thread cmd/create.go
Comment thread cmd/dashboard.go
Comment thread cmd/log_viewer.go
@annurdien
annurdien requested a review from Copilot July 17, 2026 10:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@annurdien
annurdien merged commit 566cdfd into main Jul 17, 2026
2 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.

2 participants