Skip to content

fix(devicectl): retain USB discovery when listing fails - #1745

Merged
GitToTheHub merged 1 commit into
apache:masterfrom
GitToTheHub:fix/devicectl-discovery-fallback
Nov 11, 2026
Merged

GitToTheHub merged 1 commit into
apache:masterfrom
GitToTheHub:fix/devicectl-discovery-fallback

Conversation

@GitToTheHub

@GitToTheHub GitToTheHub commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Platforms affected

iOS device discovery and automatic run destination selection.

Motivation and Context

When devicectl list fails, or its output cannot be parsed into a device list, devicectl does not provide the expected JSON. Dereferencing .json.result.devices then throws a TypeError before USB discovery runs. Connected legacy USB devices consequently cannot be discovered through the existing fallback.

Description

Check the command result and device-list shape before reading it. On failure, emit a diagnostic and continue with an empty devicectl list so USB discovery still runs. Successful wired-device selection and deduplication keep their existing behavior.

Add regression coverage for command failure, a subprocess error, missing JSON, a missing/invalid device list, and an empty successful result.

Testing

  • npm run lint passed.
  • npm run cover: 371 specs, 0 failures, including macOS project creation/build checks.
  • Failure injection confirms USB discovery runs and returns the fixture's three devices after devicectl failure.
  • git diff --check passed.

Checklist

  • Ran lint and the JavaScript test suite successfully
  • Added automated regression coverage
  • Commit uses the repository's fix(devicectl): convention (iOS-only repository)
  • No existing issue to link
  • Documentation changes are not needed

AI assistance

This contribution was created with AI assistance from Codex (GPT-6.1 Sol), including the devicectl discovery fallback and its regression tests.

@codecov-commenter

codecov-commenter commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.75%. Comparing base (f9bb658) to head (ea54ea7).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1745      +/-   ##
==========================================
+ Coverage   82.72%   82.75%   +0.02%     
==========================================
  Files          17       17              
  Lines        5234     5242       +8     
==========================================
+ Hits         4330     4338       +8     
  Misses        904      904              

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@erisu erisu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@GitToTheHub
GitToTheHub force-pushed the fix/devicectl-discovery-fallback branch from ea54ea7 to 19a27b2 Compare November 10, 2026 16:16
@GitToTheHub
GitToTheHub merged commit b6f65f9 into apache:master Nov 11, 2026
33 of 37 checks passed
@GitToTheHub
GitToTheHub deleted the fix/devicectl-discovery-fallback branch November 11, 2026 16:24
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.

4 participants