Skip to content

Commit c5b82fa

Browse files
committed
Change diagnosticsExport to not require full Config
1 parent d509c62 commit c5b82fa

4 files changed

Lines changed: 19 additions & 9 deletions

File tree

‎lib/entry-points.js‎

Lines changed: 8 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/codeql.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export interface CodeQL {
197197
diagnosticsExport(
198198
sarifFile: string,
199199
automationDetailsId: string | undefined,
200-
config: Config,
200+
tempDir: string,
201201
diagnosticDir: string | undefined,
202202
): Promise<void>;
203203
/** Get the location of an extractor for the specified language. */
@@ -919,7 +919,7 @@ async function getCodeQLForCmd(
919919
async diagnosticsExport(
920920
sarifFile: string,
921921
automationDetailsId: string | undefined,
922-
config: Config,
922+
tempDir: string,
923923
diagnosticDir: string | undefined,
924924
): Promise<void> {
925925
const args = [
@@ -928,7 +928,7 @@ async function getCodeQLForCmd(
928928
"--format=sarif-latest",
929929
`--output=${sarifFile}`,
930930
`--sarif-codescanning-config=${getGeneratedCodeScanningConfigPath(
931-
config.tempDir,
931+
tempDir,
932932
)}`,
933933
...(diagnosticDir !== undefined
934934
? [`--diagnostic-dir=${diagnosticDir}`]

‎src/init-action-post-helper.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ async function testFailedSarifUpload(
786786
diagnosticsExportStub.calledOnceWith(
787787
sinon.match.string,
788788
category,
789-
config,
789+
config.tempDir,
790790
),
791791
`Actual args were: ${JSON.stringify(diagnosticsExportStub.args)}`,
792792
);
@@ -893,7 +893,7 @@ test.serial(
893893
diagnosticsExport.calledOnceWith(
894894
sinon.match(expectedFilePattern),
895895
"/language:javascript",
896-
config,
896+
config.tempDir,
897897
),
898898
);
899899
},

‎src/init-action-post-helper.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,12 @@ async function generateFailedSarif(
191191
diagnosticDir = undefined;
192192
}
193193

194-
await codeql.diagnosticsExport(sarifFile, category, config, diagnosticDir);
194+
await codeql.diagnosticsExport(
195+
sarifFile,
196+
category,
197+
config.tempDir,
198+
diagnosticDir,
199+
);
195200
} else {
196201
// We call 'database export-diagnostics' to find any per-database diagnostics.
197202
await codeql.databaseExportDiagnostics(databasePath, sarifFile, category);

0 commit comments

Comments
 (0)