Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add /job_groups/id/build_results API route #5433

Merged
merged 2 commits into from Feb 7, 2024

Conversation

perlpunk
Copy link
Contributor

@perlpunk perlpunk commented Jan 23, 2024

Issue: https://progress.opensuse.org/issues/152939

I moved _map_tags_into_build into the compute_build_results() function.

The command lime to get the last "published" build would look like this:

    openqa-cli api job_groups/1/build_results only_tagged=1 limit_builds=1 \
      | jq -r '[.build_results[] | select(.tag.description=="published") | select(.version=="Tumbleweed") | .build ][0]'

To only get the latest build:

    openqa-cli api job_groups/1/build_results  limit_builds=1| jq -r '[.build_results[] | .build ][0]'

Only normal groups are supported, not parent groups, to keep it simple. I can go though our logs to see if the group_overview.json is ever called for parent groups.

I am seeing a problem with the documentation display of the new function when getting a 404. The documentation for the new function is displayed for +/job_groups/<group_id:num>/jobs GET as well as +/job_groups/<group_id:num>/build_results.
Maybe a bug in how Mojolicious renders the pod. I can't see anything wrong there.

Also I found a misdocumented route. I will open a seperate PR.

Still need to document this somewhere.

Copy link

codecov bot commented Jan 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8c66280) 98.37% compared to head (2dd03be) 98.38%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5433   +/-   ##
=======================================
  Coverage   98.37%   98.38%           
=======================================
  Files         389      389           
  Lines       37769    37827   +58     
=======================================
+ Hits        37157    37215   +58     
  Misses        612      612           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@okurz okurz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@Martchus
Copy link
Contributor

Martchus commented Jan 24, 2024

openqa-cli api job_groups/1/build_results | jq -r '[.build_results[] | .build ][0]'

So the limit_builds parameter is not supported (as on the UI route like this: https://openqa.suse.de/group_overview/110?limit_builds=1)? It would make sense to support the same set of parameters:

openqa-cli api job_groups/1/build_results?limit_builds=1

EDIT: Looks like this would actually already work.

Issue: https://progress.opensuse.org/issues/152939

I moved `_map_tags_into_build` into the `compute_build_results()` function.

The command lime to get the last "published" build would look like this:

    openqa-cli api job_groups/1/build_results only_tagged=1 limit_builds=1 \
      | jq -r '[.build_results[] | select(.tag.description=="published") | select(.version=="Tumbleweed") | .build ][0]'

To only get the latest build:

    openqa-cli api job_groups/1/build_results limit_builds=1 | jq -r '[.build_results[] | .build ][0]'
@perlpunk
Copy link
Contributor Author

perlpunk commented Feb 7, 2024

openqa-cli api job_groups/1/build_results?limit_builds=1

EDIT: Looks like this would actually already work.

I edited the commit message to include limit_builds

@perlpunk perlpunk marked this pull request as ready for review February 7, 2024 15:08
@mergify mergify bot merged commit 0421525 into os-autoinst:master Feb 7, 2024
41 checks passed
@perlpunk perlpunk deleted the latest-build branch February 8, 2024 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants