Skip to content

Commit

Permalink
Add new npm run pr task, used for automating the creation of PRs (i…
Browse files Browse the repository at this point in the history
…ncluding uplifts)

Accompanies brave/brave-core#1632

Helps to fix brave/devops#672
  • Loading branch information
bsclifton committed Feb 13, 2019
1 parent 64baf63 commit f91e871
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
15 changes: 15 additions & 0 deletions lib/pr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const config = require('../lib/config')
const util = require('../lib/util')

const pr = (options) => {
config.update(options)

const cmdOptions = config.defaultOptions
cmdOptions.cwd = config.projects['brave-core'].dir
// use system python because depot tools fails on upload with TLS error
cmdOptions.env = config.addPathToEnv(cmdOptions.env, process.env.PATH, true)
util.run('python', ['script/pr.py', '-v'], cmdOptions)
}

module.exports = pr

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"chromium_rebase_l10n": "node ./scripts/commands.js chromium_rebase_l10n",
"lint": "node ./scripts/commands.js lint",
"test": "node ./scripts/commands.js test",
"test-security": "npm run audit_deps && node ./scripts/commands.js start --enable_brave_update --network_log --user_data_dir_name=brave-network-test"
"test-security": "npm run audit_deps && node ./scripts/commands.js start --enable_brave_update --network_log --user_data_dir_name=brave-network-test",
"pr": "node ./scripts/commands.js pr"
},
"config": {
"projects": {
Expand Down
8 changes: 8 additions & 0 deletions scripts/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const chromiumRebaseL10n = require('../lib/chromiumRebaseL10n')
const createDist = require('../lib/createDist')
const upload = require('../lib/upload')
const test = require('../lib/test')
const pr = require('../lib/pr')

const parsedArgs = program.parseOptions(process.argv)

Expand Down Expand Up @@ -132,5 +133,12 @@ program
.command('lint')
.action(util.lint)

program
.command('pr')
.option('--reviewer <reviewer_list>', 'comma separated list of reviewers')
.option('--base <branch>', 'the branch name for the release channel')
.option('--uplift-to <channel>', 'starting at nightly (master), how far back to uplift the changes')
.action(pr)

program
.parse(process.argv)
2 changes: 1 addition & 1 deletion vendor/depot_tools
Submodule depot_tools updated from eb2767 to a1fbdf

0 comments on commit f91e871

Please sign in to comment.