Skip to content

Add warning when using unsupported CLI version#2428

Merged
koesie10 merged 5 commits intomainfrom
koesie10/unsupported-cli-version-check
May 22, 2023
Merged

Add warning when using unsupported CLI version#2428
koesie10 merged 5 commits intomainfrom
koesie10/unsupported-cli-version-check

Conversation

@koesie10
Copy link
Copy Markdown
Member

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.

Screenshot 2023-05-17 at 16 26 19

Checklist

  • CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • Issues have been created for any UI or other user-facing changes made by this pull request.
  • [Maintainers only] If this pull request makes user-facing changes that require documentation changes, open a corresponding docs pull request in the github/codeql repo and add the ready-for-doc-review label there.

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.
@koesie10 koesie10 requested a review from a team May 17, 2023 14:26
@koesie10 koesie10 requested a review from a team as a code owner May 17, 2023 14:26
Copy link
Copy Markdown
Contributor

@shati-patel shati-patel left a comment

Choose a reason for hiding this comment

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

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");
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.

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!)

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.

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.

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.

Do we need some docs/process somewhere to make sure this is updated when the oldest supported version is updated?

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.

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.

Copy link
Copy Markdown
Contributor

@shati-patel shati-patel left a comment

Choose a reason for hiding this comment

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

Nice! :shipit: 🎈

@koesie10 koesie10 enabled auto-merge May 17, 2023 15:12
Copy link
Copy Markdown
Contributor

@aeisenberg aeisenberg left a comment

Choose a reason for hiding this comment

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

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");
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.

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
Copy link
Copy Markdown
Contributor

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.

@koesie10 koesie10 merged commit 189a132 into main May 22, 2023
@koesie10 koesie10 deleted the koesie10/unsupported-cli-version-check branch May 22, 2023 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants