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

/request/?view=collection - unable to query source/target project/package independently #13909

Open
dmach opened this issue Feb 27, 2023 · 2 comments
Labels
API Things regarding our API Feature Frontend Things related to the OBS RoR app

Comments

@dmach
Copy link
Contributor

dmach commented Feb 27, 2023

Issue Description

osc switched listing the requests from get_request_list() to get_request_collection().
That includes using GET /request/?view=collection instead of /search/request?match=....

Unfortunately it is no longer possible to query source/target project/package independently.
Example old queries:

/search/request?match=(state/@name='declined'+or+state/@name='new'+or+state/@name='review')+and+(action/target/@project='openSUSE:Tools')
/search/request?match=(state/@name='declined'+or+state/@name='new'+or+state/@name='review')+and+(action/target/@project='openSUSE:Tools'+or+action/source/@project='openSUSE:Tools')

Expected Result

Support querying target_project, source_project, target_package, source_package.
Unfortunately /request?view=collection&source_project=openSUSE:Tools&target_project=openSUSE:Tools usually implies that the resulting requests match the source_project AND the target_project, while I want OR.
Maybe /request?view=collection&project=openSUSE:Tools would match both source and target projects and I'd use the other fields only to query one of those explicitly.

@hennevogel
Copy link
Member

Hm, what's the reason to switch to view=collection if it does not what you want? :)

@hennevogel hennevogel added Feature Frontend Things related to the OBS RoR app labels Feb 27, 2023
@dmach
Copy link
Contributor Author

dmach commented Feb 27, 2023

Hm, what's the reason to switch to view=collection if it does not what you want? :)

$ cd osc && git blame 0b8f22b0c3fdc7c318dd4d79832bb72649540738 -- core.py
...
f7cfe4cdc osc/core.py (Adrian Schröter        2015-07-29 11:05:05 +0200 4511) # this function uses the logic in the api which is faster and more exact then the xpath search
f7cfe4cdc osc/core.py (Adrian Schröter        2015-07-29 11:05:05 +0200 4512) def get_request_collection(apiurl, role=None, req_who=None, req_states=('new', 'review', 'declined')):

The new API was supposed to be better and @adrianschroeter also thought it's a good idea to use it.
If it's not the case, I'm wondering what's purpose of /request/?view=collection, because it doesn't do what the other entry point can and (according to several relatively random queries I tried) seems to be even slower.

@eduardoj eduardoj added the API Things regarding our API label May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Things regarding our API Feature Frontend Things related to the OBS RoR app
Projects
None yet
Development

No branches or pull requests

3 participants