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

[api] allow ordering to be controlled on /search/requests #4108

Open
jberry-suse opened this issue Nov 3, 2017 · 2 comments
Open

[api] allow ordering to be controlled on /search/requests #4108

jberry-suse opened this issue Nov 3, 2017 · 2 comments

Comments

@jberry-suse
Copy link
Contributor

@jberry-suse jberry-suse commented Nov 3, 2017

It does not appear the ordering of results can be controlled.

when 'requests'
relation = BsRequest.all
attrib = AttribType.find_by_namespace_and_name('OBS', 'IncidentPriority')
# this join is only for ordering by the OBS:IncidentPriority attribute, possibly existing in source project
@joins = ["LEFT JOIN bs_request_actions req_order_action ON req_order_action.bs_request_id = bs_requests.id",
"LEFT JOIN projects req_order_project ON req_order_action.source_project = req_order_project.name",
"LEFT JOIN attribs req_order_attrib ON (req_order_attrib.attrib_type_id = '#{attrib.id}' AND req_order_attrib.project_id = req_order_project.id)",
"LEFT JOIN attrib_values req_order_attrib_value ON req_order_attrib.id = req_order_attrib_value.attrib_id"] << @joins
order = ["req_order_attrib_value.value DESC", :priority, :created_at]

For openSUSE/openSUSE-release-tools#1244 it is necessary to order by last updated (ie time last state element changed). Otherwise, all data has to be re-requested which is extremely sub-optimal.

If possible a generalized xpath based order parameter would be nice, but I would subtle for something one-off as well if agreeable.

@jberry-suse jberry-suse changed the title api: allow ordering to be controlled on /search/requests [api] allow ordering to be controlled on /search/requests Nov 3, 2017
@jberry-suse

This comment has been minimized.

Copy link
Contributor Author

@jberry-suse jberry-suse commented Jan 11, 2018

I do not have time to implement at the moment. I plan to simply run the full ingest once weekly instead of incremental daily.

@jberry-suse

This comment has been minimized.

Copy link
Contributor Author

@jberry-suse jberry-suse commented Jan 26, 2018

This would also be immensely useful for https://progress.opensuse.org/issues/25750.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.