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

Simplify CodeQL setup now that the last two releases have semver bundles #1761

Merged
merged 4 commits into from
Jul 7, 2023

Conversation

henrymercer
Copy link
Contributor

Now that the last two CLI versions have semantically versioned bundles, we no longer need to handle the case where the default version feature flags specify a version that doesn't have a semantically versioned bundle. As a result, we can reduce the complexity of the setup code!

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

The default version feature flags will now always point to a CLI version
with a semantically versioned bundle, so we can find the GitHub
Release directly from the CLI version.
Previously, this was useful for discriminating between different
`CodeQLDefaultVersion` instances. However now all instances return a
tag name.
@henrymercer henrymercer requested a review from a team as a code owner July 7, 2023 14:19
if (!codeqlFolder && (cliVersion || tagName)) {
if (cliVersion || tagName) {
if (!codeqlFolder && tagName) {
if (tagName) {

Check warning

Code scanning / CodeQL

Useless conditional Warning

This use of variable 'tagName' always evaluates to true.
Copy link
Contributor

@angelapwen angelapwen left a comment

Choose a reason for hiding this comment

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

🥳

url = await getCodeQLBundleDownloadURL(
tagName,
tagName!,
Copy link
Contributor

Choose a reason for hiding this comment

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

TIL about this operator 🤯

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not the best sign when you have to use it, but here it didn't seem worth refactoring the types :)

@henrymercer henrymercer merged commit 85c77f1 into main Jul 7, 2023
328 checks passed
@henrymercer henrymercer deleted the henrymercer/remove-fetching-releases-fallback branch July 7, 2023 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants