[opensuse-buildservice] Searching for all packages that link to a package
I want to add a function to the api (on my local OBS), /search/links/<project>/<package>, that will return a collection of all packages that have _links to <project>/<package> (or indirectly link to <project>/<package> through multiple levels of _links). I want this so that users can query for other build targets when testing with a local build (e.g kernel-default is a link to kernel-source, so they should test kernel-default too when making a change to kernel-source). Right now I can accomplish this (pseudocode): for project, package in API("/search/package"): sources = API("/source/$project/$package") linkinfo = sources.find("linkinfo") linksTo = (linkinfo.get("project"), linkinfo.("package")) This works, but to search for what links to a given package I need to query all packages in the repository, which for our local instance is only 63 right now, but with each /source/$project/$package query taking 0.241 seconds, it takes 15 seconds to do this query. I'm hoping by doing it on the server it will be faster since there won't be as much back and forth traffic and/or the data is more readily searchable. My question is how do I go about adding this functionality, which files do I change to add /search/links to the API? Also, is it possible to use whatever the scheduler does to find linked packages since it somehow finds linked package when I check in source? For example, I check in kernel-source and both kernel-source and kernel-default (which is just a link to kernel-source) start building so something is supplying linking packages to the scheduler. --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
participants (1)
-
Luke Imhoff