#5113 API flags requests return wrong results
Opened 3 months ago by scfc. Modified 3 months ago

Currently, in the list at https://pagure.io/pagure/pull-requests:

https://pagure.io/pagure/pull-request/5105 has no flags,
https://pagure.io/pagure/pull-request/5043 has a flag "jenkins: failure",
https://pagure.io/pagure/pull-request/4974 has a flag "jenkins: error", and
https://pagure.io/pagure/pull-request/4549 has a flag "jenkins: success".

However, the corresponding API requests for the pull requests with flags:


all return an empty array as the "flags" value, where as the API request for the pull request without a flag:


returns two values. This corresponds to https://pagure.io/pagure/pull-request/5105 showing Jenkins "pending" and "failure" flags which are not shown in the list at https://pagure.io/pagure/pull-requests.

This is related to the change from API flags to commits flags introduced in 5.12: https://docs.pagure.org/pagure/changelog.html#id5. Basically API flags are being converted to commit flags but we kept some of the old behavior for backward compatibility (more precisely, this API endpoint, although I think we could migrate it, the UI in PR showing the flags on the right hand side column, section that will be removed in the future, likely in 6.0).

Metadata Update from @ngompa:
- Issue assigned to pingou
- Issue set to the milestone: 6.0
- Issue tagged with: bug, debt

3 months ago

Metadata Update from @ngompa:
- Issue tagged with: UI

3 months ago

Metadata Update from @ngompa:
- Issue untagged with: UI

3 months ago

What is a correct way to get a CI result of a PR, via API. Fetching info about commits, the latest commit, flags for that commit? How to recognize what flags originated in that PR?

See also https://pagure.io/pagure/issue/5104 - this problem also exists in the web UI.

Login to comment on this ticket.