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 switch command #3597

Conversation

EstebanBorai
Copy link
Contributor

Provides support to switch between Fluvio Versions using fvm switch command.
The fvm switch command performs a side effect which involves updating settings.toml
file in ~/.fvm which is used to keep track of the active channel and version.

Also updates the ~/.fvm/env file to include ~/.fluvio/bin in the host's PATH
when running source ~/.fvm/env.

Demo

demo.mp4

export PATH="$PATH:$HOME/.fvm/bin"
export PATH="$PATH:$HOME/.fvm/bin:$HOME/.fluvio/bin"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This allows the user to have both:

  • ~/.fvm/bin
  • ~/.fluvio/bin

In their PATH after executing source ~/.fvm/env

@EstebanBorai EstebanBorai marked this pull request as ready for review October 12, 2023 21:20
crates/fluvio-version-manager/src/command/switch.rs Outdated Show resolved Hide resolved
crates/fluvio-version-manager/src/command/switch.rs Outdated Show resolved Hide resolved
crates/fluvio-version-manager/src/command/switch.rs Outdated Show resolved Hide resolved
crates/fluvio-version-manager/src/command/switch.rs Outdated Show resolved Hide resolved
crates/fluvio-version-manager/src/command/switch.rs Outdated Show resolved Hide resolved
tests/cli/fvm_smoke_tests/fvm_basic.bats Outdated Show resolved Hide resolved
tests/cli/fvm_smoke_tests/fvm_basic.bats Show resolved Hide resolved
tests/cli/fvm_smoke_tests/fvm_basic.bats Show resolved Hide resolved
tests/cli/fvm_smoke_tests/fvm_basic.bats Show resolved Hide resolved
tests/cli/fvm_smoke_tests/fvm_basic.bats Show resolved Hide resolved
@EstebanBorai EstebanBorai marked this pull request as draft October 13, 2023 12:52
@EstebanBorai EstebanBorai force-pushed the 3596-fvm-switch-fluvio-versions branch from 2c506b7 to 5d03acc Compare October 13, 2023 13:05
@EstebanBorai
Copy link
Contributor Author

I just addressed suggestions here: 5d03acc!

@EstebanBorai EstebanBorai marked this pull request as ready for review October 13, 2023 13:38
@EstebanBorai EstebanBorai force-pushed the 3596-fvm-switch-fluvio-versions branch 2 times, most recently from c8f9ef2 to 313df57 Compare October 13, 2023 17:28
@EstebanBorai EstebanBorai force-pushed the 3596-fvm-switch-fluvio-versions branch 3 times, most recently from 65f2b91 to 4216b72 Compare October 13, 2023 19:04
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.

Much better. A just couple of issues on testing active

- Check manifest integrity by using a `VersionManifest` instance instead of
a `PathBuf` to the manifest
- Borrow over clone on `SwitchOpt` version
- Clarifications on procedures
- Isolate `update_settings_toml` to test independently
- Ensure files are copied to target directory
- Use string literal in tests for comparison
- Duplicate user's flow in E2E test
- Uses inline invalid Manifest JSON (impl `FromStr`)
- Readback `Settings` after create and assert on values
- Introduce fixtures for PackageSet
- Move `switch` logic to `VersionDirectory`
- Use hardcoded Shasums to test against
- Perform exact comparison for Sha256 Checksums
- Introduce `update_from_manifest` to update `settings.toml` form a `VersionManifest`
- Verify updates in `settings.toml` with E2E Smoke Tests
- Compare Sha256Sum on E2E Smoke Tests
- Move `Settings` `update_from_manifest` to `VersionManager`
- Use simple file to test shasums
- Explicit tests on single file
- Test settings is updated on `set_active`
@EstebanBorai EstebanBorai force-pushed the 3596-fvm-switch-fluvio-versions branch from 23d73d9 to d11f3e5 Compare October 14, 2023 01:49
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.

LGTM. Thanks for nice sets of unit testing and CLI testing.
Copying based switch need more testing and fundamentally only works for very small binaries. but this is good enough for now and resolve that question later

@EstebanBorai
Copy link
Contributor Author

LGTM. Thanks for nice sets of unit testing and CLI testing.

🙌🏻

Copying based switch need more testing and fundamentally only works for very small binaries. but this is good enough for now and resolve that question later

Looking forward into it!

@EstebanBorai
Copy link
Contributor Author

bors r+

bors bot pushed a commit that referenced this pull request Oct 14, 2023
Provides support to switch between Fluvio Versions using `fvm switch` command.
The `fvm switch` command performs a side effect which involves updating `settings.toml`
file in `~/.fvm` which is used to keep track of the active channel and version.

Also updates the `~/.fvm/env` file to include `~/.fluvio/bin` in the host's PATH
when running `source ~/.fvm/env`.

## Demo

https://github.com/infinyon/fluvio/assets/34756077/f81960ee-b557-4720-8691-8f4afb79a84f



Co-authored-by: Alan Chen <alan@infinyon.com>
@bors
Copy link

bors bot commented Oct 14, 2023

Build failed:

@EstebanBorai
Copy link
Contributor Author

Errors doesn't look related to PR: https://github.com/infinyon/fluvio/actions/runs/6520022049/job/17707174387#step:5:1107

So I will rerun!

@EstebanBorai
Copy link
Contributor Author

bors r+

bors bot pushed a commit that referenced this pull request Oct 14, 2023
Provides support to switch between Fluvio Versions using `fvm switch` command.
The `fvm switch` command performs a side effect which involves updating `settings.toml`
file in `~/.fvm` which is used to keep track of the active channel and version.

Also updates the `~/.fvm/env` file to include `~/.fluvio/bin` in the host's PATH
when running `source ~/.fvm/env`.

## Demo

https://github.com/infinyon/fluvio/assets/34756077/f81960ee-b557-4720-8691-8f4afb79a84f



Co-authored-by: Alan Chen <alan@infinyon.com>
@bors
Copy link

bors bot commented Oct 14, 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 switch command [Merged by Bors] - feat: fvm switch command Oct 14, 2023
@bors bors bot closed this Oct 14, 2023
This was linked to issues Oct 15, 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 - Switch Fluvio Versions Fluvio Version Manager
3 participants