Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

Commit ac8a104

Browse files
authored
DOP-3977: encourage writers to switch webhooks 🥕 (#902)
* DOP-3977: encourage writers to switch webhooks 🥕 * more newlines * revert v2 changes
1 parent 3d7fa56 commit ac8a104

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

‎api/controllers/v1/jobs.ts‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,22 @@ function prepProgressMessage(
166166
jobId: string,
167167
jobTitle: string,
168168
status: string,
169-
errorReason: string
169+
errorReason: string,
170+
jobType?: string
170171
): string {
171172
const msg = `Your Job (<${jobUrl}${jobId}|${jobTitle}>) `;
172173
const env = c.get<string>('env');
173174
switch (status) {
174175
case 'inQueue':
175-
return msg + 'has successfully been added to the ' + env + ' queue.';
176+
// Encourage writers to update to new webhook on githubPush jobs
177+
let inQueueMsg = msg;
178+
if (jobType == 'githubPush') {
179+
const webhookWikiUrl =
180+
'https://wiki.corp.mongodb.com/display/DE/How-To%3A+Use+Snooty%27s+Autobuilder+to+Build+Your+Content';
181+
const updatePlease = `:exclamation: You used the old webhook for this build. <${webhookWikiUrl}|Update to the new webhook> in your fork of this repo to save 90s per build.`;
182+
inQueueMsg = updatePlease + '\n\n' + msg;
183+
}
184+
return inQueueMsg + 'has successfully been added to the ' + env + ' queue.';
176185
case 'inProgress':
177186
return msg + 'is now being processed.';
178187
case 'completed':
@@ -213,7 +222,8 @@ async function NotifyBuildProgress(jobId: string): Promise<any> {
213222
jobId,
214223
jobTitle,
215224
fullDocument.status as string,
216-
fullDocument?.error?.reason || ''
225+
fullDocument?.error?.reason || '',
226+
fullDocument?.payload.jobType
217227
),
218228
entitlement['slack_user_id']
219229
);

0 commit comments

Comments
 (0)