Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0256599
Prompt customers to upgrade from v1 to v2
henrymercer Apr 26, 2022
016ec75
Update changelog and version after v2.1.9
invalid-email-address Apr 27, 2022
04f504c
Update checked-in dependencies
invalid-email-address Apr 27, 2022
6ed7f70
Merge pull request #1047 from github/mergeback/v2.1.9-to-main-7502d6e9
edoardopirovano Apr 28, 2022
5227afa
Tweak wording of message
henrymercer Apr 28, 2022
35ef6a2
Move `formatGitHubVersion` into util.test.ts
henrymercer Apr 28, 2022
02083c3
Add a comment to explain why we show the upgrade message on GHES 3.4
henrymercer Apr 28, 2022
2bf00f7
Merge branch 'main' into henrymercer/prompt-v1-to-v2-upgrades
henrymercer Apr 28, 2022
0c3c093
Merge pull request #1045 from github/henrymercer/prompt-v1-to-v2-upgr…
henrymercer Apr 28, 2022
7c2be06
Factor out test mode determination code
henrymercer Apr 28, 2022
ea676e3
Don't wait for processing in test mode
henrymercer Apr 28, 2022
06b15c2
Allow pack specifiers to include paths
aeisenberg Apr 27, 2022
ceeddf2
Merge pull request #1050 from github/henrymercer/dont-wait-for-proces…
henrymercer Apr 29, 2022
922dc2b
Use the `--resolve-query-specs` parameter of `pack download`
aeisenberg Apr 29, 2022
b11fe85
Merge branch 'main' into aeisenberg/packs-with-paths
aeisenberg Apr 29, 2022
a73e506
Fix syntax error in workflow
aeisenberg Apr 29, 2022
0235de0
Merge pull request #1049 from github/aeisenberg/packs-with-paths
aeisenberg May 2, 2022
9a6bf18
Update CONTRIBUTING.md
aeisenberg May 2, 2022
c9882be
Update CONTRIBUTING.md
aeisenberg May 2, 2022
8f84542
Merge pull request #1052 from github/aeisenberg/required-checks
aeisenberg May 2, 2022
b71f20d
Add workflow to regenerate required checks
aeisenberg May 2, 2022
0fb7838
Merge pull request #1053 from github/aeisenberg/update-checks
aeisenberg May 2, 2022
06d4e82
Add permissions block to workflow
aeisenberg May 2, 2022
7b66e72
Merge pull request #1054 from github/aeisenberg/update-checks
aeisenberg May 2, 2022
366e88c
Fix processing errors being caught and logged as a warning rather tha…
chrisgavin May 3, 2022
96bc9c3
Merge pull request #1055 from github/fix-status-error-being-caught
chrisgavin May 3, 2022
3c6dd30
Update codeql to 2.9.1
May 3, 2022
dd56e95
Merge pull request #1056 from github/alexet/update-2.9.1
May 5, 2022
827fd55
Create update-required-checks script
aeisenberg May 9, 2022
7cf0ed5
Merge pull request #1060 from github/aeisenberg/required-checks-script
aeisenberg May 10, 2022
f8eea91
Update changelog for v2.1.10
invalid-email-address May 10, 2022
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
Use the --resolve-query-specs parameter of pack download
This will allow the command to resolve packs with paths.

Also, use a more concise version of `tr`.
  • Loading branch information
aeisenberg committed Apr 29, 2022
commit 922dc2b9760a84dca80cd7bf4c7e139e8fdd4b6e
2 changes: 1 addition & 1 deletion .github/workflows/__packaging-config-inputs-js.yml

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

2 changes: 1 addition & 1 deletion .github/workflows/__packaging-config-js.yml

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

2 changes: 1 addition & 1 deletion .github/workflows/__packaging-inputs-js.yml

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

2 changes: 1 addition & 1 deletion .github/workflows/__split-workflow.yml

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

11 changes: 1 addition & 10 deletions lib/analyze.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/analyze.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lib/codeql.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/codeql.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pr-checks/checks/packaging-config-inputs-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ steps:
EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/other-query-block javascript/example/two-block"

# use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace
RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n" " " | tr "\r" " " | xargs)"
RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort tr "\n\r" " " | | xargs)"
echo "Found matching rules '$RULES'"
if [ "$RULES" != "$EXPECTED_RULES" ]; then
echo "Did not match expected rules '$EXPECTED_RULES'."
Expand Down
2 changes: 1 addition & 1 deletion pr-checks/checks/packaging-config-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ steps:
EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/other-query-block javascript/example/two-block"

# use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace
RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n" " " | tr "\r" " " | xargs)"
RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort tr "\n\r" " " | | xargs)"
echo "Found matching rules '$RULES'"
if [ "$RULES" != "$EXPECTED_RULES" ]; then
echo "Did not match expected rules '$EXPECTED_RULES'."
Expand Down
2 changes: 1 addition & 1 deletion pr-checks/checks/packaging-inputs-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ steps:
EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/other-query-block javascript/example/two-block"

# use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace
RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n" " " | tr "\r" " " | xargs)"
RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort tr "\n\r" " " | | xargs)"
echo "Found matching rules '$RULES'"
if [ "$RULES" != "$EXPECTED_RULES" ]; then
echo "Did not match expected rules '$EXPECTED_RULES'."
Expand Down
2 changes: 1 addition & 1 deletion pr-checks/checks/split-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ steps:
EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/other-query-block javascript/example/two-block"

# use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace
RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n" " " | tr "\r" " " | xargs)"
RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort tr "\n\r" " " | | xargs)"
echo "Found matching rules '$RULES'"
if [ "$RULES" != "$EXPECTED_RULES" ]; then
echo "Did not match expected rules '$EXPECTED_RULES'."
Expand Down
15 changes: 2 additions & 13 deletions src/analyze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,8 @@ export async function runQueries(
logger.info("Performing analysis with custom CodeQL Packs.");
logger.startGroup(`Downloading custom packs for ${language}`);

const results = await codeql.packDownload(
removePackPath(packsWithVersion)
);
const results = await codeql.packDownload(packsWithVersion);

logger.info(
`Downloaded packs: ${results.packs
.map((r) => `${r.name}@${r.version || "latest"}`)
Expand Down Expand Up @@ -499,16 +498,6 @@ async function injectLinesOfCode(
}
}

/**
* `codeql pack download` command does not support downloading pack specifiers with paths
* in them. This removes the path from the pack specifier.
* @param packsWithVersion array of pack specifiers, some of which may have paths in them
* @returns array of pack specifiers without paths
*/
function removePackPath(packsWithVersion: string[]) {
return packsWithVersion.map((pack) => pack.split(":")[0]);
}

function printLinesOfCodeSummary(
logger: Logger,
language: Language,
Expand Down
1 change: 1 addition & 0 deletions src/codeql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,7 @@ async function getCodeQLForCmd(
"pack",
"download",
"--format=json",
"--resolve-query-specs",
...getExtraOptionsFromEnv(["pack", "download"]),
...packs,
];
Expand Down