Skip to content

Commit

Permalink
logger
Browse files Browse the repository at this point in the history
  • Loading branch information
mmeigs committed Nov 15, 2023
1 parent e733122 commit 2442b6f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/commands/src/shared/next-gen-parse.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { IJobRepoLogger } from '../../../services/logger';
import { CliCommandResponse, executeCliCommand } from '../helpers';

const RSTSPEC_FLAG = '--rstspec=https://raw.githubusercontent.com/mongodb/snooty-parser/latest/snooty/rstspec.toml';
Expand All @@ -6,8 +7,14 @@ interface NextGenParseParams {
repoDir: string;
commitHash?: string;
patchId?: string;
logger: IJobRepoLogger;
}
export async function nextGenParse({ repoDir, patchId, commitHash }: NextGenParseParams): Promise<CliCommandResponse> {
export async function nextGenParse({
repoDir,
patchId,
commitHash,
logger,
}: NextGenParseParams): Promise<CliCommandResponse> {
const commandArgs = ['build', repoDir, '--output', `${repoDir}/bundle.zip`, RSTSPEC_FLAG];

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

logger.save(repoDir, `COMMAND for parse: ${commandArgs.join(' ')}`);

return executeCliCommand({ command: 'snooty', args: commandArgs });
}
1 change: 1 addition & 0 deletions src/job/jobHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ export abstract class JobHandler {
const snootyParseRes = await nextGenParse({
repoDir: `repos/${getDirectory(this.currJob)}`,
commitHash: this.currJob.payload.newHead ?? '',
logger: this._logger,
});
this._logger.save(
this.currJob._id,
Expand Down

0 comments on commit 2442b6f

Please sign in to comment.