Change Binary Download Distribution#93
Merged
yashdsaraf merged 5 commits intoversion_1_1_6from Jun 17, 2025
Merged
Conversation
There was a problem hiding this comment.
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
keytoLocalBinaryconstructor 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
booleaninstead of the wrapperBooleanforfallbackEnabledto avoid unnecessary boxing and potentialnullvalues.
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
fetchSourceUrlretry 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 {
07souravkunda
previously approved these changes
Jun 10, 2025
Merged
yashdsaraf
previously approved these changes
Jun 17, 2025
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.
No description provided.