Skip to content
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

Implement a build bisect script #1833

Merged
merged 12 commits into from
Mar 15, 2019
Merged

Implement a build bisect script #1833

merged 12 commits into from
Mar 15, 2019

Conversation

bsclifton
Copy link
Member

@bsclifton bsclifton commented Mar 4, 2019

Description

Goal is to have a script that automates downloading/installing versions of browser for your platform

  • fetches all versions
  • will attempt to find good/bad for start
  • downloads binary from GitHub

WIP checklist

TODOs before it's ready:

  • need to get ALL releases (I believe it's only getting first page from GitHub API)
  • search is not specific enough (stops after first result is different than last)
  • need to implement install
  • need to implement execute
  • display all the commits for a given version (to help narrow search for what broke)
  • be able to provide a parameter for profile to use
  • documentation (edit: available at https://github.com/brave/brave-browser/wiki/Build-Bisect-Tool)
  • schedule a demo to folks (edit: scheduled for March 14th, 2019)

Reviewer notes

  • Currently requires a GitHub token. This would be defined in your .npmrc with an entry like BRAVE_GITHUB_TOKEN=<TOKEN-GOES-HERE>
  • Currently only implemented for macOS!
  • Close all instances of Brave before trying this!
  • Temporary directories are created for the profiles. No need to worry about having your data overwritten (unless you pass the --real-profile option!)
  • You can start the process by running the script (Python 2 required):
    python ./script/build-bisect.py
  • You can provide a GOOD or BAD version via the --good= and --bad= parameters
  • --verbose will show where in the binary search you are
  • Script will download and install versions for you, from the GitHub releases page (does not include drafts)
  • After downloading + installing, the browser will be launched so you can manually test the feature
  • After verifying problem happens/doesn't happen, you can close the browser and answer either y or n to the prompt
  • Search will continue until a definitive version is found

@bsclifton bsclifton self-assigned this Mar 4, 2019
@bsclifton bsclifton changed the title WIP: Implement a build bisect script Implement a build bisect script Mar 7, 2019
@bsclifton bsclifton marked this pull request as ready for review March 7, 2019 22:30
@bsclifton bsclifton changed the title Implement a build bisect script WIP: Implement a build bisect script Mar 11, 2019
@bsclifton bsclifton changed the title WIP: Implement a build bisect script Implement a build bisect script Mar 11, 2019
@bsclifton
Copy link
Member Author

Script will now find/print all commits unique to the release where issue was found:
image

@bsclifton bsclifton changed the title Implement a build bisect script WIP: Implement a build bisect script Mar 11, 2019
- fetches all versions
- will attempt to find good/bad for start
- search is not specific enough, but good enough for a rev1
- need to implement install / execute
…d/bad versions, fixed linting errors

- `--fresh-profile` is intended to move your existing profile out of the way
- `--use-profile` is intended to allow for downloading/unzipping a profile to use for all tests
- if good version is not found, it'll use the first version match for "major.minor." pattern
- if bad version is not found, it'll use the last version match for "major.minor." pattern
@bsclifton
Copy link
Member Author

bsclifton commented Mar 14, 2019

Feature requests

I'll make sure to create an issue for these 😄 These were items that came from folks during our company brown-bag presentation of the tool

  • Can the tool pre-download all (or some) of the releases?
  • Can the tool cache the releases? (perhaps it can check SHA in GitHub against local disk, for example)
  • For use-cases like rewards, consider using staging environment by default (to prevent creating lots of wallets)
  • Tie this into an issue
    • potentially create an issue; prompt user for title/desc and then include the identified release / commits
    • if issue already exists, add a comment after tool is ran to provide the release / commits where problem was identified
  • Be able to pass Chromium feature flags in!
  • New non-interactive mode flag: Spit out all versions, organized by release channels (ex: --show-versions)
  • Be able to use a LOCAL profile also, instead of specifying a ZIP
  • Consider tying this into the Chromium bisect tool (for finding bugs in Chromium)

Refactoring notes

Areas where the code could be cleaner

  • token is used, but is honestly not needed
  • use util methods where possible
  • create an npm command for this!

@bsclifton bsclifton changed the title WIP: Implement a build bisect script Implement a build bisect script Mar 15, 2019
@bsclifton bsclifton requested a review from mbacchi March 15, 2019 18:56
@bsclifton
Copy link
Member Author

Ready for review - needs token for use, but otherwise is documented and ready to go 😄

Copy link
Contributor

@mbacchi mbacchi left a comment

Choose a reason for hiding this comment

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

love it!

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.

2 participants