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 count attribute to directory xml tag for source/:project backend response #17338

Open
krauselukas opened this issue Feb 4, 2025 · 0 comments
Labels
Backend Things regarding the OBS backend Bug Feature

Comments

@krauselukas
Copy link
Contributor

krauselukas commented Feb 4, 2025

Is your feature request related to a problem? Please describe.

This feature request is related to an issue (P2) that is currently open for the OBS frontend #16911.
As stated in the linked issue, there are inconsistent results querying the GET /source/{prj_name} route on the OBS frontend API side.
In short, there is currently a workaround for this endpoint implemented. By using the query parameter ?deleted=0 we can "force" the OBS frontend API to always pass the request to the backend and answer based on its data. Without ?deleted=0 the response will be send based on frontend DB data.
One of the problems right now with this, there are cases for example with remote projects/interconnect where this leads to inconsistencies as described here #16911 (comment)

Describe the solution you'd like

One suggested solution to avoid inconsistencies here is to simply always let the backend answer #16911 (comment)
This approach is implemented in this PR #16955

The only problem with this right now is that the OBS frontend used to include the count attribute in the directory root tag of the xml response. The backend doesn't.

Backend Response:

<directory>
  <entry name="adipisci"/>
  <entry name="amet"/>
  <entry name="another_package_with_diff_1738598891_0_1"/>
  <entry name="another_package_with_diff_1738598891_0_2"/>
  <entry name="asperiores"/>
  <entry name="aspernatur"/>
  ...
</directory>

Frontend Response

<directory count="47">
  <entry name="adipisci"/>
  <entry name="amet"/>
  <entry name="another_package_with_diff_1738598891_0_1"/>
  <entry name="another_package_with_diff_1738598891_0_2"/>
  <entry name="asperiores"/>
  <entry name="aspernatur"/>
  ...
</directory>

This attempt breaks multiple minitests like

assert_xml_tag(tag: 'directory', attributes: { count: '1' })
and simply dropping the count attribute might be an API change that breaks tooling of users.

My suggested solution would be to include the count attribute in the backend xml response for source/:project in order to solve the issue without the introduction of breaking changes on the frontend API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend Things regarding the OBS backend Bug Feature
Projects
None yet
Development

No branches or pull requests

1 participant