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

Permit autoproj to perform configuration noninteractively by relying … #243

Merged
merged 1 commit into from
Mar 1, 2019

Conversation

2maz
Copy link
Member

@2maz 2maz commented Feb 22, 2019

…on the default values

Avoid the need for updating seed configurations when new configurations options are introduced to autoproj.

@planthaber
Copy link
Member

+1

Good change, makes maintaining CI way easier.

@g-arjones
Copy link
Contributor

In principle, I like the idea... I wonder if we should maybe skip saving the configuration if AUTOPROJ_NONINTERACTIVE is enabled and also maybe add a --no-interactive option in the CLI.

What do you guys think?

@2maz
Copy link
Member Author

2maz commented Feb 25, 2019

skip saving the configuration if AUTOPROJ_NONINTERACTIVE is enabled

what would be the use case, seed-configurations might still be used in combination with a non interactive mode

maybe add a --no-interactive option in the CLI.

+1 but maintaining the control through the env var

@g-arjones
Copy link
Contributor

what would be the use case

Automation tools and/or the vscode rock/autoproj extension during operations other than install/bootstrap. Also, this could be a fix/workaround for #200 but we would still want the user to be asked about the configuration in the future

but maintaining the control through the env var

Sounds good..

@planthaber
Copy link
Member

What do you think about to also set --no-color and --no-progress when AUTOPROJ_NONINTERACTIVE is set?

@2maz
Copy link
Member Author

2maz commented Feb 26, 2019

Automation tools and/or the vscode rock/autoproj extension during operations other than install/bootstrap. Also, this could be a fix/workaround for #200 but we would still want the user to be asked about the configuration in the future

Sorry, still not clear to me as to why you do not want to save the configuration.
From my (most likely limited) point of view, not to save the config means: you always want to stick to the defaults?
However, with non-interactive mode (for CI, unattended deployments ..) a user might still provide a seed-configuration to be used for the bootstrap.
This configuration should be applied and it should stick - independently of the changes to the defaults might be made.

@doudou
Copy link
Member

doudou commented Feb 27, 2019

This configuration should be applied and it should stick - independently of the changes to the defaults might be made.

This actually sounds weird. If non-interactive picks up defaults, then why don't you want to use the up-to-date defaults, in case they change ? Especially in CI, it would make sure that the default build actually builds...

I actually like @g-arjones idea of not saving the values (if it's reasonably easy to do), allowing to bootstrap non-interactively and then do a manual run to check the configuration(s). This seems compatible with having a seed file (which only consists of reading values, not writing them).

Finally, I would very much prefer that the flag is made available on the configuration object (Configuration#interactive?). I'd be fine to have it only through the envvar for now, but in the future, I'd also prefer being allowed to pass it explicitly on the command line and/or through the seed file (e.g. during bootstrap, the way --separate-prefixes works). Putting it on the configuration object would allow for this. Given that BuildOption is stored on a configuration object in the first place, this seems reasonably easy to do (have #interactive? on the object, and pass it as argument to #ask instead of implicitly through the env var).

Also, please write tests.

@doudou
Copy link
Member

doudou commented Feb 27, 2019

What do you think about to also set --no-color and --no-progress when AUTOPROJ_NONINTERACTIVE is set?

👎 You can run noninteractively in a terminal emulator that supports color and/or progress.

@2maz
Copy link
Member Author

2maz commented Feb 27, 2019

This actually sounds weird. If non-interactive picks up defaults, then why don't you want to use the up-to-date defaults, in case they change ? Especially in CI, it would make sure that the default build actually builds...

Well I did not say that. To be clear I am stressing the fact that the configuration options which a user sets explicitly via the seed-configuration should be maintained.
These should not change just because the default of an option has changed.
That is why have been asking for clarification on the issue of not saving "the configuration".
if @g-arjones is suggesting (and @doudou s response now implies this) to skip saving only those configuration options that are set through a fallback to default - then I am fully with you.

then do a manual run to check the configuration(s).

What is that supposed to mean?

Finally, I would very much prefer that the flag is made available on the configuration object (Configuration#interactive?). I'd be fine to have it only through the envvar for now, but in the future, I'd also prefer being allowed to pass it explicitly on the command line and/or through the seed file (e.g. during bootstrap, the way --separate-prefixes works). Putting it on the configuration object would allow for this. Given that BuildOption is stored on a configuration object in the first place, this seems reasonably easy to do (have #interactive? on the object, and pass it as argument to #ask instead of implicitly through the env var).

Sure, I can put something along these lines together

@g-arjones
Copy link
Contributor

Exactly what I meant, sorry for not being clear enough. I guess we are all on the same page then..

@doudou
Copy link
Member

doudou commented Feb 27, 2019

What is that supposed to mean?

Well ... start a non-interactive bootstrap/update/build and go to lunch. When you come back, run amake interactively, this time, and check the flags. You only need to rebuild stuff you would have changed.

@2maz 2maz force-pushed the autoproj_noninteractive branch from 6c0b5d7 to 0ab4107 Compare February 28, 2019 13:22
test/cli/test_reconfigure.rb Outdated Show resolved Hide resolved
@2maz
Copy link
Member Author

2maz commented Feb 28, 2019

Update: Implemented something that hopefully covers all mentioned requirements. I need some help for the test side, however, see comment above.

Copy link
Contributor

@g-arjones g-arjones left a comment

Choose a reason for hiding this comment

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

I don't see how you are skipping saving options that had defaults chosen due to non-interactive mode...

lib/autoproj/configuration.rb Outdated Show resolved Hide resolved
test/cli/test_reconfigure.rb Outdated Show resolved Hide resolved
@2maz
Copy link
Member Author

2maz commented Feb 28, 2019

I don't see how you are skipping saving options that had defaults chosen due to non-interactive mode...

sorry, apparently missed that one ..

@2maz 2maz force-pushed the autoproj_noninteractive branch from 0ab4107 to ff8fc94 Compare February 28, 2019 16:26
@2maz
Copy link
Member Author

2maz commented Feb 28, 2019

I don't see how you are skipping saving options that had defaults chosen due to non-interactive mode...

Added the feature ...

lib/autoproj/configuration.rb Outdated Show resolved Hide resolved
lib/autoproj/cli/base.rb Outdated Show resolved Hide resolved
@g-arjones
Copy link
Contributor

Other than a few style issues (@doudou will probably have something to say about those) I think we are good to go

@2maz 2maz force-pushed the autoproj_noninteractive branch from ff8fc94 to abeeb0e Compare February 28, 2019 17:06
Copy link
Member

@doudou doudou left a comment

Choose a reason for hiding this comment

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

Hey ... thanks for taking care of this. Just a few comments on my side.

lib/autoproj/cli/base.rb Outdated Show resolved Hide resolved
lib/autoproj/configuration.rb Outdated Show resolved Hide resolved
@2maz 2maz force-pushed the autoproj_noninteractive branch 3 times, most recently from 1c049fb to 9ec304d Compare March 1, 2019 13:00
lib/autoproj/workspace.rb Outdated Show resolved Hide resolved
@2maz 2maz force-pushed the autoproj_noninteractive branch from 9ec304d to 3b38b45 Compare March 1, 2019 13:46
@2maz 2maz force-pushed the autoproj_noninteractive branch from 3b38b45 to e862bf7 Compare March 1, 2019 15:48
@doudou doudou merged commit 3d2b11e into master Mar 1, 2019
@doudou doudou deleted the autoproj_noninteractive branch March 1, 2019 18:59
@doudou
Copy link
Member

doudou commented Mar 1, 2019

Thanks for the work Thomas !

@2maz
Copy link
Member Author

2maz commented Mar 1, 2019

got a bit meatier than I thought initially, but happy to had your reviews @doudou @g-arjones

@g-arjones
Copy link
Contributor

@2maz 👍

any time!

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.

4 participants