@@ -67,7 +67,7 @@ function processNextBackport() {
67
67
68
68
function queueAttemptBackport ( options , version , isLTS ) {
69
69
queue . push ( function ( ) {
70
- debug ( `processing a new backport to v${ version } ` )
70
+ options . logger . debug ( `processing a new backport to v${ version } ` )
71
71
attemptBackport ( options , version , isLTS , processNextBackport )
72
72
} )
73
73
}
@@ -121,7 +121,7 @@ function attemptBackport(options, version, isLTS, cb) {
121
121
if ( ! cb ) return
122
122
const _cb = cb
123
123
setImmediate ( ( ) => {
124
- debug ( `backport to ${ version } failed` )
124
+ options . logger . debug ( `backport to ${ version } failed` )
125
125
if ( ! isLTS ) updatePrWithLabels ( options , [ `dont-land-on-v${ version } .x` ] )
126
126
setImmediate ( ( ) => {
127
127
inProgress = false
@@ -134,7 +134,7 @@ function attemptBackport(options, version, isLTS, cb) {
134
134
function gitAmAbort ( ) {
135
135
// TODO(Fishrock123): this should probably just merge into wrapCP
136
136
let exited = false
137
- debug ( `aborting any previous backport attempt...` )
137
+ options . logger . debug ( `aborting any previous backport attempt...` )
138
138
139
139
const cp = child_process . spawn ( 'git' , [ 'am' , '--abort' ] , { cwd : global . _node_repo_dir } )
140
140
const argsString = 'git am --abort'
@@ -154,22 +154,22 @@ function attemptBackport(options, version, isLTS, cb) {
154
154
}
155
155
156
156
function gitRemoteUpdate ( ) {
157
- debug ( `updating git remotes...` )
157
+ options . logger . debug ( `updating git remotes...` )
158
158
wrapCP ( 'git' , [ 'remote' , 'update' , '-p' ] , gitCheckout )
159
159
}
160
160
161
161
function gitCheckout ( ) {
162
- debug ( `checking out upstream/v${ version } .x-staging...` )
162
+ options . logger . debug ( `checking out upstream/v${ version } .x-staging...` )
163
163
wrapCP ( 'git' , [ 'checkout' , `upstream/v${ version } .x-staging` ] , gitReset )
164
164
}
165
165
166
166
function gitReset ( ) {
167
- debug ( `resetting upstream/v${ version } .x-staging...` )
167
+ options . logger . debug ( `resetting upstream/v${ version } .x-staging...` )
168
168
wrapCP ( 'git' , [ 'reset' , `upstream/v${ version } .x-staging` , '--hard' ] , fetchDiff )
169
169
}
170
170
171
171
function fetchDiff ( ) {
172
- debug ( `fetching diff from pr ${ options . prId } ...` )
172
+ options . logger . debug ( `fetching diff from pr ${ options . prId } ...` )
173
173
174
174
const url = `https://patch-diff.githubusercontent.com/raw/${ options . owner } /${ options . repo } /pull/${ options . prId } .patch`
175
175
@@ -190,13 +190,13 @@ function attemptBackport(options, version, isLTS, cb) {
190
190
}
191
191
192
192
function gitAttemptBackport ( req ) {
193
- debug ( `attempting a backport to v${ version } ...` )
193
+ options . logger . debug ( `attempting a backport to v${ version } ...` )
194
194
const cp = wrapCP ( 'git' , [ 'am' ] , { stdio : 'pipe' } , function done ( ) {
195
195
// Success!
196
196
if ( isLTS ) updatePrWithLabels ( options , [ `lts-watch-v${ version } .x` ] )
197
197
198
198
setImmediate ( ( ) => {
199
- debug ( `backport to v${ version } successful` )
199
+ options . logger . debug ( `backport to v${ version } successful` )
200
200
inProgress = false
201
201
cb ( )
202
202
} )
0 commit comments