Skip to content

fix: skip local adb device check for remote Appium servers - #541

Open
chinmayajha wants to merge 3 commits into
mozarkai:mainfrom
chinmayajha:fix/preflight-remote-appium-host
Open

chinmayajha wants to merge 3 commits into
mozarkai:mainfrom
chinmayajha:fix/preflight-remote-appium-host

Conversation

@chinmayajha

@chinmayajha chinmayajha commented Sep 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • The optics execute preflight had a mismatch which checked for local adb + at least 1 device even when remote appium hub URL was being used.
  • Added _is_local_host to detect whether the Appium URL resolves to this machine (loopback), and only run the local adb device check in that case.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Documentation preview

Updated automatically when the docs build succeeds; removed when the PR is closed.

@chinmayajha
chinmayajha force-pushed the fix/preflight-remote-appium-host branch from 32fe390 to fcb9d78 Compare September 9, 2026 06:53
The Android preflight in `optics execute` always ran `adb devices` on
the local machine, even when the configured Appium `url` pointed at a
remote server or device hub with its own devices attached. That made
the check unconditionally fail with "No Android device/emulator
attached" for any non-local Appium setup, regardless of the remote
server's real state.

Add `_is_local_host` to gate the adb/device check on the Appium URL's
host actually being loopback; a remote server now gets the TCP
reachability probe only, same as iOS.
@chinmayajha
chinmayajha force-pushed the fix/preflight-remote-appium-host branch from fcb9d78 to 18a4a52 Compare September 9, 2026 06:54
@malto101

malto101 commented Sep 9, 2026

Copy link
Copy Markdown
Member

Wouldn't it be better to just not have local adb runs in the whole repo?, we could you APPIUM/selenium remote shell execution to help us with adb discovery?

…appium-host

# Conflicts:
#	optics_framework/helper/execute.py
The execute preflight gate already honours OPTICS_SKIP_PREFLIGHT=1 as a
blanket escape hatch, but none of the four abort panels said so — the flag
was only documented on the CLI usage page. A user pointing a project at a
remote or cloud-hosted device hits "No Android device/emulator attached"
(or any of the other three) and has no in-context pointer to the one flag
that would let the run proceed, since a hub-hosted phone will never show up
in local `adb devices`.

Append the hint in _abort_preflight rather than at each call site: the env
var gates the whole gate uniformly, so every panel — present and future —
should carry identical wording without relying on the next author to
remember it.

Covers all four panels: Appium server unreachable, adb missing, no Android
device attached, and Selenium/WebDriver server unreachable.
@sonarqubecloud

Copy link
Copy Markdown

thakur-patel
thakur-patel previously approved these changes Nov 25, 2026

@thakur-patel thakur-patel 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.

Product review: approved. I've reviewed the intent and use case of this change, and it makes sense from a user and product point of view. This covers product intent and use case only. I haven't reviewed the implementation, so please rely on the code reviewers for that.

@thakur-patel
thakur-patel dismissed their stale review November 25, 2026 10:18

Approval withdrawn: posted by mistake. This PR is outside the product review scope.

This branch has not been deployed

No deployments
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.

3 participants