/srv/irclogs.ubuntu.com/2016/05/09/#launchpad-dev.txt

=== frankban|afk is now known as frankban
=== danilos` is now known as danilos
sil2100Hello! I have a question about a possible bug in LP API, maybe I'm just doing something wrong10:44
sil2100I'm doing such a thing:10:45
sil2100Having a binary package name, I do a getPublishedBinaries() on the archive to get the binary_package_publishing_history and then accessing its source package through getLatestSourcePublication() - all works fine here so far10:46
sil2100So I have now the source package that generated the selected binary package10:46
sil2100But now, on that source_package_publishing_history when I call getPublishedBinaries() to fetch ALL the binaries it generates (besides the one I queried for), it returns an empty set10:47
sil2100No binaries10:47
sil2100Even though if I do a query directly for the source package in the archive, I see all the binaries there10:47
sil2100Just not when the source_package_publishing_history object is returned through getLatestSourcePublication()10:48
sil2100Does anyone know why?10:48
cjwatsonSPPH.getPublishedBinaries only gives you active binary publications10:52
cjwatsonSo if they've been e.g. superseded it won't return them10:52
cjwatsonIn fact this is documented: https://launchpad.net/+apidoc/devel.html#source_package_publishing_history-getPublishedBinaries10:53
cjwatsonThis is certainly an annoyance.  It might be nice if there were an option to pass active_binaries_only=False down through SPPH.getPublishedBinaries -> PublishingSet.getBinaryPublicationsForSources -> PublishingSet._getSourceBinaryJoinForSources10:56
sil2100Ok, yes, but the strange thing is that when I fetch the SPPH for the selected source and do getPublishedBinaries I get all the requested binaries, but when I do the very same thing on the SPPH that's returned by getLatestSourcePublication() I get 010:57
cjwatsonAre you sure it's the same SPPH?  It must not be.10:57
cjwatsonBecause getPublishedBinaries doesn't know how you got the SPPH in question.10:57
cjwatsonCompare .self_link10:58
sil2100Here's what I did in an lp-shell session (I cut out the unnecessary bits)10:59
sil2100http://paste.ubuntu.com/16316937/10:59
sil2100So I make sure I get the SPPH for the source that has the same name and version as the one returned through getLatestSourcePublication()11:00
sil2100If they're not the same SPPH then I guess they should? As both queries should lead to the same thing I suppose?11:02
cjwatsonsil2100: and what's src2[0]?11:35
sil2100It's the result of ppa.getPublishedSources() with the same source name and version as the one I got from going through BPPH->SPPH11:36
sil2100ppa.getPublishedSources(source_name="account-plugins", version="0.12+15.04.20160126-0ubuntu1", exact_match=True) <- both the name and version are exactly the same as what I got from the SPPH in the earlier steps, the one that had 0 binaries published11:37
sil2100And suddenly it has 96 binaries11:37
cjwatsonsil2100: I'm trying to get you to look at src2[0]11:37
cjwatsonsil2100: Compare it with src11:37
sil2100Oh11:38
cjwatsonsil2100: The actual link, not its contents11:38
sil2100Ooooh11:38
sil2100Ah, I get it now11:38
cjwatsonsil2100: So it matters here whether you're looking at the archive where it was originally built, or the one it's now published in11:38
sil2100Damn, the SPPH one is the first build that resulted in the binaries, which is already deleted from the silo PPA11:38
sil2100Yeah, all makes sense now11:39
sil2100Thanks, this does complicate the logic of my scripts, but at least I know why I was getting these different results11:39
sil2100:)11:39
=== pavlushka is now known as pavlushka2
=== pavlushka2 is now known as pavlushka
=== pavlushka is now known as z3ki
=== z3ki is now known as pavlushka
sinzuihelp.launchpad.net is being spammed. Someone also took my edit away so I cannot delete the spam https://help.launchpad.net/Norton%20care%20@@!1844-8O1-3966*!!!!**Norton%20phone%20Number%20uSa%20HELP%20desk%20360%20customer%20care%20number,Norton17:01
=== frankban is now known as frankban|afk
=== pavlushka is now known as z4ki
=== z4ki is now known as pavlushka

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!