diff --git a/src/job/jobHandler.ts b/src/job/jobHandler.ts index f0f8743cb..5b5a7ae3a 100644 --- a/src/job/jobHandler.ts +++ b/src/job/jobHandler.ts @@ -153,6 +153,7 @@ export abstract class JobHandler { // TODO: Can empty string check be removed? if (pathPrefix || pathPrefix === '') { this.currJob.payload.pathPrefix = pathPrefix; + //sets mutPrefix to the full pathPrefix unless server user is in the path (I believe this only happens in a subset of cases when docs-worker-xlarge is the server-user) const mutPrefix = pathPrefix.split(`/${server_user}`)[0]; this.currJob.payload.mutPrefix = mutPrefix; } diff --git a/src/job/productionJobHandler.ts b/src/job/productionJobHandler.ts index 6190cc018..e1529b5c5 100644 --- a/src/job/productionJobHandler.ts +++ b/src/job/productionJobHandler.ts @@ -141,22 +141,15 @@ export class ProductionJobHandler extends JobHandler { } getPathPrefix(): string { - try { - if (this.currJob.payload.prefix && this.currJob.payload.prefix === '') { - return this.currJob.payload.urlSlug ?? ''; - } - if (this.currJob.payload.urlSlug) { - if (this.currJob.payload.urlSlug === '') { - return this.currJob.payload.prefix; - } else { - return `${this.currJob.payload.prefix}/${this.currJob.payload.urlSlug}`; - } - } - return this.currJob.payload.prefix; - } catch (error) { - this.logger.save(this.currJob._id, error).then(); - throw new InvalidJobError(error.message); + const prefix = this.currJob.payload.urlSlug + ? `${this.currJob.payload.prefix}/${this.currJob.payload.urlSlug}` + : this.currJob.payload.prefix; + if (this.currJob.payload.action == 'automatedTest') { + const titleArray = this.currJob.title.split(' '); + const commitHash = titleArray[titleArray.length - 5]; + return `${prefix}/smokeTests/${commitHash}`; } + return prefix; } private async purgePublishedContent(makefileOutput: Array): Promise {