Skip to content

Commit

Permalink
[DOP-4097]: Ensure we use the --no-caching flag for production builds (
Browse files Browse the repository at this point in the history
…#940)

* [DOP-4097]: Add no caching flag for ts command

* [DOP-4097]: Add NO_CACHING flag to next-gen-parse for production jobHandler

* [DOP-4097]: Add NO_CACHING flag to next-gen-parse to staging for testing

* [DOP-4097]: Add the right shared.mk path for right dockerfile

* [DOP-4097]: Revert

* [DOP-4097]: Fix dockerfile

* [DOP-4097]: Update comments
  • Loading branch information
branberry authored Nov 30, 2023
1 parent d4303f2 commit 1c063bb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
15 changes: 13 additions & 2 deletions src/commands/src/shared/next-gen-parse.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import { CliCommandResponse, executeCliCommand } from '../helpers';

const RSTSPEC_FLAG = '--rstspec=https://raw.githubusercontent.com/mongodb/snooty-parser/latest/snooty/rstspec.toml';

interface NextGenParseParams {
repoDir: string;
commitHash: string;
patchId?: string;
isProd?: boolean;
}
export async function nextGenParse({ repoDir, patchId, commitHash }: NextGenParseParams): Promise<CliCommandResponse> {
export async function nextGenParse({
repoDir,
patchId,
commitHash,
isProd,
}: NextGenParseParams): Promise<CliCommandResponse> {
const commandArgs = ['build', repoDir, '--output', `${repoDir}/bundle.zip`, RSTSPEC_FLAG];

if (patchId) {
Expand All @@ -18,5 +23,11 @@ export async function nextGenParse({ repoDir, patchId, commitHash }: NextGenPars
commandArgs.push(patchId);
}

// Not currently used in production builds, adding functionality
// now so that it is available when it is.
if (isProd) {
commandArgs.push('--no-caching');
}

return executeCliCommand({ command: 'snooty', args: commandArgs });
}
2 changes: 1 addition & 1 deletion src/job/productionJobHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class ProductionJobHandler extends JobHandler {
prepStageSpecificNextGenCommands(): void {
if (this.currJob?.buildCommands) {
this.currJob.buildCommands[this.currJob.buildCommands.length - 1] = 'make get-build-dependencies';
this.currJob.buildCommands.push('make next-gen-parse');
this.currJob.buildCommands.push('make next-gen-parse NO_CACHING=--no-caching');
this.currJob.buildCommands.push(`make persistence-module JOB_ID=${this.currJob._id}`);
this.currJob.buildCommands.push('make next-gen-html');
this.currJob.buildCommands.push(`make oas-page-build MUT_PREFIX=${this.currJob.payload.mutPrefix}`);
Expand Down
2 changes: 1 addition & 1 deletion tests/data/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export class TestDataProvider {
const genericCommands = TestDataProvider.getCommonBuildCommands(job);
return Array<string>().concat(genericCommands.slice(0, genericCommands.length - 1), [
'make get-build-dependencies',
'make next-gen-parse',
'make next-gen-parse NO_CACHING=--no-caching',
`make persistence-module JOB_ID=${job._id}`,
'make next-gen-html',
`make oas-page-build MUT_PREFIX=${job.payload.mutPrefix}`,
Expand Down

0 comments on commit 1c063bb

Please sign in to comment.