On Friday 02 of November 2012 12:03:28 Johannes Renner wrote: > On 11/01/2012 01:59 PM, Tomas Lestach wrote: > > On Wednesday 31 of October 2012 15:00:48 Johannes Renner wrote: > >> Hello, > >> > >> We found that the list of installable packages for a given system differs > >> if you either ask the API (via system.listLatestInstallablePackages) or > >> if you go to the Web UI (Systems -> [choose a system] -> Software -> > >> Packages -> Install). > >> > >> After looking into it, I found there is two different queries used for > >> this > >> (both to be found in Package_queries.xml): > >> > >> 1. system_latest_all_available_packages (API) > >> 2. system_available_packages (Web UI) > >> > >> My questions: > >> > >> - Query (1.) seems to return all available versions of a package, which > >> means 'all' rather than 'latest'? I think we could have two separate API > >> calls, one for 'latest' and one for 'all', but 'latest_all'? > > > > Right, the naming is strange. > > > >> - Shouldn't we use the same query for API and Web UI in order to get the > >> same results here? > > > > I'd say we do not want to get the same results. > > As people are used to the WebUI, they may select and install any version > > of an available package. I wouldn't change that. > > > > If an API is called listLatestInstallablePackages, it shall definitelly > > return list of *latest* installable packages. > > > > But what we could do is we can introduce a > > listAllInstallablePackages/listAvailableInstallablePackages API, that > > could > > reuse the WebUI query. :-) > > Haha, yes, good idea ;-) >
Hello Johannes, > So, IIUC this is the situation summarized: > > The current API call needs to continue to exist as it is, the method declaration - yes > but you agree that > the naming of the API call, as well as the query name, is strange. yes > > To fix this, we would actually rename the existing API call to something > more 'correct', like e.g. 'listAllInstallablePackages'. Further we could > change the semantics of 'listLatestInstallablePackages' in a way that it > reuses the WebUI query and thus will return the same results as the WebUI > itself. > > The only problem is that we are most likely not supposed to change the > semantics of an existing API call, right? Is this true, even if we > considered such 'unexpected' behavior as a bug? > > Regards, > Johannes If there's a bug in the API call, we of course fix it. But we try to keep the current API interface as is. Spacewalk users have their scripts using our API calls and we do not want to break the scripts by renaming/deleting existing API calls. (Introducing of new sensefull APIs is always good. :) So, it is important that the API behaves according to its name. It the name and behavior do not match, we fix the behavior according to the name and can introduce a new API in case the behavior of the original API was helpfull. However, internal naming has lower priority, because the users do not come into contact with it, so it cannot be confusing for them. (But we of course try to keep the naming sensefull as well.) Regards, -- Tomas Lestach RHN Satellite Engineering _______________________________________________ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel