vscode-codeql icon indicating copy to clipboard operation
vscode-codeql copied to clipboard

Test Tab Not Loading in VSCode On codespaces

Open JLLeitschuh opened this issue 3 years ago • 2 comments

Describe the bug

When launching the CodeQL test viewer in VS Code connected to a GitHub Codespace, the test viewer dumps the following into the 'output' tab:

Starting GitHub.vscode-codeql extension
INFO: Could not find CodeQL on path.
INFO: Could not find CodeQL on path.
INFO: Could not find CodeQL on path.
Didn't perform CodeQL CLI update check since a check was already performed within the previous 86400 seconds.
INFO: Could not find CodeQL on path.
The CodeQL CLI could not be found.

When running echo $PATH within the GitHub codespace, I see the following:

/home/codespace/.rbenv/shims:/vscode/bin/linux-x64/899d46d82c4c95423fb7e10e68eba52050e30ba3/bin:/home/codespace/.nvm/current/bin:/home/codespace/.npm-global/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/codespace/.dotnet:/home/codespace/.dotnet/tools:/usr/local/sdkman/bin:/usr/local/sdkman/candidates/gradle/current/bin:/usr/local/sdkman/candidates/java/current/bin:/opt/maven/lts:/usr/local/cargo/bin:/usr/local/go/bin:/go/bin:/usr/local/py-utils/bin:/opt/conda/condabin:/home/codespace/.java/current/bin:/home/codespace/.nodejs/current/bin:/home/codespace/.php/current/bin:/home/codespace/.python/current/bin:/home/codespace/.ruby/current/bin:/home/codespace/.maven/current/bin:/home/codespace/.hugo/current/bin:/opt/oryx:/opt/nodejs/lts/bin:/opt/dotnet/lts:/opt/python/latest/bin:/opt/php/lts/bin:/opt/php-composer:/opt/yarn/stable/bin:/opt/hugo/lts::/opt/java/lts/bin:/opt/maven/lts/bin:/opt/ruby/lts/bin:/home/codespace/.local/bin:/usr/local/rvm/bin

Version

The CodeQL and VS Code version in which the bug occurs. CodeQL Plugin version: v1.5.10

Version: 1.63.2
Commit: 899d46d82c4c95423fb7e10e68eba52050e30ba3
Date: 2021-12-15T09:38:17.605Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin arm64 21.2.0

To reproduce

Checkout the github/codeql repository in GitHub codespaces. Then attempt to open the 'Tests' tab on the sidebar.

Expected behavior

I should see a tree of tests that I can execute.

Additional context

I recently added the following dotfile repository to my account. But all it does is install a font into GitHub Codespaces: https://github.com/jlleitschuh/dotfiles

JLLeitschuh avatar Jan 28 '22 19:01 JLLeitschuh

Manually executing the VS Code Action 'CodeQL: Check For CLI Updates' seems to have fixed this issue. However, I don't know why the plugin didn't just check for the CLI missing and automatically install it for me

JLLeitschuh avatar Jan 28 '22 19:01 JLLeitschuh

Thanks for the bug report.

This line is suspicious: Didn't perform CodeQL CLI update check since a check was already performed within the previous 86400 seconds.

Here's what I think is happening. The extension is configured to check for updates at most once/day. The last time the check happened is stored in global storage. Global storage is global to your vscode instance and is shared across remote workspaces (ie- codespaces) as well. If you are running your codespace in the desktop (not a browser), then it will avoid checking for updates if a local workspace has already checked within the last 24 hours.

A solution to this would be to store the last invocation time in workspace storage if the workspace is remote.

aeisenberg avatar Jan 28 '22 20:01 aeisenberg