Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 7 additions & 4 deletions .github/actions/prepare-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ inputs:
required: true
use-all-platform-bundle:
description: "If true, we output a tools URL with codeql-bundle.tar.gz file rather than platform-specific URL"
default: 'false'
default: "false"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I presume this probably happened automatically, but we should consider adding a YAML formatter to CI to avoid this sort of noise.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it happened automatically. Agreed on adding a formatter check, but not as part of this PR.

required: false
setup-kotlin:
description: "If true, we setup kotlin"
default: 'true'
default: "true"
required: true
outputs:
tools-url:
Expand Down Expand Up @@ -73,7 +73,10 @@ runs:
exit 1
fi
- uses: fwilhe2/setup-kotlin@9c245a6425255f5e98ba1ce6c15d31fce7eca9da
- uses: fwilhe2/setup-kotlin@b325539ca8f6e1d9ee04efed06f49bdbf5426dbb # v2.1
if: ${{ inputs.setup-kotlin == 'true' }}
with:
version: 1.8.21
# Kotlin is installed on the runners by default, but the version that is pre-installed is too new
# to be supported by CodeQL. This Kotlin version is selected to be compatible with both the default Java
# version on the `ubuntu-latest` runners and CodeQL.
version: 2.1.20
Comment thread
mbg marked this conversation as resolved.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ updates:
- package-ecosystem: github-actions
directories:
- "/.github/workflows"
- "/.github/actions"
- "/.github/actions/*/"
schedule:
interval: weekly
cooldown:
Expand Down
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.

2 changes: 1 addition & 1 deletion .github/workflows/__multi-language-autodetect.yml

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

74 changes: 0 additions & 74 deletions .github/workflows/__rubocop-multi-language.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/__rust.yml

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

23 changes: 14 additions & 9 deletions .github/workflows/debug-artifacts-failure-safe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ env:
on:
push:
branches:
- main
- releases/v*
- main
- releases/v*
pull_request:
merge_group:
types: [checks_requested]
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:

concurrency:
Expand All @@ -30,10 +30,10 @@ jobs:
fail-fast: false
matrix:
version:
- stable-v2.20.7
- default
- linked
- nightly-latest
- stable-v2.20.7
- default
- linked
- nightly-latest
name: Upload debug artifacts after failure in analyze
continue-on-error: true
env:
Expand All @@ -43,7 +43,12 @@ jobs:
# We currently need `security-events: read` to access feature flags.
security-events: read
timeout-minutes: 45
runs-on: ubuntu-latest

# stable-v2.20.7 requires an older version of Java than the default on `ubuntu-latest` (`ubuntu-26.04`).
# We could install that older version on the newer runners, or use the older runner.
# We do the latter here. This can be removed once we stop supporting `v2.20.7`.
runs-on: ${{ case(matrix.version == 'stable-v2.20.7', 'ubuntu-24.04', 'ubuntu-latest') }}
Comment thread
mbg marked this conversation as resolved.

steps:
- name: Dump GitHub event
run: cat "${GITHUB_EVENT_PATH}"
Expand All @@ -60,7 +65,7 @@ jobs:
- name: Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: '9.x'
dotnet-version: "9.x"
- name: Assert best-effort artifact scan completed
uses: ./../action/.github/actions/verify-debug-artifact-scan-completed
- uses: ./../action/init
Expand Down
23 changes: 14 additions & 9 deletions .github/workflows/debug-artifacts-safe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ env:
on:
push:
branches:
- main
- releases/v*
- main
- releases/v*
pull_request:
merge_group:
types: [checks_requested]
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
workflow_dispatch:

concurrency:
Expand All @@ -29,10 +29,10 @@ jobs:
fail-fast: false
matrix:
version:
- stable-v2.20.7
- default
- linked
- nightly-latest
- stable-v2.20.7
- default
- linked
- nightly-latest
name: Upload debug artifacts
env:
CODEQL_ACTION_TEST_MODE: true
Expand All @@ -41,7 +41,12 @@ jobs:
contents: read
# We currently need `security-events: read` to access feature flags.
security-events: read
runs-on: ubuntu-latest

# stable-v2.20.7 requires an older version of Java than the default on `ubuntu-latest` (`ubuntu-26.04`).
# We could install that older version on the newer runners, or use the older runner.
# We do the latter here. This can be removed once we stop supporting `v2.20.7`.
runs-on: ${{ case(matrix.version == 'stable-v2.20.7', 'ubuntu-24.04', 'ubuntu-latest') }}
Comment thread
mbg marked this conversation as resolved.

steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand All @@ -56,7 +61,7 @@ jobs:
- name: Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: '9.x'
dotnet-version: "9.x"
- name: Assert best-effort artifact scan completed
uses: ./../action/.github/actions/verify-debug-artifact-scan-completed
- uses: ./../action/init
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/deflake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ on:
- "PR Check - Proxy test"
- "PR Check - Remote config file"
- "PR Check - Resolve environment"
- "PR Check - RuboCop multi-language"
- "PR Check - Ruby analysis"
- "PR Check - Rust analysis"
- "PR Check - Split workflow"
Expand Down
23 changes: 0 additions & 23 deletions pr-checks/checks/rubocop-multi-language.yml

This file was deleted.

44 changes: 35 additions & 9 deletions pr-checks/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,15 @@ interface LanguageSetup {
/** Describes partial mappings from built-in languages to their specific setup information. */
type LanguageSetups = Partial<Record<BuiltInLanguage, LanguageSetup>>;

// The default set of CodeQL Bundle versions to use for the PR checks.
/** A type representing version identifiers. */
type Version =
| "default"
| "linked"
| "nightly-latest"
// This is an approximation, but sufficient validation for our needs here.
| `stable-v${number}.${number}.${number}`;

/** The default set of CodeQL Bundle versions to use for the PR checks. */
const defaultTestVersions = [
// The oldest supported CodeQL version. If bumping, update `CODEQL_MINIMUM_VERSION` in `codeql.ts`
"stable-v2.20.7",
Expand All @@ -159,7 +167,10 @@ const defaultTestVersions = [
"linked",
// A nightly build directly from the our private repo, built in the last 24 hours.
"nightly-latest",
];
] as const satisfies Version[];

/** A type representing the default test versions. */
type DefaultTestVersion = (typeof defaultTestVersions)[number];

/** The default versions we use for languages / frameworks, if not specified as a workflow input. */
const defaultLanguageVersions = {
Expand Down Expand Up @@ -313,9 +324,11 @@ const languageSetups: LanguageSetups = {
},
};

// This is essentially an arbitrary version of `yq`, which happened to be the one that
// `choco` fetched when we moved away from using that here.
// See https://github.com/github/codeql-action/pull/3423
/**
* This is essentially an arbitrary version of `yq`, which happened to be the one that
* `choco` fetched when we moved away from using that here.
* See https://github.com/github/codeql-action/pull/3423
*/
const YQ_VERSION = "v4.50.1";

const CHECKS_DIR = path.join(PR_CHECKS_DIR, "checks");
Expand Down Expand Up @@ -442,10 +455,23 @@ function generateJobMatrix(
: [operatingSystemConfig["runner-image"]];

for (const runnerImage of runnerImagesForOs) {
matrix.push({
os: runnerImage,
version,
});
// stable-v2.20.7 requires an older version of Java than the default on `ubuntu-latest`.
// We could install that older version on the newer runners, or use the older runner.
// We do the latter here. This can be removed once we stop supporting `v2.20.7`.
// Since this is typed as `DefaultTestVersion`, it will become an error once `stable-v2.20.7`
// is removed from `defaultTestVersions`.
Comment on lines +461 to +462

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Though I believe we don't build the PR checks project as part of CI, so we'd only see this locally)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing it locally is the intended scenario, because you'd locally remove it from defaultTestVersions and then this would immediately flag up as an error.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That said, it might be worth running tsc -noEmit over the TypeScript sources in CI if we don't already. (But not in this PR.)

const requiresOlderRunnerImage: DefaultTestVersion = "stable-v2.20.7";
if (
runnerImage === "ubuntu-latest" &&
version === requiresOlderRunnerImage
) {
matrix.push({ os: "ubuntu-24.04", version });
} else {
Comment on lines +458 to +469

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another valid approach here would be overriding the runner image for (I think just) the multi-language check, since I believe this issue only affects checks that analyze Java.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, but I think we probably should just merge this for now to unblock other work.

matrix.push({
os: runnerImage,
version,
});
}
}
}
}
Expand Down
Loading