How do I programmatically detect that my launchpad build process is done?

Asked by Alexis Wilke

I've been looking for a way to detect that a build is done on launchpad.

I have a project with many modules each creating a different package and those packages have inter-dependencies. That means I can't just send them all to Launchpad at once because the build order is important and launchpad doesn't detect that within one project.

So I was thinking to build a tool which detects when a project is done building and sends the next one, that part is easy, it's already done manually. Now the one thing I'm missing to completely automate the process is a way to know that a build is done. I tried many URLs with a simple GET and got various responses, but I just can't seem to find anything about my projects.

Actually, this one seems to work great for OS related packages:

https://api.launchpad.net/devel/ubuntu/bionic?ws.op=getBuildRecords&source_name=lib

but when I specifically tried with one of my packages, I get an empty list as the answer:

https://api.launchpad.net/devel/ubuntu/bionic?ws.op=getBuildRecords&source_name=libtld

My project packages are listed here:

https://launchpad.net/%7Esnapcpp/+archive/ubuntu/ppa/+packages?field.name_filter=&field.series_filter=&field.status_filter=published&batch=75

and it looks like that page is capable of getting the information since it shows whether a build worked, is in process, failed, and gives me links to places such as the logs. None of which I've been able to find in the API at the moment.

Would someone be so kind as to at least let me know whether this is doable, and if so, the URLs that I need to use or code sample to do so using the launchpadlib environment?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu python-launchpadlib Edit question
Assignee:
No assignee Edit question
Solved by:
Colin Watson
Solved:
Last query:
Last reply:
Revision history for this message
Best Colin Watson (cjwatson) said :
#3

I answered this just now in https://bugs.launchpad.net/launchpadlib/+bug/1928872:

"""
You're using the wrong URL path. Use this instead:

  https://api.launchpad.net/devel/~snapcpp/+archive/ubuntu/ppa?ws.op=getBuildRecords&source_name=libtld

Or in launchpadlib:

  lp.load('/~snapcpp/+archive/ubuntu/ppa').getBuildRecords(source_name='libtld')
"""

Revision history for this message
Alexis Wilke (alexis-m2osw) said :
#4

Thanks Colin Watson, that solved my question.