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

cli: show available cli upgrades with upgrade check command #1394

Merged
merged 14 commits into from
Apr 3, 2023

Conversation

msanft
Copy link
Contributor

@msanft msanft commented Mar 10, 2023

Proposed change(s)

Additional info

  • Possible follow-ups
    • Upgrade check command is in (urgent) need of a refactoring. Files are very large. See this AB ticket.
    • Custom version type should be used eventually. See this AB ticket.

Output of constellation upgrade check looks like:

The following updates are available with this CLI:
  Kubernetes: v1.25.7 --> v1.26.2
  CLI: v2.5.0 --> v2.6.0-pre.0.20230308113257-643afd38b347 v2.6.0-pre.0.20230309101241-15faa64ef6cc

Checklist

  • Add labels (e.g., for changelog category)
  • Link to Milestone

@msanft msanft added the feature This introduces new functionality label Mar 10, 2023
@msanft msanft added this to the v2.7.0 milestone Mar 10, 2023
@msanft msanft requested a review from derpsteb March 10, 2023 09:55
@msanft msanft requested a review from katexochen as a code owner March 10, 2023 09:55
@netlify
Copy link

netlify bot commented Mar 10, 2023

Deploy Preview for constellation-docs canceled.

Name Link
🔨 Latest commit 8505107
🔍 Latest deploy log https://app.netlify.com/sites/constellation-docs/deploys/642ac058f20fca00087ed6cf

@msanft
Copy link
Contributor Author

msanft commented Mar 10, 2023

Reminder @msanft : Rebase to main before merging for Bazel support

@derpsteb
Copy link
Member

Could you also extend the unittests for TestBuildString, newCompatibleCLIVersions and possibly TestUpgradeCheck?

LGTM apart from that :)

@msanft
Copy link
Contributor Author

msanft commented Mar 16, 2023

Could you also extend the unittests for TestBuildString, newCompatibleCLIVersions and possibly TestUpgradeCheck?

Sure, I totally forgot about the tests here. How would you go about testing newCompatibleCLIVersions? Should I put the internal calls to versionsapi behind an interface?

@msanft msanft force-pushed the feat/upgrade-show-cli-versions branch from 0d5401d to 9fd29c7 Compare March 16, 2023 09:25
@derpsteb
Copy link
Member

Yes, I think that is how I would do it :). Make versionFetcher a property of versionCollector. Then you can stub the calls to the API.

@msanft msanft requested a review from derpsteb March 17, 2023 11:01
@msanft msanft force-pushed the feat/upgrade-show-cli-versions branch from 5a5ab56 to ce62fdc Compare March 27, 2023 07:17
@msanft msanft requested a review from malt3 as a code owner March 27, 2023 08:00
@derpsteb
Copy link
Member

Summary of our conversation on the phone:
it probably makes more sense to only point the user to newer CLI versions in case the current CLI does not offer any more upgrades. So these are the required output formats.

Current CLI offers upgrades:

The following updates are available with this CLI:
 Kubernetes: v1.24.5 --> v1.24.12 v1.25.6
 Services: v2.4.0 --> v2.5.0
 Images: v2.4.0 --> v2.5.0
 Includes these measurements:
  4:
    expected: \"1234123412341234123412341234123412341234123412341234123412341234\"
    warnOnly: false
  8:
    expected: \"0000000000000000000000000000000000000000000000000000000000000000\"
    warnOnly: false
  9:
    expected: \"1234123412341234123412341234123412341234123412341234123412341234\"
    warnOnly: false
  11:
    expected: \"0000000000000000000000000000000000000000000000000000000000000000\"
    warnOnly: false
  12:
    expected: \"1234123412341234123412341234123412341234123412341234123412341234\"
    warnOnly: false
  13:
    expected: \"0000000000000000000000000000000000000000000000000000000000000000\"
    warnOnly: false
  15:
    expected: \"0000000000000000000000000000000000000000000000000000000000000000\"
    warnOnly: false

Current CLI offers no upgrades (apart from k8s), but newer CLIs are available:

The following updates are available with this CLI:
 Kubernetes: v1.24.5 --> v1.24.12 v1.25.6
Newer CLI versions that are compatible with your cluster are: v2.5.0.

There are newer CLIs, but none are compatible with the current k8s version:

The following updates are available with this CLI:
 Kubernetes: v1.24.5 --> v1.24.12 v1.25.6
There are newer CLIs available, however, you need to upgrade your cluster's Kubernetes version first.

No newer versions at all:

You are up to date.

@msanft msanft requested review from derpsteb and removed request for malt3 March 30, 2023 08:54
@derpsteb
Copy link
Member

derpsteb commented Mar 31, 2023

The output rework looks good, but this might need some further manual testing? Currently breaks for me due to missing cli.json in the bucket, when listing the major versions.

EDIT: everything worked as expected.

@msanft msanft force-pushed the feat/upgrade-show-cli-versions branch from 588d5e6 to cf08cbe Compare April 3, 2023 11:21
@msanft msanft requested a review from thomasten as a code owner April 3, 2023 11:48
@msanft msanft merged commit 46f5b17 into main Apr 3, 2023
@msanft msanft deleted the feat/upgrade-show-cli-versions branch April 3, 2023 12:31
@katexochen katexochen changed the title cli: show available cli upgrades on upgrade check command cli: show available cli upgrades on upgrade check command Apr 4, 2023
@katexochen katexochen changed the title cli: show available cli upgrades on upgrade check command cli: show available cli upgrades with upgrade check command Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This introduces new functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants