Allow querying the state of scheduled products by distri/version/flavor #6592
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This will allow us to check whether all jobs we scheduled for a certain purpose (e.g. product increment) are done and whether they have passed.
The details of the lookup are explained in the added API documentation.
The query for this is not super efficient as we don't have an index on the required columns on the scheduled products table. However, it seemed to be fast enough when I tested this with production data.
Related ticket: https://progress.opensuse.org/issues/184690
This is an alternative to #6589 which I have started for a hook script based approach. The code is only slightly different, though.
With the approach taken by this PR here we don't need any other changes on the openQA side except for what is provided by the PR right now. Some cron job (e.g. as part of
qem-bot
) will have to do the checking periodically if there's a pending product increment. However, checking e.g. every hour periodically is probably not that bad compared to adding a hook or event. This is because for a hook/event we would need to check after each job has finished whether the whole assigned scheduled product is finished - which is also lots of checks. (As mentioned on #6589 (comment) this would probably not scale very well.)This approach also solves the problem of considering only the most recent relevant product. With a hook-based or event-based approach this still needed to be solved in the hook script or event handler with a similar query/request than what is done in this PR with the nested query on scheduled products.
Considering the simplest solution seems to involve only adding a single route to openQA I was also checking whether we might just use an existing route.
I guess the best candidate is this one: https://openqa.suse.de/tests/overview.json?distri=sle&version=15.99&flavor=Online-Increments
I see a few downsides, though:
aggregated
could be used to check whether all jobs have passed or whether there are failures. However, we probably also want to mention a list of all failures somewhere and for this we would need to go though a much more nested structure here.&groupid=661
).I don't think any of these downsides would be a strong enough argument to not just use
overview.json
. However, together they add up so I tend to say that adding the new route is worthwhile.