Skip to content

Conversation

sharder996
Copy link
Collaborator

@sharder996 sharder996 commented Jul 18, 2022

This PR changes the long option for memory allocation of the launch command from --mem to --memory. --mem is still supported for backwards compatibility, but will not be displayed in the help text. If both options are used, --memory will take precedence.

Fixes #2490 for original change request.

Copy link
Contributor

@luis4a0 luis4a0 left a comment

Choose a reason for hiding this comment

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

Hey @sharder996, thanks!

Looks good, hiding the going-to-be-deprecated option seems the best choice to me.

One detail, though: I think that specifying --mem and --memory toghether must make Multipass to fail.

@sharder996
Copy link
Collaborator Author

If both options are used together, then --memory will be used @luis4a0

@codecov
Copy link

codecov bot commented Jul 18, 2022

Codecov Report

Merging #2668 (414db12) into main (10e328a) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2668      +/-   ##
==========================================
+ Coverage   86.46%   86.48%   +0.01%     
==========================================
  Files         217      217              
  Lines       10819    10833      +14     
==========================================
+ Hits         9355     9369      +14     
  Misses       1464     1464              
Impacted Files Coverage Δ
src/client/cli/cmd/launch.cpp 85.02% <100.00%> (+0.69%) ⬆️
src/client/cli/cmd/exec.cpp 99.05% <0.00%> (+0.02%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us.

@luis4a0
Copy link
Contributor

luis4a0 commented Jul 18, 2022

@sharder996 it seems you answered before I update my question. I didn't read that --memory takes precedence over --mem in the description, sorry for that.

My point is that, in case the user knows that there is a --memory parameter, we should fail saying that --mem must not be used. The point in leaving the old parameter is to allow for old scripts to be used, but I don't think we should permit using it interchangeably with the new parameter. I'm mentioning this in order to open a discussion, not yet to force a change in your code. What do you think?

@townsend2010
Copy link
Contributor

I think if both --mem and --memory are specified at the same time, that should be a failure since the user would be aware of --memory.

Also, to take this one step further, I think if --mem is only specified, a warning should be printed out saying --mem is being deprecated in favor of --memory and please update any scripts, etc.

@sharder996
Copy link
Collaborator Author

I like Chris' idea as it gives the user some head ups that the option will be having potentially breaking changes in the future rather than a silent change that still works.

@luis4a0
Copy link
Contributor

luis4a0 commented Jul 19, 2022

Hey @sharder996. Thanks, it's much better now!

A tiny bit of coverage remaining and we're done. Can you please add coverage to the error messages?

@luis4a0
Copy link
Contributor

luis4a0 commented Jul 20, 2022

Excellent, thanks @sharder996! A final detail: can you please change "in favor" to "in favour", so we use UK English in the output?

Copy link
Contributor

@luis4a0 luis4a0 left a comment

Choose a reason for hiding this comment

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

Excellent, thanks!

bors r+

bors bot added a commit that referenced this pull request Jul 20, 2022
2668: Change long option r=luis4a0 a=sharder996

This PR changes the long option for memory allocation of the `launch` command from `--mem` to `--memory`. `--mem` is still supported for backwards compatibility, but will not be displayed in the help text. If both options are used, `--memory` will take precedence.

Fixes #2490 for original change request.

Co-authored-by: sharder996 <[email protected]>
Co-authored-by: ScottH <[email protected]>
@bors
Copy link
Contributor

bors bot commented Jul 20, 2022

Timed out.

@sharder996
Copy link
Collaborator Author

bors r+

bors bot added a commit that referenced this pull request Jul 20, 2022
2667: Linux qemu uefi r=luis4a0 a=andrei-toterman

Make QEMU boot using UEFI on Linux

fix #1477 

2668: Change long option r=sharder996 a=sharder996

This PR changes the long option for memory allocation of the `launch` command from `--mem` to `--memory`. `--mem` is still supported for backwards compatibility, but will not be displayed in the help text. If both options are used, `--memory` will take precedence.

Fixes #2490 for original change request.

Co-authored-by: Andrei Toterman <[email protected]>
Co-authored-by: sharder996 <[email protected]>
Co-authored-by: ScottH <[email protected]>
@bors
Copy link
Contributor

bors bot commented Jul 20, 2022

Build failed (retrying...):

bors bot added a commit that referenced this pull request Jul 20, 2022
2668: Change long option r=sharder996 a=sharder996

This PR changes the long option for memory allocation of the `launch` command from `--mem` to `--memory`. `--mem` is still supported for backwards compatibility, but will not be displayed in the help text. If both options are used, `--memory` will take precedence.

Fixes #2490 for original change request.

Co-authored-by: sharder996 <[email protected]>
Co-authored-by: ScottH <[email protected]>
@bors
Copy link
Contributor

bors bot commented Jul 20, 2022

Build failed:

@luis4a0
Copy link
Contributor

luis4a0 commented Jul 21, 2022

bors retry

bors bot added a commit that referenced this pull request Jul 21, 2022
2668: Change long option r=sharder996 a=sharder996

This PR changes the long option for memory allocation of the `launch` command from `--mem` to `--memory`. `--mem` is still supported for backwards compatibility, but will not be displayed in the help text. If both options are used, `--memory` will take precedence.

Fixes #2490 for original change request.

Co-authored-by: sharder996 <[email protected]>
Co-authored-by: ScottH <[email protected]>
@bors
Copy link
Contributor

bors bot commented Jul 21, 2022

Build failed:

@luis4a0
Copy link
Contributor

luis4a0 commented Jul 21, 2022

bors retry

bors bot added a commit that referenced this pull request Jul 21, 2022
2668: Change long option r=sharder996 a=sharder996

This PR changes the long option for memory allocation of the `launch` command from `--mem` to `--memory`. `--mem` is still supported for backwards compatibility, but will not be displayed in the help text. If both options are used, `--memory` will take precedence.

Fixes #2490 for original change request.

Co-authored-by: sharder996 <[email protected]>
Co-authored-by: ScottH <[email protected]>
@bors
Copy link
Contributor

bors bot commented Jul 21, 2022

Build failed:

@luis4a0
Copy link
Contributor

luis4a0 commented Jul 21, 2022

bors retry

bors bot added a commit that referenced this pull request Jul 21, 2022
2668: Change long option r=sharder996 a=sharder996

This PR changes the long option for memory allocation of the `launch` command from `--mem` to `--memory`. `--mem` is still supported for backwards compatibility, but will not be displayed in the help text. If both options are used, `--memory` will take precedence.

Fixes #2490 for original change request.

Co-authored-by: sharder996 <[email protected]>
Co-authored-by: ScottH <[email protected]>
@bors
Copy link
Contributor

bors bot commented Jul 21, 2022

Build failed:

@luis4a0
Copy link
Contributor

luis4a0 commented Jul 22, 2022

Weird, as usual

bors retry

bors bot added a commit that referenced this pull request Jul 22, 2022
2668: Change long option r=sharder996 a=sharder996

This PR changes the long option for memory allocation of the `launch` command from `--mem` to `--memory`. `--mem` is still supported for backwards compatibility, but will not be displayed in the help text. If both options are used, `--memory` will take precedence.

Fixes #2490 for original change request.

Co-authored-by: sharder996 <[email protected]>
Co-authored-by: ScottH <[email protected]>
@bors
Copy link
Contributor

bors bot commented Jul 22, 2022

Build failed:

@townsend2010
Copy link
Contributor

We'll try this one more time since the other branch was out of sync...

bors retry

@bors
Copy link
Contributor

bors bot commented Jul 22, 2022

Build failed:

@townsend2010 townsend2010 merged commit 19b118a into main Jul 22, 2022
@bors bors bot deleted the allow-memory-option branch July 22, 2022 20:22
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.

multipass launch should allow --memory as a synonym of --mem
3 participants