@@ -79,10 +79,6 @@ export class GitHubGlue {
7979 const [ , short , completedAt ] = match ;
8080 const url = `https://github.com/${ baseOwner } /${ this . repo } /commit/${ gitGitCommit } ` ;
8181
82- if ( process . env . GITGITGADGET_DRY_RUN ) {
83- console . log ( `Would annotate ${ originalCommit } :\n${ gitGitCommit } as ${ short } at ${ completedAt } \n${ url } ` ) ;
84- return - 1 ; // debug mode does not actually do anything
85- }
8682 await this . ensureAuthenticated ( repositoryOwner ) ;
8783 const checks = await this . client . rest . checks . create ( {
8884 completed_at : completedAt ,
@@ -181,10 +177,6 @@ export class GitHubGlue {
181177 * @returns the comment ID and the URL to the comment
182178 */
183179 public async addPRComment ( pullRequest : pullRequestKeyInfo , comment : string ) : Promise < { id : number ; url : string } > {
184- if ( process . env . GITGITGADGET_DRY_RUN ) {
185- console . log ( `Would add comment to ${ JSON . stringify ( pullRequest ) } :\n${ comment } ` ) ;
186- return { id : - 1 , url : "" } ; // debug mode does not actually do anything
187- }
188180 const prKey = getPullRequestKey ( pullRequest ) ;
189181
190182 await this . ensureAuthenticated ( prKey . owner ) ;
@@ -216,10 +208,6 @@ export class GitHubGlue {
216208 comment : string ,
217209 line ?: number ,
218210 ) : Promise < { id : number ; url : string } > {
219- if ( process . env . GITGITGADGET_DRY_RUN ) {
220- console . log ( `Would add comment to ${ JSON . stringify ( pullRequest ) } , commit ${ commit } :\n${ comment } ` ) ;
221- return { id : - 1 , url : "" } ; // debug mode does not actually do anything
222- }
223211 const prKey = getPullRequestKey ( pullRequest ) ;
224212
225213 await this . ensureAuthenticated ( prKey . owner ) ;
@@ -253,10 +241,6 @@ export class GitHubGlue {
253241 id : number ,
254242 comment : string ,
255243 ) : Promise < { id : number ; url : string } > {
256- if ( process . env . GITGITGADGET_DRY_RUN ) {
257- console . log ( `Would add reply to ${ JSON . stringify ( pullRequest ) } , id ${ id } :\n${ comment } ` ) ;
258- return { id : - 1 , url : "" } ; // debug mode does not actually do anything
259- }
260244 const prKey = getPullRequestKey ( pullRequest ) ;
261245
262246 await this . ensureAuthenticated ( prKey . owner ) ;
@@ -281,10 +265,6 @@ export class GitHubGlue {
281265 * @returns the PR number
282266 */
283267 public async updatePR ( prKey : pullRequestKey , body ?: string , title ?: string ) : Promise < number > {
284- if ( process . env . GITGITGADGET_DRY_RUN ) {
285- console . log ( `Would add update ${ JSON . stringify ( prKey ) } :\ntitle: ${ title } \nbody: ${ body } ` ) ;
286- return prKey . pull_number ; // debug mode does not actually do anything
287- }
288268 await this . ensureAuthenticated ( prKey . owner ) ;
289269
290270 const result = await this . client . rest . pulls . update ( {
@@ -297,10 +277,6 @@ export class GitHubGlue {
297277 }
298278
299279 public async addPRLabels ( pullRequest : pullRequestKeyInfo , labels : string [ ] ) : Promise < string [ ] > {
300- if ( process . env . GITGITGADGET_DRY_RUN ) {
301- console . log ( `Would add labels to ${ JSON . stringify ( pullRequest ) } :\n${ labels . join ( ", " ) } ` ) ;
302- return labels ; // debug mode does not actually do anything
303- }
304280 const prKey = getPullRequestKey ( pullRequest ) ;
305281
306282 await this . ensureAuthenticated ( prKey . owner ) ;
@@ -314,10 +290,6 @@ export class GitHubGlue {
314290 }
315291
316292 public async closePR ( pullRequest : pullRequestKeyInfo , viaMergeCommit : string ) : Promise < number > {
317- if ( process . env . GITGITGADGET_DRY_RUN ) {
318- console . log ( `Would add close ${ JSON . stringify ( pullRequest ) } :\n${ viaMergeCommit } ` ) ;
319- return - 1 ; // debug mode does not actually do anything
320- }
321293 const prKey = getPullRequestKey ( pullRequest ) ;
322294
323295 await this . ensureAuthenticated ( prKey . owner ) ;
@@ -482,16 +454,6 @@ export class GitHubGlue {
482454 * @param login the GitHub login
483455 */
484456 public async getGitHubUserInfo ( login : string ) : Promise < IGitHubUser > {
485- if ( process . env . GITGITGADGET_DRY_RUN ) {
486- if ( login === "dscho" )
487- return {
488- email : "dscho@me.com" ,
489- login,
490- name : "Ohai!" ,
491- type : "user" ,
492- } ;
493- throw new Error ( `Cannot mock getByUsername: ${ login } ` ) ;
494- }
495457 // required to get email
496458 await this . ensureAuthenticated ( this . authenticated || this . owner ) ;
497459
0 commit comments