Skip to content

Merge main into releases/v3 #2490

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

Merged
merged 37 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
b296f26
Refactor: upload all available debug artifacts in init-post
angelapwen Sep 11, 2024
c098b25
Only upload `upload-sarif` debug artifacts at most once
angelapwen Sep 11, 2024
4ba2440
Rebuild: add transpiled files
angelapwen Sep 11, 2024
82ce313
Remove unused helper file
angelapwen Sep 11, 2024
d4bfd40
Use `.push` rather than `.concat`
angelapwen Sep 11, 2024
cb7faf5
Refactor: move combined SARIF debug artifact logic to `debug-artifact`
angelapwen Sep 12, 2024
e771680
Rename `upload-debug-artifacts` to `combined-sarif-artifacts`
angelapwen Sep 12, 2024
bc660fc
Copy SARIF file to database location rather than move
angelapwen Sep 12, 2024
d795ead
Fix incorrect documentation about the `token` input to the Actions.
chrisgavin Sep 13, 2024
d4f57b8
Update changelog and version after v3.26.7
github-actions[bot] Sep 13, 2024
fa08c06
Update checked-in dependencies
github-actions[bot] Sep 13, 2024
e1d2bc5
Merge pull request #2479 from github/mergeback/v3.26.7-to-main-8214744c
Sep 13, 2024
51de6a8
Use RFC-style requirements.
chrisgavin Sep 13, 2024
86b04fb
Add a warning to not specify a `token` input in most cases.
chrisgavin Sep 13, 2024
c101242
Merge pull request #2477 from github/fix-incorrect-token-docs
chrisgavin Sep 13, 2024
762210d
Use generated token on checkout
rvermeulen Sep 13, 2024
fe22310
Merge pull request #2475 from github/angelapwen/refactor-debug-artifa…
angelapwen Sep 13, 2024
5618c9f
Merge pull request #2481 from rvermeulen/rvermeulen/use-correct-token…
Sep 13, 2024
d061f2c
Handle CLI errors when creating debug artifacts
henrymercer Sep 16, 2024
bbd9c4a
Update default bundle to codeql-bundle-v2.19.0
github-actions[bot] Sep 16, 2024
6cc3253
Add changelog note
github-actions[bot] Sep 16, 2024
80d7a6c
Tolerate failures in uploading debug artifacts
henrymercer Sep 16, 2024
bbd7c80
Fall back to partial database bundle if CLI command fails
henrymercer Sep 16, 2024
dd7307d
Refactoring: Simplify retrieving error message
henrymercer Sep 16, 2024
213bf36
Improve documentation
henrymercer Sep 16, 2024
642bbfc
Turn invalid helpUri attribute into a warning
rvermeulen Sep 16, 2024
782de45
Merge pull request #2486 from github/henrymercer/improve-debug-artifa…
henrymercer Sep 17, 2024
78d398e
Improve docs and method naming
henrymercer Sep 17, 2024
d0a3cf2
Improve logging for debug artifacts
henrymercer Sep 17, 2024
6e24973
Improve logging for combined SARIF debug artifact
henrymercer Sep 17, 2024
34666c1
Merge pull request #2488 from github/henrymercer/debug-artifacts-bett…
henrymercer Sep 17, 2024
a1a585f
Merge branch 'main' into rvermeulen/uri-errors-as-warnings
rvermeulen Sep 17, 2024
498c508
Rebuild JavaScript files
rvermeulen Sep 17, 2024
cb28816
Merge pull request #2487 from rvermeulen/rvermeulen/uri-errors-as-war…
rvermeulen Sep 17, 2024
e0e2d75
Merge branch 'main' into update-bundle/codeql-bundle-v2.19.0
smowton Sep 18, 2024
64431c6
Merge pull request #2483 from github/update-bundle/codeql-bundle-v2.19.0
smowton Sep 18, 2024
00b3604
Update changelog for v3.26.8
github-actions[bot] Sep 19, 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
Prev Previous commit
Next Next commit
Improve docs and method naming
  • Loading branch information
henrymercer committed Sep 17, 2024
commit 78d398ebc6be2d0a1fb3c058f572b35b95ffe13d
31 changes: 18 additions & 13 deletions lib/debug-artifacts.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/debug-artifacts.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 24 additions & 17 deletions src/debug-artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ export async function uploadCombinedSarifArtifacts() {
}

/**
* Try to get the SARIF result path for the given language.
* Try to prepare a SARIF result debug artifact for the given language.
*
* If an error occurs, log it and return an empty list.
* @return The path to that debug artifact, or undefined if an error occurs.
*/
function tryGetSarifResultPath(
function tryPrepareSarifDebugArtifact(
config: Config,
language: Language,
logger: Logger,
): string[] {
): string | undefined {
try {
const analyzeActionOutputDir = process.env[EnvVar.SARIF_RESULTS_OUTPUT_DIR];
if (
Expand All @@ -94,7 +94,7 @@ function tryGetSarifResultPath(
`${language}.sarif`,
);
fs.copyFileSync(sarifFile, sarifInDbLocation);
return [sarifInDbLocation];
return sarifInDbLocation;
}
}
} catch (e) {
Expand All @@ -104,39 +104,38 @@ function tryGetSarifResultPath(
)}`,
);
}
return [];
return undefined;
}

/**
* Try to bundle the database for the given language. Return a list containing
* the path to the database bundle.
* Try to bundle the database for the given language.
*
* If an error occurs, log it and return an empty list.
* @return The path to the database bundle, or undefined if an error occurs.
*/
async function tryBundleDatabase(
config: Config,
language: Language,
logger: Logger,
): Promise<string[]> {
): Promise<string | undefined> {
try {
if (dbIsFinalized(config, language, logger)) {
try {
return [await createDatabaseBundleCli(config, language)];
return await createDatabaseBundleCli(config, language);
} catch (e) {
logger.warning(
`Failed to bundle database for ${language} using the CLI. ` +
`Falling back to a partial bundle. Reason: ${getErrorMessage(e)}`,
);
}
}
return [await createPartialDatabaseBundle(config, language)];
return await createPartialDatabaseBundle(config, language);
} catch (e) {
logger.warning(
`Failed to bundle database for ${language}. Reason: ${getErrorMessage(
e,
)}`,
);
return [];
return undefined;
}
}

Expand All @@ -153,7 +152,14 @@ export async function tryUploadAllAvailableDebugArtifacts(
const filesToUpload: string[] = [];

for (const language of config.languages) {
filesToUpload.push(...tryGetSarifResultPath(config, language, logger));
const sarifResultDebugArtifact = tryPrepareSarifDebugArtifact(
config,
language,
logger,
);
if (sarifResultDebugArtifact) {
filesToUpload.push(sarifResultDebugArtifact);
}

// Add any log files
const databaseDirectory = getCodeQLDatabasePath(config, language);
Expand All @@ -172,9 +178,10 @@ export async function tryUploadAllAvailableDebugArtifacts(
}

// Add database bundle
filesToUpload.push(
...(await tryBundleDatabase(config, language, logger)),
);
const databaseBundle = await tryBundleDatabase(config, language, logger);
if (databaseBundle) {
filesToUpload.push(databaseBundle);
}
}

await uploadDebugArtifacts(
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy