action #152939
closedcoordination #58184: [saga][epic][use case] full version control awareness within openQA
coordination #48641: [epic] Trigger openQA tests in pull requests of any product github pull request
Find "last build" of a product over API size:M
Description
Motivation¶
See
https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/18182#discussion_r1426859632
in https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/18182/files/3a35f9b2dae8ea461df44c580a8593393fcf0c99#diff-de0e4ae603aa915aebe97e563c4ffe51dfe10881cc9904c4dfe0c39faebbffd6R25
we need to find out a "latest build", similar as we do in
https://github.com/os-autoinst/os-autoinst-distri-openQA/blob/master/.github/workflows/openqa.yml#L27
which should be easier to get from openQA directly.
Added after QE Tools unblock session: 2024-01-17: We see the main customer value in having a stable API.
Acceptance criteria¶
- AC1: Both os-autoinst-distri-openQA+os-autoinst-distri-opensuse can use a
more simpleproper API route to find out the "last finished build"/"last published build" of a product on openQA test results - AC2: The purpose of the new API route is discoverable over at least one other route, e.g. mentioned in the documentation
Suggestions¶
- Read and understand both references from os-autoinst-distri-opensuse+openQA
- Add documentation of how the new API route will look like
- Add tests
- Implement
- Replace the code in both os-autoinst-distri-opensuse+openQA
- See https://github.com/os-autoinst/os-autoinst-distri-openQA/blob/80c9212d052ce5406b6020f2c18fbd2e314a4cc6/tests/osautoinst/start_test.pm#L13-L14
- At best create pull requests for both osdo+osda but having the PRs merged is not a hard requirement for this ticket
Further details¶
- "osdo" refers to os-autoinst-distri-opensuse
- "osda" refers to os-autoinst-distri-openQA
Updated by openqa_review 11 months ago
- Due date set to 2024-01-27
Setting due date based on mean cycle time of SUSE QE Tools
Updated by tinita 11 months ago
- Description updated (diff)
We discussed this today, and we have quite different use cases, and the ACs don't really reflect that and only talk about "finished" builds.
In the github worflow of distri-opensuse we select the last published build:
curl -s https://openqa.opensuse.org/group_overview/1.json
| jq -r '([ .build_results[] | select(.tag.description=="published") | select(.version=="Tumbleweed") | .build ] | sort | reverse)[]'
In our openQA-in-OpenQA tests we want the latest build by sort order, but don't care about published or finished and we only want a job and not the build itself:
resp=$(openqa-cli api --host $openqa_url jobs version=Tumbleweed scope=relevant arch='$arch' flavor=NET test='minimalx' latest=1)
job_id=$(echo "$resp" | jq -r '.jobs | max_by(.settings.BUILD) .id')
Looking for the published tag involves quite some work, so I would basically run pretty much the same code as in the group_overview, and maybe make the tag configurable.
Note that the group_overview is currently fetching all comments for a group in order to attach any found tags to the build list.
Maybe that's also the best approach for now, (because otherwise I would incrementally go over the latest builds and try to find a "published" tag for each of them until I find one). I guess the new route wouldn't be very performance critical for now.
I edited AC1
Updated by tinita 11 months ago
While looking through the _group_overview code I found a line that isn't used anymore:
https://github.com/os-autoinst/openQA/pull/5429 Remove obsolete entry from group_overview
Updated by tinita 10 months ago
- Status changed from In Progress to Workable
Draft: https://github.com/os-autoinst/openQA/pull/5433 Add /job_groups/id/build_results API route
Setting to Workable until thursday
Updated by tinita 10 months ago
- Status changed from In Progress to Resolved
https://github.com/os-autoinst/openQA/pull/5433 merged and working on o3:
% openqa-cli api --o3 job_groups/1/build_results time_limit_days=20 show_tags=1 limit_builds=10 only_tagged=1 | jq -r '[.build_results[] | select(.tag.description=="published") | select(.version=="Tumbleweed") | .build ][]'
20240206
20240205
20240204
20240202
20240201
20240131
20240130
20240129
20240128
20240126
Updated by tinita 10 months ago
https://github.com/os-autoinst/os-autoinst-distri-openQA/pull/161 Find latest build via API route
Updated by tinita 10 months ago
https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/18623 ci: Use API route to get latest build