Skip to content
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

Merge main into releases/v2 #1634

Merged
merged 29 commits into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
32daed7
Update changelog and version after v2.2.9
invalid-email-address Mar 27, 2023
2deae45
Update checked-in dependencies
invalid-email-address Mar 27, 2023
1e7a388
Wrap reading and writing SARIF files
henrymercer Mar 27, 2023
57eca7c
Use `Array.isArray`
henrymercer Mar 27, 2023
b0e191e
Merge pull request #1609 from github/mergeback/v2.2.9-to-main-04df1262
henrymercer Mar 27, 2023
bc0ed6a
Merge pull request #1610 from github/henrymercer/diagnostics-workarou…
henrymercer Mar 27, 2023
0af0653
Use new location for external queries
aeisenberg Mar 27, 2023
f9c159f
Merge pull request #1613 from github/aeisenberg/codeql-testing
aeisenberg Mar 28, 2023
ff39eb8
Disable flaky Swift autobuild checks
henrymercer Mar 28, 2023
fff3a80
Merge pull request #1620 from github/henrymercer/disable-flaky-check
henrymercer Mar 28, 2023
f6e4cff
Remove checks for triggering on specific paths
rneatherway Mar 29, 2023
dc81ae3
Merge pull request #1625 from github/rneatherway/rm-old-checks
rneatherway Mar 29, 2023
29a4713
Enable diagnostics functionality on GHES
henrymercer Mar 29, 2023
69aec34
Pass negative SARIF include diagnostics flag when feature is disabled
henrymercer Mar 29, 2023
bb28e7e
Merge pull request #1626 from github/henrymercer/diagnostics-ghes
henrymercer Mar 30, 2023
e85546c
Move internal Actions into `.github/actions`
henrymercer Mar 31, 2023
1c0a788
Add workflow to automatically update the bundle
henrymercer Mar 31, 2023
33f3087
Format `.github/actions/update-bundle/index.ts`
henrymercer Apr 3, 2023
a86046f
Explain CLI version marker files
henrymercer Apr 3, 2023
f6091a0
Use `tee` when setting env vars to improve debugging
henrymercer Apr 3, 2023
98173be
Add a comment about `lib/defaults.json`
henrymercer Apr 3, 2023
f0a422f
Merge pull request #1630 from github/henrymercer/automate-bundle-upgrade
henrymercer Apr 3, 2023
9c869eb
Update default CodeQL bundle version to 2.12.6
alexet Apr 3, 2023
ae0109a
Merge pull request #1629 from github/alexet/update-2.12.6-2
alexet Apr 4, 2023
3bba073
Skip the SARIF notification object workaround for fixed CLIs
henrymercer Apr 4, 2023
2754e10
Move to the codeql-testing org
aeisenberg Apr 4, 2023
fa7cce4
Merge pull request #1632 from github/aeisenberg/codeql-testing-org
aeisenberg Apr 4, 2023
66aeadb
Merge pull request #1631 from github/henrymercer/duplicate-diagnostic…
henrymercer Apr 5, 2023
d53297e
Update changelog for v2.2.10
invalid-email-address Apr 5, 2023
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
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ runs:
env:
CODEQL_ACTION_TEST_MODE: "true"
- name: Check SARIF
uses: ./../action/.github/check-sarif
uses: ./../action/.github/actions/check-sarif
with:
sarif-file: ${{ inputs.sarif-file }}
queries-run: ${{ inputs.queries-run}}
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/update-bundle/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Update default CodeQL bundle
description: Updates 'src/defaults.json' to point to a new CodeQL bundle release.

runs:
using: composite
steps:
- name: Install ts-node
shell: bash
run: npm install -g ts-node

- name: Run update script
working-directory: ${{ github.action_path }}
shell: bash
run: ts-node ./index.ts
69 changes: 69 additions & 0 deletions .github/actions/update-bundle/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import * as fs from 'fs';
import * as github from '@actions/github';

interface BundleInfo {
bundleVersion: string;
cliVersion: string;
}

interface Defaults {
bundleVersion: string;
cliVersion: string;
priorBundleVersion: string;
priorCliVersion: string;
}

const CODEQL_BUNDLE_PREFIX = 'codeql-bundle-';

function getCodeQLCliVersionForRelease(release): string {
// We do not currently tag CodeQL bundles based on the CLI version they contain.
// Instead, we use a marker file `cli-version-<version>.txt` to record the CLI version.
// This marker file is uploaded as a release asset for all new CodeQL bundles.
const cliVersionsFromMarkerFiles = release.assets
.map((asset) => asset.name.match(/cli-version-(.*)\.txt/)?.[1])
.filter((v) => v)
.map((v) => v as string);
if (cliVersionsFromMarkerFiles.length > 1) {
throw new Error(
`Release ${release.tag_name} has multiple CLI version marker files.`
);
} else if (cliVersionsFromMarkerFiles.length === 0) {
throw new Error(
`Failed to find the CodeQL CLI version for release ${release.tag_name}.`
);
}
return cliVersionsFromMarkerFiles[0];
}

async function getBundleInfoFromRelease(release): Promise<BundleInfo> {
return {
bundleVersion: release.tag_name.substring(CODEQL_BUNDLE_PREFIX.length),
cliVersion: getCodeQLCliVersionForRelease(release)
};
}

async function getNewDefaults(currentDefaults: Defaults): Promise<Defaults> {
const release = github.context.payload.release;
console.log('Updating default bundle as a result of the following release: ' +
`${JSON.stringify(release)}.`)

const bundleInfo = await getBundleInfoFromRelease(release);
return {
bundleVersion: bundleInfo.bundleVersion,
cliVersion: bundleInfo.cliVersion,
priorBundleVersion: currentDefaults.bundleVersion,
priorCliVersion: currentDefaults.cliVersion
};
}

async function main() {
const previousDefaults: Defaults = JSON.parse(fs.readFileSync('../../../src/defaults.json', 'utf8'));
const newDefaults = await getNewDefaults(previousDefaults);
// Update the source file in the repository. Calling workflows should subsequently rebuild
// the Action to update `lib/defaults.json`.
fs.writeFileSync('../../../src/defaults.json', JSON.stringify(newDefaults, null, 2) + "\n");
}

// Ideally, we'd await main() here, but that doesn't work well with `ts-node`.
// So instead we rely on the fact that Node won't exit until the event loop is empty.
main();
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ updates:
schedule:
interval: weekly
- package-ecosystem: github-actions
directory: "/.github/setup-swift/" # All subdirectories outside of "/.github/workflows" must be explicitly included.
directory: "/.github/actions/setup-swift/" # All subdirectories outside of "/.github/workflows" must be explicitly included.
schedule:
interval: weekly
2 changes: 1 addition & 1 deletion .github/workflows/__analyze-ref-input.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/__autobuild-action.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/__config-export.yml

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

8 changes: 7 additions & 1 deletion .github/workflows/__diagnostics-export.yml

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

4 changes: 2 additions & 2 deletions .github/workflows/__export-file-baseline-information.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/__extractor-ram-threads.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/__go-custom-queries.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/__go-tracing-autobuilder.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/__go-tracing-custom-build-steps.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/__go-tracing-legacy-workflow.yml

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

10 changes: 7 additions & 3 deletions .github/workflows/__init-with-registries.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/__javascript-source-root.yml

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

4 changes: 2 additions & 2 deletions .github/workflows/__ml-powered-queries.yml

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

4 changes: 2 additions & 2 deletions .github/workflows/__multi-language-autodetect.yml

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

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

6 changes: 3 additions & 3 deletions .github/workflows/__packaging-config-inputs-js.yml

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

4 changes: 2 additions & 2 deletions .github/workflows/__packaging-config-js.yml

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

6 changes: 3 additions & 3 deletions .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/__remote-config.yml

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

Loading