[Avocado-devel] Multiplexer design recent discussions summary

Lukáš Doktor ldoktor at redhat.com
Wed Nov 25 16:34:32 UTC 2015


Dne 25.11.2015 v 17:15 Paolo Bonzini napsal(a):
>
>
> On 25/11/2015 16:39, Lukáš Doktor wrote:
>>
>>      --mux-mux $path[:true|false] -- to set the node as mux/nomux
>>      --mux-inject [$path:]key:value -- to set value (and create the node)
>>      --mux-cut $path -- remove any node (opposite of --mux-inject)
>
> --mux-remove?
that's better :D
>
>>      --mux-keep $path -- mux-cut siblings
>
> What's the usecase?
The same as filter-out vs. filter-only. Just convenience method to say 
this is the only node that should stay in the tree (eg. when you combine 
multiple yaml files and you don't know what other sibblings are there)

>
>>      --mux-out $path -- remove variants containing this path
>
> --mux-skip?
>
yep

>>      --mux-only $path -- mux-out siblings
>>
>> yaml:
>>
>>      !mux -- set the node as multiplexed
>>      !out : $path -- ignore variants with this $path
>
> !skip?
>
yep, either `!skip` or `!conflict`

>>      !only : $path -- !out siblings
>>
>> The `!out` can be translated to `mux-cut` by using your logic (find the
>> precursor which is a direct child of a !mux node and cut it out). So
>> `!out`/`!only` can be in fact realized by cutting, should that bring
>> some performance improvement.
>>
>> I don't see a benefit in implementing `!cut` and `!keep`, because it
>> doesn't make sense to me to allow people say "Yes, use this structure,
>> but remove some nodes from the result but just for this single variant".
>
> I think !remove makes sense.  I'm not sure what --mux-keep and !keep
> would be used for.
I really don't. Would you please show me an example where you have 
multiplex file and on a local scale (only for certain variant) you want 
to remove some nodes, which are not direct children of mux node? So 
something like:

```
     !mux
     machine: !mux
         x86_64:
         aarch64:
             !remove : /os/fedora/variants
     os: !mux
         fedora:
             variants: !mux
                 workstation:
                 server:
             releases: !mux
                 21:
                 22:
         gentoo:
```

The difference is that in this case you'll get values of 
`/os/fedora/releases`, but you won't get values from 
`/os/fedora/variants`. This just does not make sense to me, instead I'd 
use `!skip` which would result in no fedora variants on `aarch64`, or 
`!only : fedora/variants/server` to have only one variant of the fedora. 
But having fedora, without values from `variants` would be confusing to me.

As I said before, in most cases there is no difference between `!skip` 
and `!remove`. But so far I haven't found any example where `!remove` 
would produce better results, than `!skip` (I'm not talking about global 
scale and --mux-remove, it's useful for on-cmdline-patching) so I don't 
think we need to implement this tag for internal filters.

Lukáš

>
> Paolo
>




More information about the Avocado-devel mailing list