-
Notifications
You must be signed in to change notification settings - Fork 392
Fix tools: linked
log message
#3139
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -298,31 +298,6 @@ export async function getCodeQLSource( | |
}; | ||
} | ||
|
||
/** | ||
* Whether the tools shipped with the Action, i.e. those in `defaults.json`, have been forced. | ||
* | ||
* We use the special value of 'linked' to prioritize the version in `defaults.json` over the | ||
* version specified by the feature flags on Dotcom and over any pinned cached version on | ||
* Enterprise Server. | ||
* | ||
* Previously we have been using 'latest' to force the shipped tools, but this was not clear | ||
* enough for the users, so it has been changed to `linked`. We're keeping around `latest` for | ||
* backwards compatibility. | ||
*/ | ||
const forceShippedTools = | ||
toolsInput && CODEQL_BUNDLE_VERSION_ALIAS.includes(toolsInput); | ||
if (forceShippedTools) { | ||
logger.info( | ||
`'tools: ${toolsInput}' was requested, so using CodeQL version ${defaultCliVersion.cliVersion}, the version shipped with the Action.`, | ||
); | ||
|
||
if (toolsInput === "latest") { | ||
logger.warning( | ||
"`tools: latest` has been renamed to `tools: linked`, but the old name is still supported. No action is required.", | ||
); | ||
} | ||
} | ||
|
||
/** CLI version number, for example 2.12.6. */ | ||
let cliVersion: string | undefined; | ||
/** Tag name of the CodeQL bundle, for example `codeql-bundle-20230120`. */ | ||
|
@@ -344,9 +319,33 @@ export async function getCodeQLSource( | |
toolsInput = await getNightlyToolsUrl(logger); | ||
} | ||
|
||
/** | ||
* Whether the tools shipped with the Action, i.e. those in `defaults.json`, have been forced. | ||
* | ||
* We use the special value of 'linked' to prioritize the version in `defaults.json` over the | ||
* version specified by the feature flags on Dotcom and over any pinned cached version on | ||
* Enterprise Server. | ||
* | ||
* Previously we have been using 'latest' to force the shipped tools, but this was not clear | ||
* enough for the users, so it has been changed to `linked`. We're keeping around `latest` for | ||
* backwards compatibility. | ||
*/ | ||
const forceShippedTools = | ||
toolsInput && CODEQL_BUNDLE_VERSION_ALIAS.includes(toolsInput); | ||
|
||
if (forceShippedTools) { | ||
cliVersion = defaults.cliVersion; | ||
tagName = defaults.bundleVersion; | ||
|
||
logger.info( | ||
`'tools: ${toolsInput}' was requested, so using CodeQL version ${cliVersion}, the version shipped with the Action.`, | ||
); | ||
|
||
if (toolsInput === "latest") { | ||
logger.warning( | ||
"`tools: latest` has been renamed to `tools: linked`, but the old name is still supported. No action is required.", | ||
); | ||
} | ||
Comment on lines
+333
to
+348
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As discussed elsewhere, it was confusing for review purposes that this moved down here, which is because |
||
} else if (toolsInput !== undefined) { | ||
// If a tools URL was provided, then use that. | ||
tagName = tryGetTagNameFromUrl(toolsInput, logger); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Not something introduced by this PR, but I am not super keen on this rewriting of
toolsInput
from an alias to a URL. It makes it harder than necessary to follow what this function does. I think ideally this would be a functionresolveToolsAlias
that always returns a URL by either resolving the alias or returning the URL unchanged.