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

Create new npm run pr task #1632

Merged
merged 4 commits into from
Feb 13, 2019
Merged

Create new npm run pr task #1632

merged 4 commits into from
Feb 13, 2019

Conversation

bsclifton
Copy link
Member

@bsclifton bsclifton commented Feb 9, 2019

Description

Only works for brave-core (Desktop). New script will create branches / PRs as needed to uplift to a given channel.

Also allows assignment of reviewers / assignees / milestone / labels

Fixes brave/devops#672

Example command line usage(s):

NOTE: you can either pass the token in as an environment variable OR put it in your ~/.npmrc. Either way would work. The NAME of the variable needs to be: BRAVE_GITHUB_TOKEN

  1. Create 4 PRs, based on your local branch (which would be branched from master). One for master (nightly), dev, beta, and finally release. Will set the reviewers as @bbondy and @petemill and the assignee as @bsclifton
    ./script/pr.py --reviewers=bbondy,petemill --owners=bsclifton --uplift-to=release

  2. Same as above, but don't actually submit the PRs (dry run):
    ./script/pr.py --reviewers=bbondy,petemill --owners=bsclifton --dry-run --uplift-to=release

  3. Submit 3 PRs. Use case would be that master already has a PR up and now it's time to start the uplift process:
    ./script/pr.py --reviewers=bbondy,petemill --owners=bsclifton --uplift-to=release --start-from=dev

  4. Get more verbose output (otherwise, same as number 3 above):
    ./script/pr.py --reviewers=bbondy,petemill --owners=bsclifton --uplift-to=release --start-from=dev --verbose

  5. Show all possible parameters (with description):
    ./script/pr.py --help

  6. Uplift an already existing pull request (Create new npm run pr task #1632) to dev.
    ./script/pr.py --reviewers=bbondy,petemill,NejcZdovc --owners=bsclifton --uplift-to=dev --labels=ui --dry-run --uplift-using-pr=1632

Example use-cases

  • You finish work on a feature/bug fix/patch. You know it needs to go to BETA. You can use this and specify --uplift-to=beta. A PR will then be created against master, dev, and beta.
  • You submitted a PR to master and it was approved/merged. You now need to merge this to RELEASE. You can specify ----uplift-using-pr=12345 (putting the actual PR number), along with --uplift-to=release and --start-from=dev (since master was already approved). A PR would then be created against dev, beta, and release.

Notes

  • This PR was created using the task! 😎
  • The "version" used by master is determined by looking at the package.json in brave-browser. For example, 0.62.0 will map itself to the milestone 0.62.x
  • You can create a personal token via GitHub on your settings page
  • You can get verbose output with --verbose
  • You can do a "dry run" with --dry-run
  • Reviewers + Owner (assignee) are optional. If provided, they are a comma separated list.
  • You can override the title using --title
  • You can provide labels you'd like to apply to each pr using --labels (comma separated list)

@bsclifton bsclifton self-assigned this Feb 9, 2019
@bsclifton bsclifton added this to the 0.62.x - Nightly milestone Feb 9, 2019
@bsclifton bsclifton force-pushed the npm-run-pr branch 2 times, most recently from 3eb35cc to 6214659 Compare February 11, 2019 18:16
@NejcZdovc
Copy link
Contributor

@bsclifton this is awesome. Maybe we could add support for labels as well?

@bsclifton
Copy link
Member Author

@NejcZdovc already in the works! Stay tuned 😄 😄 😄

@bsclifton
Copy link
Member Author

bsclifton commented Feb 12, 2019

Lots more progress made here - would be good to have some folks try it 😄 I think it might be "done" enough for a first revision

edit: @NejcZdovc DONE!

Only works for brave-core (Desktop). New script will create branches / PRs as needed to uplift to a given channel.
Also allows assignment of reviewers / assignees (including login validation)

Fixes brave/devops#672
Also, each PR created is opened in the default browser
This does the following:
- fetches the PR in question
- creates a local branch with the content of the PR
- does the rest of the process normally

Handy since you don't need to actually have the code locally in order to uplift
Copy link
Collaborator

@mihaiplesa mihaiplesa left a comment

Choose a reason for hiding this comment

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

yes!

bsclifton added a commit to brave/brave-browser that referenced this pull request Feb 13, 2019
@bsclifton bsclifton merged commit 5d0a465 into master Feb 13, 2019
@bsclifton bsclifton deleted the npm-run-pr branch February 13, 2019 18:16
@bsclifton bsclifton restored the npm-run-pr branch February 13, 2019 18:21
@bsclifton bsclifton deleted the npm-run-pr branch February 13, 2019 18:23
bsclifton added a commit that referenced this pull request Feb 13, 2019
- version check is no longer done; this caused problems because it's comparing brave-browser against brave-core
- PR uplift wasn't using the SHA- which means it didn't find any commits when doing compare (ex: it did master against master)
bsclifton added a commit that referenced this pull request Feb 13, 2019
- version check is no longer done; this caused problems because it's comparing brave-browser against brave-core
- PR uplift wasn't using the SHA- which means it didn't find any commits when doing compare (ex: it did master against master)
bsclifton added a commit to brave/brave-browser that referenced this pull request Feb 14, 2019
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