tmt icon indicating copy to clipboard operation
tmt copied to clipboard

Adjust on `provision.how`

Open LecrisUT opened this issue 1 year ago • 4 comments

Curiously I've found snippets like when: how == provision, but they are very cryptic in what they mean. What I am trying to do is add a venv construction step when provision.how == local.

LecrisUT avatar May 06 '24 06:05 LecrisUT

Something (plan?) probably sets the context dimension how to provision. There was how=full, there might be other cases. It's not working with live fmf data, extracting the dimension from an fmf node, it comes from outside as any other context dimension. No autopopulation of context from the current fmf node happens.

happz avatar May 06 '24 08:05 happz

You mean the adjust is done on the fmf files, not on the "merged" data that include tmt run -a provision ... steps?

LecrisUT avatar May 06 '24 08:05 LecrisUT

tmt asks fmf library to load fmf tree from a given path (and directories and files underneath that path), fmf loads data, combines them into a tree & returns the tree to tmt. Some time later, tmt calls the adjust() method of that fmf.Tree instance while giving it context to use when evaluating when, https://github.com/teemtee/tmt/blob/main/tmt/base.py#L2854

So, it's performed by fmf, tmt feeds it with context, and neither of them tries to understand the semantics of various keys like provision.how; for fmf it's way too high and tmt does not expose them in context.

happz avatar May 06 '24 08:05 happz

Ok, but that' reassuring, the adjust is done after tmt injects context (probably that's how distro works and sometimes not?), so we could provide a provision_how or equivalent context to be able to achieve such feature.

LecrisUT avatar May 06 '24 08:05 LecrisUT