Skip to content

Commit

Permalink
attempt-backport: check existing labels before updating
Browse files Browse the repository at this point in the history
  • Loading branch information
Fishrock123 committed Dec 14, 2016
1 parent 831e569 commit e25c998
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/node-repo.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ function stringsInCommon (arr1, arr2) {

exports.getBotPrLabels = getBotPrLabels
exports.removeLabelFromPR = removeLabelFromPR
exports.updatePrWithLabels = updatePrWithLabels
exports.fetchExistingThenUpdatePr = fetchExistingThenUpdatePr
exports.resolveLabelsThenUpdatePr = deferredResolveLabelsThenUpdatePr

// exposed for testability
Expand Down
6 changes: 3 additions & 3 deletions scripts/attempt-backport.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const child_process = require('child_process')
const debug = require('debug')('attempt-backport')
const request = require('request')
const node_repo = require('../lib/node-repo')
const updatePrWithLabels = node_repo.updatePrWithLabels
const fetchExistingThenUpdatePr = node_repo.fetchExistingThenUpdatePr
const removeLabelFromPR = node_repo.removeLabelFromPR
const getBotPrLabels = node_repo.getBotPrLabels

Expand Down Expand Up @@ -132,7 +132,7 @@ function attemptBackport (options, version, isLTS, cb) {
options.logger.debug(`backport to ${version} failed`)

if (!isLTS) {
updatePrWithLabels(options, [`dont-land-on-v${version}.x`])
fetchExistingThenUpdatePr(options, [`dont-land-on-v${version}.x`])
} else {
getBotPrLabels(options, (err, ourLabels) => {
if (err) {
Expand Down Expand Up @@ -223,7 +223,7 @@ function attemptBackport (options, version, isLTS, cb) {
const cp = wrapCP('git', ['am'], { stdio: 'pipe' }, function done () {
// Success!
if (isLTS) {
updatePrWithLabels(options, [`lts-watch-v${version}.x`])
fetchExistingThenUpdatePr(options, [`lts-watch-v${version}.x`])
} else {
// TODO(Fishrock123): Re-enable this, but do a check first
// to make sure the label was set by the bot only.
Expand Down

0 comments on commit e25c998

Please sign in to comment.