openSUSE / openSUSE-release-tools

Tools to aid in staging and release work for openSUSE/SUSE
GNU General Public License v2.0
61 stars 97 forks source link

Support package search in owner_fallback() and search package instead of binary in check_source #3046

Closed nilxam closed 8 months ago

nilxam commented 9 months ago

owner() supports two search mode: binary and package, the default one is binary, in some cases we should search package instead like for source checker.

The difference in API call is /search/owner?package=xxx vs. /search/owner?binary=xxx, try with livecd-openSUSE on binary search mode it gives empty collection since there is no binary matches livecd-openSUSE, with the package search mode, it gives the right result as searched by package name.

Vogtinator commented 8 months ago

IMO even that is wrong in some cases. Given prj and pkg, there are three ways to get "maintainers":

  1. /source/prj/pkg/_meta with fallbacks to prj, parent prj, ...
  2. /search/owner?package=pkg
  3. /search/owner?binary=pkg (does not make sense at all?)

And there's also /search/owner?project=prj&package=pkg which might or might not be equivalent to 1?

nilxam commented 8 months ago

IMO even that is wrong in some cases. Given prj and pkg, there are three ways to get "maintainers":

  1. /source/prj/pkg/_meta with fallbacks to prj, parent prj, ...
  2. /search/owner?package=pkg
  3. /search/owner?binary=pkg (does not make sense at all?)

Perhaps it makes sense in other usecases, like maintenance to check does the binary is maintained. That is not the case for check_source though. This change doesn't change the behavior for other usecases, only check_sources going to use mode=package.

And there's also /search/owner?project=prj&package=pkg which might or might not be equivalent to 1?

It does. It give a result of prj, parents prj until the top one per the given prj.

Interesting that, osc maintainer PKG triggers /search/owner?package=PKG, however osc maintainer PRJ PKG triggers /source/PRJ/PKG/_meta, it sounds like if a particular PRJ was to give(like in check_sources we find devel project already) then use package_role_expand() is a better option here.

nilxam commented 8 months ago

lets move back to https://github.com/openSUSE/openSUSE-release-tools/pull/3041 then

Vogtinator commented 8 months ago

The use case is too different between global package search, global binary search and prj/pkg lookup, so IMO separate methods would be clearer.