-
Notifications
You must be signed in to change notification settings - Fork 34
Change Binary Download Distribution #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
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 replaces the hardcoded binary download URL with a dynamic endpoint fetched from an API, adds an authentication key, and implements a retry/fallback mechanism on download failures.
- Added
key
toLocalBinary
constructor and propagated it inLocal.java
- Introduced
fetchSourceUrl()
to retrieve download endpoints and wired it intodownloadBinary()
- Wrapped download logic in
downloadAndVerifyBinary()
with fallback and retry handling
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
File | Description |
---|---|
src/main/java/com/browserstack/local/LocalBinary.java | Added key field; implemented downloadAndVerifyBinary() , fetchSourceUrl() , and updated download logic to use dynamic sourceUrl |
src/main/java/com/browserstack/local/Local.java | Updated LocalBinary instantiation to pass the key from options |
Comments suppressed due to low confidence (4)
src/main/java/com/browserstack/local/LocalBinary.java:53
- String comparison with != checks reference equality, not content. Use
!path.isEmpty()
or!"".equals(path)
to test for an empty string.
if (path != "") {
src/main/java/com/browserstack/local/LocalBinary.java:31
- Use the primitive
boolean
instead of the wrapperBoolean
forfallbackEnabled
to avoid unnecessary boxing and potentialnull
values.
private Boolean fallbackEnabled = false;
src/main/java/com/browserstack/local/Local.java:58
- The constructor now requires a
key
. Validate thatoptions.get("key")
is present and non-null, and provide a clear error if it's missing.
lb = new LocalBinary(options.get("binarypath"), options.get("key"));
src/main/java/com/browserstack/local/LocalBinary.java:196
- The new
fetchSourceUrl
retry and fallback logic is complex and isn’t covered by existing tests. Add unit tests to verify both success and failure paths.
private void fetchSourceUrl() throws LocalException {
No description provided.