[10:44] <sil2100> Hello! I have a question about a possible bug in LP API, maybe I'm just doing something wrong
[10:45] <sil2100> I'm doing such a thing:
[10:46] <sil2100> Having 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 far
[10:46] <sil2100> So I have now the source package that generated the selected binary package
[10:47] <sil2100> But 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 set
[10:47] <sil2100> No binaries
[10:47] <sil2100> Even though if I do a query directly for the source package in the archive, I see all the binaries there
[10:48] <sil2100> Just not when the source_package_publishing_history object is returned through getLatestSourcePublication()
[10:48] <sil2100> Does anyone know why?
[10:52] <cjwatson> SPPH.getPublishedBinaries only gives you active binary publications
[10:52] <cjwatson> So if they've been e.g. superseded it won't return them
[10:53] <cjwatson> In fact this is documented: https://launchpad.net/+apidoc/devel.html#source_package_publishing_history-getPublishedBinaries
[10:56] <cjwatson> This 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._getSourceBinaryJoinForSources
[10:57] <sil2100> Ok, 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 0
[10:57] <cjwatson> Are you sure it's the same SPPH?  It must not be.
[10:57] <cjwatson> Because getPublishedBinaries doesn't know how you got the SPPH in question.
[10:58] <cjwatson> Compare .self_link
[10:59] <sil2100> Here's what I did in an lp-shell session (I cut out the unnecessary bits)
[10:59] <sil2100> http://paste.ubuntu.com/16316937/
[11:00] <sil2100> So I make sure I get the SPPH for the source that has the same name and version as the one returned through getLatestSourcePublication()
[11:02] <sil2100> If they're not the same SPPH then I guess they should? As both queries should lead to the same thing I suppose?
[11:35] <cjwatson> sil2100: and what's src2[0]?
[11:36] <sil2100> It's the result of ppa.getPublishedSources() with the same source name and version as the one I got from going through BPPH->SPPH
[11:37] <sil2100> ppa.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 published
[11:37] <sil2100> And suddenly it has 96 binaries
[11:37] <cjwatson> sil2100: I'm trying to get you to look at src2[0]
[11:37] <cjwatson> sil2100: Compare it with src
[11:38] <sil2100> Oh
[11:38] <cjwatson> sil2100: The actual link, not its contents
[11:38] <sil2100> Ooooh
[11:38] <sil2100> Ah, I get it now
[11:38] <cjwatson> sil2100: So it matters here whether you're looking at the archive where it was originally built, or the one it's now published in
[11:38] <sil2100> Damn, the SPPH one is the first build that resulted in the binaries, which is already deleted from the silo PPA
[11:39] <sil2100> Yeah, all makes sense now
[11:39] <sil2100> Thanks, this does complicate the logic of my scripts, but at least I know why I was getting these different results
[11:39] <sil2100> :)
[17:01] <sinzui> help.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,Norton