Open kkaarreell opened 3 months ago
enabled
is completely ignored by plan.import
. I think there was a discussion on that when it was initially implemented.
No, it is supported.
https://github.com/teemtee/tmt/commit/0bbd0ec25082e473643684e000685b01ba659285
But the problem here is that git clone
of the imported plan is happening before the plan is disabled.
For reference, this is how the enabled
key is handled during import
:
The imported plan can also be altered using the enabled key. If the local plan is enabled, it will follow the status of the remote plan – whether it’s enabled or disabled. If the local plan is disabled, the remote plan will also be disabled. Adjust rules are respected during this process.
I can imagine that the imported plan may have also some adjust rules impacting plan status.
Yes, adjust rules from the remote plans are applied. Even if the plan is disabled, we're always trying to fetch the details, unless for example --shallow
option is used for tmt plan ls
and friends.
Not sure how to approach this, as for tmt plan show
even disabled plan should be fetched (always), but for the tmt run
use case, probably all plans with enabled: false
should be ignored right away.
Perhaps, for the tmt run
case we could do a shallow
check for existing plans first? And then fetch all details for plans which are enabled?
I was trying to add a condition around a test plan import but it didnt' work as expected. E.g. this example with bogus url produces
git clone
error despite the plan being disabled.Maybe the above is expected. I basically wanted to avoid fetching an internal URL for distros like Fedora or CS. For now I ended up with this which seems to work but looks unnecessarily complicated
I am wondering if there is effectively any difference between these two approaches when the 1st one is doing the import early while the later one late. I can imagine that the imported plan may have also some adjust rules impacting plan status.