Project

General

Profile

Actions

action #152939

closed

coordination #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

Added by okurz 11 months ago. Updated 10 months ago.

Status:
Resolved
Priority:
Low
Assignee:
Category:
Feature requests
Target version:
Start date:
2023-12-27
Due date:
% Done:

0%

Estimated time:

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 simple proper 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

Further details

  • "osdo" refers to os-autoinst-distri-opensuse
  • "osda" refers to os-autoinst-distri-openQA
Actions #1

Updated by okurz 11 months ago

  • Target version changed from Tools - Next to Ready
Actions #2

Updated by livdywan 11 months ago

  • Subject changed from Find "last build" of a product over API to Find "last build" of a product over API size:M
  • Description updated (diff)
  • Status changed from New to Workable
Actions #3

Updated by tinita 11 months ago

  • Status changed from Workable to In Progress
  • Assignee set to tinita
Actions #4

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

Actions #5

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

Actions #6

Updated by okurz 11 months ago

  • Description updated (diff)
Actions #7

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

Actions #8

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

Actions #9

Updated by okurz 10 months ago

  • Due date deleted (2024-01-27)
  • Priority changed from Normal to Low
Actions #10

Updated by tinita 10 months ago

  • Status changed from Workable to In Progress
Actions #11

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
Actions #12

Updated by tinita 10 months ago

  • Status changed from Resolved to In Progress

Actually I think I can make PRs for using it as well

Actions #14

Updated by tinita 10 months ago

Actions #15

Updated by tinita 10 months ago

  • Status changed from In Progress to Resolved

Both PRs merged

Actions

Also available in: Atom PDF