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

WIP: Always use backend response for requests to source/:project_name #16955

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

krauselukas
Copy link
Contributor

@krauselukas krauselukas commented Oct 15, 2024

Right now we use the presence of the ?deleted=0 query parameter
as a workaround to force the request being passed directly to the
backend and returning results based on backend data over returning
results based on frontend database entries.

This workaround currently leads to inconsistant results being returned
by the API.

Instead of using this workaround we better should always
let the backend handle the request (where possible) and return
the data based on it's info.

Fixes #16911
Replaces #16928

So in short, after introducing this change we always deliver what ?delete=0 was doing before.

@krauselukas krauselukas added Frontend Things related to the OBS RoR app API Things regarding our API labels Oct 15, 2024
end

def render_project_issues
set_issues_defaults
render partial: 'source/project_issues', formats: [:xml]
end

def render_project_packages
@packages = params.key?(:expand) ? @project.expand_all_packages : @project.packages.pluck(:name)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the expand parameter can be handled by the backend as well

@krauselukas krauselukas changed the title Always use backend response for requests to source/:project_name WIP: Always use backend response for requests to source/:project_name Oct 15, 2024
@krauselukas
Copy link
Contributor Author

Set back to WIP since the minitests indicated some gaps...

Right now we use the presence of the `?deleted=0` query parameter
as a workaround to force the request being passed directly to the
backend and returning results based on backend data over returning
results based on frontend database entries.

This workaround currently leads to inconsistant results being returned
by the API.

Instead of using this workaround we better should always
let the backend handle the request (where possible) and return
the data based on it's info.

Fixes openSUSE#16911
In this case we want the return to avoid double render errors.
# This implicitly also checks if the user can access the project (for hidden projects).
# We have to make sure to initialize the project already at this
# point, even we dont need the object in most cases because of that fact.
# TODO: Don't implicitly use the finder logic to authorize!
Copy link
Contributor Author

Choose a reason for hiding this comment

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

After changing the `source/:project_name` to always pass the
request to the backend, the `count` attribute is not longer
part of the `directory` tag. This was only included by the frontend.
Since we now always get the info from the backend on
`source/:project_name` the multibuild flavors are included as well.
We have to skip those when querying for
`source/:project_name/:package_name/_meta` since multibuild flavors
dont have their own meta file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Things regarding our API Frontend Things related to the OBS RoR app
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API inconsistency of the GET /source/{prj_name} route with deleted=0 parameter showing multibuild packages
1 participant