Skip to content

Commit e25c998

Browse files
committed
attempt-backport: check existing labels before updating
1 parent 831e569 commit e25c998

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/node-repo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ function stringsInCommon (arr1, arr2) {
180180

181181
exports.getBotPrLabels = getBotPrLabels
182182
exports.removeLabelFromPR = removeLabelFromPR
183-
exports.updatePrWithLabels = updatePrWithLabels
183+
exports.fetchExistingThenUpdatePr = fetchExistingThenUpdatePr
184184
exports.resolveLabelsThenUpdatePr = deferredResolveLabelsThenUpdatePr
185185

186186
// exposed for testability

scripts/attempt-backport.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const child_process = require('child_process')
44
const debug = require('debug')('attempt-backport')
55
const request = require('request')
66
const node_repo = require('../lib/node-repo')
7-
const updatePrWithLabels = node_repo.updatePrWithLabels
7+
const fetchExistingThenUpdatePr = node_repo.fetchExistingThenUpdatePr
88
const removeLabelFromPR = node_repo.removeLabelFromPR
99
const getBotPrLabels = node_repo.getBotPrLabels
1010

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

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

0 commit comments

Comments
 (0)