@@ -184,7 +184,13 @@ async function prepSummaryMessage(
184184 return msg . replace ( / \. { 2 , } / g, '' ) ;
185185}
186186
187- function prepProgressMessage ( jobUrl : string , jobId : string , jobTitle : string , status : string ) : string {
187+ function prepProgressMessage (
188+ jobUrl : string ,
189+ jobId : string ,
190+ jobTitle : string ,
191+ status : string ,
192+ errorReason : string
193+ ) : string {
188194 const msg = `Your Job (<${ jobUrl } ${ jobId } |${ jobTitle } >) ` ;
189195 const env = c . get < string > ( 'env' ) ;
190196 switch ( status ) {
@@ -195,7 +201,13 @@ function prepProgressMessage(jobUrl: string, jobId: string, jobTitle: string, st
195201 case 'completed' :
196202 return msg + 'has successfully completed.' ;
197203 case 'failed' :
198- return msg + 'has failed and will not be placed back in the ' + env + ' queue.' ;
204+ let failedMessage = msg + 'has failed and will not be placed back in the ' + env + ' queue.' ;
205+ if ( errorReason . match ( / R e p o s i t o r y n o t f o u n d / ) ) {
206+ const autobuilderWikiUrl =
207+ 'https://wiki.corp.mongodb.com/pages/viewpage.action?spaceKey=DE&title=How-To%3A+Use+Snooty%27s+Autobuilder+to+Build+Your+Content#:~:text=origin%20master%3Astage%2Dmaster-,For%20Private%20repositories,-%3A%20in%20addition%20to' ;
208+ failedMessage += `\n:point_right: Hint: If your repo is private, have you <${ autobuilderWikiUrl } |added the docs-builder-bot as a collaborator?>` ;
209+ }
210+ return failedMessage ;
199211 default :
200212 return msg + 'has been updated to an unsupported status.' ;
201213 }
@@ -219,7 +231,13 @@ async function NotifyBuildProgress(jobId: string): Promise<any> {
219231 return ;
220232 }
221233 const resp = await slackConnector . sendMessage (
222- prepProgressMessage ( c . get ( 'dashboardUrl' ) , jobId , jobTitle , fullDocument . status as string ) ,
234+ prepProgressMessage (
235+ c . get ( 'dashboardUrl' ) ,
236+ jobId ,
237+ jobTitle ,
238+ fullDocument . status as string ,
239+ fullDocument ?. error ?. reason || ''
240+ ) ,
223241 entitlement [ 'slack_user_id' ]
224242 ) ;
225243 return {
0 commit comments