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

[Merged by Bors] - feat: fvm show and fvm current command #3601

Closed

Conversation

EstebanBorai
Copy link
Contributor

@EstebanBorai EstebanBorai commented Oct 16, 2023

Introduces two utility commands for FVM used to check on the active version and
listing installed versions.

Use fvm current to print the active Fluvio Version and use fvm show to list
installed Fluvio versions.

Demo

CleanShot.2023-10-16.at.15.44.58.mp4

@EstebanBorai EstebanBorai marked this pull request as ready for review October 16, 2023 18:48
let ver_b = Channel::parse("0.10.13").unwrap();
let ver_b = Channel::parse("0.10.13-mirroring347239873+20231016").unwrap();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update test to validate tags support.

This was linked to issues Oct 16, 2023
Copy link
Contributor

@sehz sehz left a comment

Choose a reason for hiding this comment

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

Overall look reasonable. Couple of questions on why additional info for manifest is necessary.

/// If theres any Active Version, the [`VersionManifest`] is not included
/// as part of the first tuple value, instead it is returned as the second
/// tuple value.
fn scan_versions_manifests(
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be moved to version manager or version directory?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also thought about it but I as well, but I found the use case strongly tied to the purpose of fvm show.

Given that this function not only takes the manifest from VersionDirectory in the process of walking a directory, but it also puts apart the active version, so fvm show can render the check symbol later on.

I could move tho scan logic to be part of VersionDirectory and return the vector filled with all version directories, but then I would have to loop into this vector a second time to retrieve the active version and split it from the rest to provide it to fn render_table(manifests: Vec<VersionManifest>, maybe_active: Option<VersionManifest>).

Copy link
Contributor

Choose a reason for hiding this comment

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

Issue is that this now has knowledge of internals of the versions, manifest. This needs to move there

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it! Migrating to VersionDirectory

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here it is! 8c1db1c

@ajhunyady
Copy link
Contributor

ajhunyady commented Oct 16, 2023

@EstebanBorai after install, fvm should automatically switch to the version installed. The video shows that as a manual step. This should be true for the first version installed (stable).

Not sure about subsequent versions @sehz ?

@sehz
Copy link
Contributor

sehz commented Oct 16, 2023

@EstebanBorai after installation, active version should be stable by default. Also, after installing new version, that version should be set as active. Current demo requires explicit switch

@EstebanBorai
Copy link
Contributor Author

Thanks for asking @ajhunyady and @sehz!

In my video Im showing commands with the build of FVM I had locally. In production users will have FVM installed via our cURL install.sh script which will also install Fluvio and set it up as active by default.

In practice, users running:

curl -fsS https://hub.infinyon.cloud/install/install.sh | bash

Will:

  • Have fvm installed
  • Have fluvio stable installed and set as active (Equivalent to fvm install && fvm switch stable)

With regards to setting as default after install, initially we designed a "no side effects" implementation which makes every command atomic.

But I think we could introduce fvm install --switch/-s <VERSION>? Which installs and sets that version as active? I could work a separate iteration for that as it needs some work to make fvm switch command logic reusable by fvm install.

@ajhunyady
Copy link
Contributor

ajhunyady commented Oct 16, 2023

install should perform switch under the hood. You can do --no-switch if required, but I don't see a use case for that.

This feedback is on the usability not internal design decisions. Note, usability comes first, and the appropriate design should follow.

/// If theres any Active Version, the [`VersionManifest`] is not included
/// as part of the first tuple value, instead it is returned as the second
/// tuple value.
fn scan_versions_manifests(
Copy link
Contributor

Choose a reason for hiding this comment

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

Issue is that this now has knowledge of internals of the versions, manifest. This needs to move there

@sehz
Copy link
Contributor

sehz commented Oct 16, 2023

But I think we could introduce fvm install --switch/-s <VERSION>? Which installs and sets that version as active? I could work a separate iteration for that as it needs some work to make fvm switch command logic reusable by fvm install.

Yes, that can be done in separate PR. But switch flag is not necessary. Also assume switch to installed version

Copy link
Contributor

@sehz sehz left a comment

Choose a reason for hiding this comment

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

K. LGTM. Please update install logic to switch to version in next PR

@ajhunyady
Copy link
Contributor

ajhunyady commented Oct 16, 2023

@EstebanBorai please file a new issue with left-over items and add to tracking issue #3537 so we don't lose them.

@EstebanBorai EstebanBorai linked an issue Oct 16, 2023 that may be closed by this pull request
20 tasks
@ajhunyady ajhunyady mentioned this pull request Oct 16, 2023
20 tasks
@EstebanBorai
Copy link
Contributor Author

bors r+

bors bot pushed a commit that referenced this pull request Oct 17, 2023
Introduces two utility commands for FVM used to check on the active version and
listing installed versions.

Use `fvm current` to print the active Fluvio Version and use `fvm show` to list
installed Fluvio versions.

## Demo

https://github.com/infinyon/fluvio/assets/34756077/a2327a63-1d9e-4ceb-86d3-02522de0aa42
@bors
Copy link

bors bot commented Oct 17, 2023

Build failed:

@morenol
Copy link
Contributor

morenol commented Oct 17, 2023

bors r+

bors bot pushed a commit that referenced this pull request Oct 17, 2023
Introduces two utility commands for FVM used to check on the active version and
listing installed versions.

Use `fvm current` to print the active Fluvio Version and use `fvm show` to list
installed Fluvio versions.

## Demo

https://github.com/infinyon/fluvio/assets/34756077/a2327a63-1d9e-4ceb-86d3-02522de0aa42
@bors
Copy link

bors bot commented Oct 17, 2023

Pull request successfully merged into master.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title feat: fvm show and fvm current command [Merged by Bors] - feat: fvm show and fvm current command Oct 17, 2023
@bors bors bot closed this Oct 17, 2023
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.

FVM - Display active version FVM - List Installed Versions Fluvio Version Manager
4 participants