Skip to content

Commit

Permalink
Merge branch 'master' into DOP-3911
Browse files Browse the repository at this point in the history
  • Loading branch information
branberry authored Sep 7, 2023
2 parents 15a3642 + a7642af commit 7cad533
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ RUN cd ./modules/oas-page-builder \
# where repo work will happen
FROM ubuntu:20.04
ARG WORK_DIRECTORY=/home/docsworker-xlarge
ARG SNOOTY_PARSER_VERSION=0.14.6
ARG SNOOTY_FRONTEND_VERSION=0.14.13
ARG SNOOTY_PARSER_VERSION=0.14.8
ARG SNOOTY_FRONTEND_VERSION=0.14.14
ARG MUT_VERSION=0.10.3
ARG REDOC_CLI_VERSION=1.2.2
ARG NPM_BASE_64_AUTH
Expand Down
16 changes: 13 additions & 3 deletions api/controllers/v1/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,22 @@ function prepProgressMessage(
jobId: string,
jobTitle: string,
status: string,
errorReason: string
errorReason: string,
jobType?: string
): string {
const msg = `Your Job (<${jobUrl}${jobId}|${jobTitle}>) `;
const env = c.get<string>('env');
switch (status) {
case 'inQueue':
return msg + 'has successfully been added to the ' + env + ' queue.';
// Encourage writers to update to new webhook on githubPush jobs
let inQueueMsg = msg;
if (jobType == 'githubPush') {
const webhookWikiUrl =
'https://wiki.corp.mongodb.com/display/DE/How-To%3A+Use+Snooty%27s+Autobuilder+to+Build+Your+Content';
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.`;
inQueueMsg = updatePlease + '\n\n' + msg;
}
return inQueueMsg + 'has successfully been added to the ' + env + ' queue.';
case 'inProgress':
return msg + 'is now being processed.';
case 'completed':
Expand Down Expand Up @@ -213,7 +222,8 @@ async function NotifyBuildProgress(jobId: string): Promise<any> {
jobId,
jobTitle,
fullDocument.status as string,
fullDocument?.error?.reason || ''
fullDocument?.error?.reason || '',
fullDocument?.payload.jobType
),
entitlement['slack_user_id']
);
Expand Down
2 changes: 1 addition & 1 deletion src/job/jobHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export abstract class JobHandler {
// completed after the Gatsby Cloud build via the SnootyBuildComplete lambda.
const { _id: jobId, user } = this.currJob;
const gatsbyCloudSiteId = await this._repoEntitlementsRepo.getGatsbySiteIdByGithubUsername(user);
if (gatsbyCloudSiteId && this.currJob.payload.jobType === 'githubPush') {
if (this.currJob.payload.isNextGen && gatsbyCloudSiteId && this.currJob.payload.jobType === 'githubPush') {
this.logger.info(
jobId,
`User ${user} has a Gatsby Cloud site. The Autobuilder will not mark the build as completed right now.`
Expand Down

0 comments on commit 7cad533

Please sign in to comment.