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

feat: include preview versions as fallback #674

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

bahkauv70
Copy link
Contributor

No description provided.

@bahkauv70 bahkauv70 force-pushed the feat/stackittpr-32-TFP-|-Allow-preview-SKE-versions-if-these-are-the-only-valid-ones branch from 7347ba3 to d05946a Compare February 10, 2025 17:07
}

if selectedVersion != nil {
deprecated = strings.EqualFold(*selectedVersion.State, VersionStateDeprecated)
Copy link
Member

@rubenhoenle rubenhoenle Feb 11, 2025

Choose a reason for hiding this comment

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

deprecated = strings.EqualFold(*selectedVersion.State, VersionStateDeprecated)

Maybe a newbie question, why do you do strings.EqualFold(...) here and in line 1998 you do it like this?

return *v.State == VersionStateSupported

Apart from the fact that there is isPreview() and isSupported(), but not isDeprecated()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Again a mixup of previously existing and newly written code. The difference is that EqualFold compares case-insensitive. However, I do not think this makes sense, as the predefined constants should match case-insensitve (they are part of the API contract). Therefore I remove the call to EqualFold to keep consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Additionally I've introduced a IsDeprecated helper function as well and replaced the checks consistently with the invocation of the helper functions. This makes the code considerably clearer

@bahkauv70 bahkauv70 force-pushed the feat/stackittpr-32-TFP-|-Allow-preview-SKE-versions-if-these-are-the-only-valid-ones branch from d9bc14e to ed57cbe Compare February 11, 2025 12:35
@bahkauv70 bahkauv70 force-pushed the feat/stackittpr-32-TFP-|-Allow-preview-SKE-versions-if-these-are-the-only-valid-ones branch from 6d4a9e0 to 98d2625 Compare February 11, 2025 13:10
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