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

Unable to upgrade an old version of the cli #443

Open
aeisenberg opened this issue Jun 11, 2020 · 5 comments
Open

Unable to upgrade an old version of the cli #443

aeisenberg opened this issue Jun 11, 2020 · 5 comments
Labels
bug Something isn't working VSCode

Comments

@aeisenberg
Copy link
Contributor

Describe the bug

When a user has an extremely old version of the cli, before the codeql version subcommand was implemented, there is an error when trying to check the version in the extension. Hence, the cli cannot be updated.

To Reproduce

Install a really old version of the cli and then run CodeQL: Check for CLI updates. It will fail to run. (Not sure what cli version causes this.)

Expected behavior

The CLI should be updated.

@aeisenberg aeisenberg added the bug Something isn't working label Jun 11, 2020
@aeisenberg
Copy link
Contributor Author

Currently, we are running this command in the extension to check for version:

./codeql version -v --log-to-stderr --format=terse

What version was this subcommand introduced in? And before that, the --version flag was available.

A potential solution is that we can try the original command and if that fails, we can run codeql --version and parse the results differently.

Another possibility is that we assume that there are no external users still using this old version and we ignore this problem.

@donokuda Can you post here what version you have?

@hmakholm Are you planning on removing the --version flag?

@donokuda
Copy link

Can you post here what version you have?

Here's what codeql --version returns for me

➜ ./codeql --version
CodeQL command-line toolchain.
Version: unnumbered early alpha/beta.
Copyright (C) 2019 GitHub, Inc.
Unpacked in: /Users/donokuda/Library/Application Support/Code/User/globalStorage/github.vscode-codeql/distribution/codeql
   Analysis results depend critically on separately distributed query and
   extractor modules. To list modules that are visible to the toolchain,
   use 'codeql resolve qlpacks' and 'codeql resolve list-languages'.

@hmakholm
Copy link
Contributor

codeql version -v --log-to-stderr --format=terse

should work right from the earliest public release. The codeql version subcommand was introduced in https://git.semmle.com/Semmle/code/pull/35091 before the public launch at GHU 2019.

@aeisenberg
Copy link
Contributor Author

Thanks, both of you. I'd guess that we will have no external users with this version. And since the first public release had the subcommand, I don't think this is a problem we need to deal with.

@aeisenberg
Copy link
Contributor Author

Reopening because I will put in a fix here. If we fail to run the version command for any reason, then we will return 0.0.0 for the version number in order to force an update. If this happens, presumably, the cli is really old or it is corrupted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working VSCode
Projects
None yet
Development

No branches or pull requests

4 participants