feat: add skipAppOverride service option#49
Open
Bhargavi-BS wants to merge 1 commit into
Open
Conversation
Port of webdriverio/webdriverio#15373 to the standalone repo. With skipAppOverride: true the service classifies the session as App Automate even when no app option is set, skips the app upload, and does not inject an appium:app capability — the user supplies the app reference themselves. Conflicting app option is warned about and ignored; skipAppOverride: false with no app fails fast before any session starts. The option is stripped from bstack:options and never forwarded to the hub. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Port of webdriverio/webdriverio#15373 to the standalone repo.
What this adds
A
skipAppOverrideservice option for App Automate (Appium) runs.Today the service always manages the app: it uploads the file given in the
appoption and injects the resultingappium:appcapability. Some teams manage the app themselves (a pre-uploadedbs://hash supplied directly as a driver capability, or viaBROWSERSTACK_APP_ID) and don't want the service to upload or override it.With
skipAppOverride: true, the service:appoption is set.appium:appcapability — the user supplies the app reference themselves.Edge cases:
skipAppOverride: truewith anappoption → a conflict warning is logged and theappoption is ignored (not uploaded/injected); the run proceeds as App Automate.skipAppOverride: falsewith noapp→ the run fails fast with aSevereServiceErrorbefore any session starts (prevents a silent misconfiguration).The option is never forwarded to the hub in
bstack:options(added toNOT_ALLOWED_KEYS_IN_CAPS).Files changed
All in
packages/browserstack-service:src/types.ts— declare theskipAppOverride?: booleanoption (with JSDoc).src/config.ts— App Automate classification honors the option.src/service.ts— the worker-local_isAppAutomate()honors the option (no injected app cap required).src/util.ts— newvalidateSkipAppOverride()(warning + the three edge cases).src/launcher.ts— invoke the validator once inonPrepare; thefalse+no-app case surfaces asSevereServiceError.src/constants.ts— addskipAppOverrideto the capabilities strip-list.src/cli/modules/automateModule.ts— session name/status endpoint routing honors the option.tests/skipAppOverride.test.ts, plus updates toconfig.test.ts,service.test.ts,insights-handler.test.ts,tests/cli/modules/automateModule.test.ts..changeset/feat-skip-app-override.md—minorchangeset.Port notes (drift vs upstream)
The upstream PR was authored against
webdriverio/webdriverio@main, which has changes this repo hasn't synced yet. Two hunks were adapted rather than taken verbatim:src/config.ts— upstreammainguards theautomate/appAutomateclassification withisBrowserStackInfra(external-grid detection, a separate upstream change not present here). Only theskipAppOverrideclause was grafted onto this repo's current classification line.tests/service.test.ts— this repo'smaincarries an extrabeforeHook (CLI hook reporting)describe block at the end of the file; it is preserved, with the newskipAppOverridetests appended after it.tests/config.test.ts— the upstream testdoes not classify app_automate on an external grid even with skipAppOverride truewas dropped: it exercises theisBrowserStackInfraconstructor parameter, which doesn't exist here yet. It should come back whenever the external-grid classification change is synced.Verification
npx tsc --noEmit -p packages/browserstack-serviceclean (afternpm run generate).packages/browserstack-service: 1024 passed / 0 failed (basemainis 1004 green; the delta is the ported tests).skipAppOverride: truewith the app supplied via anappium:appcap → App Automate session created, one-time warning, no upload;true+ anappoption → conflict warning, option ignored, no upload;falsewith no app → fails fast before any session starts.Backport for the
v8branch: #50 (ported from webdriverio/webdriverio#15374).🤖 Generated with Claude Code