[Avocado-devel] RFC: Configuration by convention

Cleber Rosa crosa at redhat.com
Tue Dec 3 19:35:06 UTC 2019


On Mon, Dec 02, 2019 at 04:57:28PM +0100, Lukáš Doktor wrote:
> Dne 02. 12. 19 v 15:30 Beraldo Leal napsal(a):
> > On Thu, Nov 28, 2019 at 04:00:17PM +0100, Lukáš Doktor wrote:
> >> Dne 21. 11. 19 v 22:23 Beraldo Leal napsal(a):
> >>> Motivation
> >>> ##########
> >>>
> >>> An Avocado Job is primarily executed through the `avocado run` command line.
> >>> The behavior of such an Avocado Job is determined by parsing the following
> >>> settings (listed in parsed order):
> >>>
> >>>  1) Default values in source code
> >>>  2) Configuration file contents
> >>>  3) Command-line options
> >>>
> >>
> >> I'm missing in this RFC some kind of mapping the above. I think if we
> >> are to do those intrusive changes, we should spend some time on
> >> specifying the relations. (but maybe I just missed it)
> > 
> > Not sure if I understood. What kind of relations do you suggest? Maybe
> > now, I'm missing something. The idea was to simply show the order that
> > options are parsed and overridden, just to give some context.
> > 
> 
> While talking about standardization of args/conf options I though it'd be nice to define some standard mapping to override configuration options from cmdline arguments. What I mean is eg the `--sysinfo`. Obviously it whouldn't fit everything, but would be nice to know that:
> 
> --sysinfo $VALUE
> 
> is the same as
> 
> ```
> [sysinfo.collect]
> enabled = $VALUE
> ```
> 
> and maps to:
> 
> {sysinfo: $VALUE}
> 
> job param. Obviously there would be exceptions, but we could create guidelines to cover most cases. Additionally even discussing this might help identify the sections/arguments.
>

Yes, this practical aspect of the proposal needs to be defined in a
clear way.  Examples will be important, and I reckon we'll have them
given that the point of "how to teach this to developers" was raised.

They'll be specially important for code reviewers, to avoid deviating
from the established convention.

- Cleber.




More information about the Avocado-devel mailing list