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

Hack to avoid CodeQL CLI v2.12.3 #2126

Merged
merged 1 commit into from
Mar 1, 2023
Merged
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
15 changes: 15 additions & 0 deletions extensions/ql-vscode/src/distribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,15 @@ class ExtensionSpecificDistributionManager {
const extensionSpecificRelease = this.getInstalledRelease();
const latestRelease = await this.getLatestRelease();

// v2.12.3 was released with a bug that causes the extension to fail
// so we force the extension to ignore it.
if (
extensionSpecificRelease &&
extensionSpecificRelease.name === "v2.12.3"
Comment on lines +321 to +322
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor:

Suggested change
extensionSpecificRelease &&
extensionSpecificRelease.name === "v2.12.3"
extensionSpecificRelease?.name === "v2.12.3"

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like at this point, we are guaranteed that 2.12.2 was not chosen since it is already being filtered out in this.getLatestRelease(). Is that true?

Copy link
Contributor Author

@charisk charisk Mar 1, 2023

Choose a reason for hiding this comment

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

extensionSpecificRelease is installed version though I think. So basically this is for the scenario where the user is already on v2.12.3.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mean 2.12.2 or 2.12.3?

I agree it should be the case that latestRelease cannot be 2.12.3 since it should be considered incompatible and get filtered out. Even if you're already on 2.12.3 it'll report 2.12.2 as the latest.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mean 2.12.2 or 2.12.3?

Yes. :)

) {
return createUpdateAvailableResult(latestRelease);
}

if (
extensionSpecificRelease !== undefined &&
codeQlPath !== undefined &&
Expand Down Expand Up @@ -430,6 +439,12 @@ class ExtensionSpecificDistributionManager {
this.versionRange,
this.config.includePrerelease,
(release) => {
// v2.12.3 was released with a bug that causes the extension to fail
// so we force the extension to ignore it.
if (release.name === "v2.12.3") {
return false;
}

const matchingAssets = release.assets.filter(
(asset) => asset.name === requiredAssetName,
);
Expand Down