Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOP-4401-c: Add commit hash to path for Smoke Test Deploys #1018

Merged
merged 22 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
a8a1ce6
DOP-4401-c initial changes
anabellabuckvar Mar 26, 2024
20bf69c
DOP-4414 undoing changes for testing
anabellabuckvar Mar 26, 2024
9b66b6f
DOP-4401-c refactor pathprefix
anabellabuckvar Mar 26, 2024
41c8909
DOP-4401-c playing with mut prefix
anabellabuckvar Mar 27, 2024
11ec9c4
DOP-4401-c mut prefix
anabellabuckvar Mar 27, 2024
1ddd5b7
DOP-4401-c undoing pathprefix conditional
anabellabuckvar Mar 27, 2024
4189751
DOP-4401-c redoing path prefix conditional and populating pathPrefix
anabellabuckvar Mar 27, 2024
7326c33
DOP-4401-c redoing path prefix conditional but depopulating path prefix
anabellabuckvar Mar 27, 2024
fc59876
DOP-4401-c adding a space in next-gen-stage argument
anabellabuckvar Mar 27, 2024
0ae08c0
DOP-4401-c pushing to preprd
anabellabuckvar Mar 27, 2024
b2e5820
DOP-4401-c removing from preprd
anabellabuckvar Apr 3, 2024
fe6d971
DOP-4401-c pushing to preprd
anabellabuckvar Apr 8, 2024
92e530b
DOP-4401-c playing with pathprefix
anabellabuckvar Apr 8, 2024
c5a3662
DOP-4401-c playing with pathprefix
anabellabuckvar Apr 8, 2024
ae38f02
DOP-4401-c setting mutPrefix to prePrefix
anabellabuckvar Apr 8, 2024
286ecfc
DOP-4401-c adding slack deploy to the end of mutprefix
anabellabuckvar Apr 8, 2024
b9f8585
DOP-4401-c implementing changes test on 4414
anabellabuckvar Apr 10, 2024
eaabdb5
Merge branch 'main' into DOP-4401-c
anabellabuckvar Apr 10, 2024
9cd3626
DOP-4401-c reverting conditional amended for testing
anabellabuckvar Apr 10, 2024
8e15403
Merge branch 'main' into DOP-4401-c
anabellabuckvar Apr 11, 2024
32a1a2f
Merge branch 'main' into DOP-4401-c
anabellabuckvar Apr 15, 2024
0cd7a1c
Merge branch 'main' into DOP-4401-c
anabellabuckvar Apr 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/job/jobHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
23 changes: 8 additions & 15 deletions src/job/productionJobHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>): Promise<void> {
Expand Down
Loading