@@ -162,7 +162,7 @@ async function NotifyBuildSummary(jobId: string): Promise<any> {
162
162
const githubToken = c . get < string > ( 'githubSecret' ) ;
163
163
164
164
const jobRepository = new JobRepository ( db , c , consoleLogger ) ;
165
- // TODO: Make fullDocument be of type Job, validate existence
165
+
166
166
const fullDocument = await jobRepository . getJobById ( jobId ) ;
167
167
if ( ! fullDocument ) {
168
168
consoleLogger . error ( 'Cannot find job entry in db' , '' ) ;
@@ -175,13 +175,17 @@ async function NotifyBuildSummary(jobId: string): Promise<any> {
175
175
176
176
// Github comment
177
177
await githubConnector . getParentPRs ( fullDocument . payload ) . then ( function ( results ) {
178
- for ( const result of results ) {
179
- const commentid = githubConnector . getPullRequestCommentId ( fullDocument . payload , result ) . then ( function ( id ) {
178
+ for ( const pr of results ) {
179
+ githubConnector . getPullRequestCommentId ( fullDocument . payload , pr ) . then ( function ( id ) {
180
180
console . log ( `The comment ID is: ${ id } ` ) ;
181
181
if ( id != undefined ) {
182
- githubConnector . updateComment ( fullDocument . payload , id , '* next log link' ) ;
182
+ prepGithubComment ( fullDocument , c . get < string > ( 'dashboardUrl' ) , true ) . then ( function ( ghmessage ) {
183
+ githubConnector . updateComment ( fullDocument . payload , id , ghmessage ) ;
184
+ } ) ;
183
185
} else {
184
- githubConnector . postComment ( fullDocument . payload , result , 'This is a new comment ooh aah' ) ;
186
+ prepGithubComment ( fullDocument , c . get < string > ( 'dashboardUrl' ) , false ) . then ( function ( ghmessage ) {
187
+ githubConnector . postComment ( fullDocument . payload , pr , ghmessage ) ;
188
+ } ) ;
185
189
}
186
190
} ) ;
187
191
}
@@ -237,7 +241,7 @@ async function prepSummaryMessage(
237
241
failed = false
238
242
) : Promise < string > {
239
243
const urls = extractUrlFromMessage ( fullDocument ) ;
240
- let mms_urls = [ '' , '' ] ;
244
+ let mms_urls = [ null , null ] ;
241
245
// mms-docs needs special handling as it builds two sites (cloudmanager & ops manager)
242
246
// so we need to extract both URLs
243
247
if ( repoName === 'mms-docs' ) {
@@ -301,10 +305,10 @@ async function NotifyBuildProgress(jobId: string): Promise<any> {
301
305
const jobRepository = new JobRepository ( db , c , consoleLogger ) ;
302
306
// TODO: Make fullDocument be of type Job, validate existence
303
307
const fullDocument = await jobRepository . getJobById ( jobId ) ;
304
- if ( ! fullDocument ) {
305
- consoleLogger . error ( 'Cannot find job in db.' , '' ) ;
306
- return ;
307
- }
308
+ // if (!fullDocument) {
309
+ // consoleLogger.error('Cannot find job in db.', '');
310
+ // return;
311
+ // }
308
312
const jobTitle = fullDocument . title ;
309
313
const username = fullDocument . user ;
310
314
const repoEntitlementRepository = new RepoEntitlementsRepository ( db , c , consoleLogger ) ;
@@ -356,10 +360,10 @@ async function SubmitArchiveJob(jobId: string) {
356
360
branches : new BranchRepository ( db , c , consoleLogger ) ,
357
361
} ;
358
362
const job = await models . jobs . getJobById ( jobId ) ;
359
- if ( ! job ) {
360
- consoleLogger . error ( 'Cannot find job in db' , JSON . stringify ( { jobId } ) ) ;
361
- return ;
362
- }
363
+ // if (!job) {
364
+ // consoleLogger.error('Cannot find job in db', JSON.stringify({ jobId }));
365
+ // return;
366
+ // }
363
367
const repo = await models . branches . getRepo ( job . payload . repoName ) ;
364
368
365
369
/* NOTE
0 commit comments