Hello,
I was looking at the Validate Outdated Container plugin and I was wondering if there was anyway to make it work for approved versions, but from what I read in the code there isn’t, correct me if I’m wrong.
If this is the case, do you have any plans to enhance it so that it can be activated only for certain statuses (like approved versions)? otherwise we may get a false positive if there is a not-approved latest version. I have checked the feedback page and the PRs but I couldn’t find anything there.
Thank you,
I think it’s not supported currently - but recall seeing it on the backlog at some point. Can’t find an existing ticket at https://feedback.ayon.app/ either though.
Thank you for your response @BigRoy
I have been looking at a possible PR and it seems like doing it would be on the easy side, but I would need to also PR the ayon-python-api.
In my mind it would be something like this.
- PR
ayon-python-api so that the ayon_api._api.get_last_versions function accepts the statuses argument for filtering, this seems easy as it is just passing down this kwarg until it reaches the VersionsAPI.get_version instance method.
- PR
ayon-core so that the pipeline.load.utils.filter_containers passes on an optional list of statuses read from the settings when it calls ayon_api.get_latests_versions.
So I’ll probably do that unless there is something crazy in my reasoning here.
Sounds about right.
About point two I’m not sure if filter_containers should be reading the settings though. I think it should just allow passing statuses to allow as an optional argument, but have the setting be read by Validate Outdated Containers and plugging that in as the optional value.
Seems iffy if filter_containers would start behaving differently from settings by itself, and I’d rather also not change the default existing functionality.
@iLLiCiT thoughts?
1 Like
There were recently some requests on version pinning…which overlaps with this request as it would generally allow user to cherrypick and pin product(s) and its version so it wouldnt switch to any available version during update action…
So it may event. happen in near future…
Thank you both. You are right, I may need to hold up my horses here, it turns out the first step is not that trivial, as the GraphQL latestOnly query parameter is also involved in the VersionsAPI.get_version call. If both latestOnly and statuses are passed, this function will only return a version if it is both latest and has a matching status, which means that for filtering the latest version of a given status I would need to create branches in the logic and have a different call that fetches all versions of a status and pick up the latest by date, or something along those lines anyway.
Something like this does the trick for us… I would need to know where you guys want to have the “enable validate approved containers” bool in the settings, but I don’t know how OK is this fast mod with the Ynput’s standards if this was to become a PR.
Any thoughts?
I would suggest to make a PR, it is easier to discuss code in code realm. I think there is a merit, but I think the implementation needs modifications, which is hard to discuss if it’s not in github.