Skip to content

Commit

Permalink
DOP-4401-c implementing changes test on 4414
Browse files Browse the repository at this point in the history
  • Loading branch information
anabellabuckvar committed Apr 10, 2024
1 parent 286ecfc commit b9f8585
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 33 deletions.
1 change: 0 additions & 1 deletion .github/workflows/deploy-stg-ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
branches:
- "main"
- "integration"
- "DOP-4401-c"
concurrency:
group: environment-stg-${{ github.ref }}
cancel-in-progress: true
Expand Down
16 changes: 5 additions & 11 deletions src/job/jobHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,19 +149,13 @@ export abstract class JobHandler {
@throwIfJobInterupted()
private async constructPrefix(): Promise<void> {
const server_user = this._config.get<string>('GATSBY_PARSER_USER');
const prePrefix = await this.getPathPrefix();
const pathPrefix = '';
// let pathPrefix;
// if (this.currJob.payload.newHead && this.currJob.payload.action == 'automatedTest') {
// pathPrefix = `${prePrefix}/${this.currJob.payload.newHead}`;
// } else pathPrefix = prePrefix;
const pathPrefix = await this.getPathPrefix();
// TODO: Can empty string check be removed?
if (pathPrefix || pathPrefix === '') {
const mutPrefix = pathPrefix.split(`/${server_user}`)[0];
//TODO: append something to pathPrefix and see if link and bucket path still function and correspond appropriately
this.currJob.payload.mutPrefix = prePrefix + '/slackDeploy';
// TODO: see what pathPrefix does, if having it not be an empty string changes something
this.currJob.payload.pathPrefix = pathPrefix;
this._logger.save(this.currJob._id, `${mutPrefix}, prePrefix: ${prePrefix}, server user: ${server_user}`);
//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;
}
}

Expand Down
25 changes: 4 additions & 21 deletions src/job/productionJobHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,31 +144,14 @@ export class ProductionJobHandler extends JobHandler {
const prefix = this.currJob.payload.urlSlug
? `${this.currJob.payload.prefix}/${this.currJob.payload.urlSlug}`
: this.currJob.payload.prefix;
if (this.currJob.payload.newHead && this.currJob.payload.action == 'automatedTest') {
return `${prefix}/${this.currJob.payload.newHead}`;
if (this.currJob.payload.action == 'automatedTest') {
const titleArray = this.currJob.title.split(' ');
const commitHash = titleArray[titleArray.length - 5];
return `${prefix}/smokeTests/${commitHash}`;
}
return prefix;
}

// 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);
// }
// }

private async purgePublishedContent(makefileOutput: Array<string>): Promise<void> {
try {
const stdoutJSON = JSON.parse(makefileOutput[2]);
Expand Down

0 comments on commit b9f8585

Please sign in to comment.