Add warning when using unsupported CLI version#2428
Conversation
This adds a warning when the user is using an unsupported version of the CodeQL CLI. The warning is shown once per session, and only if the version is older than the oldest supported version.
shati-patel
left a comment
There was a problem hiding this comment.
Looks good! 🎉 One question inline, and could you also add a changelog entry?
| export class CliVersionConstraint { | ||
| // The oldest version of the CLI that we support. This is used to determine | ||
| // whether to show a warning about the CLI being too old on startup. | ||
| public static OLDEST_SUPPORTED_CLI_VERSION = new SemVer("2.7.6"); |
There was a problem hiding this comment.
Is it possible to get this value automatically from https://github.com/github/vscode-codeql/blob/main/extensions/ql-vscode/supported_cli_versions.json, instead of having to manually update it? (No problem if that isn't feasible!)
There was a problem hiding this comment.
The file is outside of the src directory, so we can't actually get it from TypeScript without moving it or changing the packaging configuration to include it. Calculating the oldest version from this file would also be a little more complicated than updating this version, and I think you'd be updating this version only when you're changing the other constraints in this class as well.
There was a problem hiding this comment.
Do we need some docs/process somewhere to make sure this is updated when the oldest supported version is updated?
There was a problem hiding this comment.
We're working on finalizing our deprecation strategy and it's probably going to be the case that we only need to support 1 year's worth of old CLIs. Given that we do a minor version bump every 3 months (coinciding with GHES releases), we only need to be supporting v2.10.x and later.
That being said, I don't think this is something that should be addressed in this PR. It's more of an FYI.
Once this is finalized, then I agree that we should have some processes around deprecations.
aeisenberg
left a comment
There was a problem hiding this comment.
Thanks. This is great.
| export class CliVersionConstraint { | ||
| // The oldest version of the CLI that we support. This is used to determine | ||
| // whether to show a warning about the CLI being too old on startup. | ||
| public static OLDEST_SUPPORTED_CLI_VERSION = new SemVer("2.7.6"); |
There was a problem hiding this comment.
We're working on finalizing our deprecation strategy and it's probably going to be the case that we only need to support 1 year's worth of old CLIs. Given that we do a minor version bump every 3 months (coinciding with GHES releases), we only need to be supporting v2.10.x and later.
That being said, I don't think this is something that should be addressed in this PR. It's more of an FYI.
Once this is finalized, then I agree that we should have some processes around deprecations.
|
I was mistaken about the supported versions. We need to go back to 2.8.x (ie- 2.7.x can be removed). See the docs for supported GHES versions. When GHES 3.9 is released (shortly), we can drop support for 2.8.x. |
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
This adds a warning when the user is using an unsupported version of the CodeQL CLI. The warning is shown once per session, and only if the version is older than the oldest supported version.
Checklist
ready-for-doc-reviewlabel there.