Add wait-for-builds polling for Launchpad build completion#111
Merged
rtibbles merged 2 commits intolearningequality:mainfrom Feb 22, 2026
Merged
Add wait-for-builds polling for Launchpad build completion#111rtibbles merged 2 commits intolearningequality:mainfrom
rtibbles merged 2 commits intolearningequality:mainfrom
Conversation
rtibbles
reviewed
Feb 22, 2026
Member
rtibbles
left a comment
There was a problem hiding this comment.
Tested locally - seems to work, but I had some difficulties with dependencies.
The pyproject.toml doesn't contain any python dependencies for either test or regular operations.
I had to install:
- launchpadlib
- keyring
To run the scripts
and pytest to run the tests.
Add a `wait-for-builds` subcommand to launchpad_copy.py that polls Launchpad until all builds for a source package reach a terminal state. Phase 1 waits for the source package to appear in the PPA (handling the delay between dput upload and Launchpad acceptance). Phase 2 polls getBuilds() on all matching sources until every build succeeds, fails, or times out. CLI parameters: --package, --version, --ppa, --timeout (default 1800s), --interval (default 60s). Returns exit code 0 on success, 1 on failure or timeout, with clear error messages and progress logging. Includes comprehensive tests covering: source appearance polling, build completion polling, timeout handling, failure detection across all build records, progress logging, and custom PPA support. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Insert two polling jobs into the release workflow: - wait_for_source_builds: runs after build_package, before copy_to_series - wait_for_copy_builds: runs after copy_to_series, before promote This prevents the race condition where copy or promote operations proceed before Launchpad has finished building binaries. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
Thanks for the review! Added Python dependencies to Addressed 1/1 review items. 0 deferred. |
01a1aa3 to
2540bd8
Compare
rtibbles
approved these changes
Feb 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
wait-for-buildssubcommand toscripts/launchpad_copy.pythat polls Launchpad until all builds for a source package reach a terminal state. This prevents the race condition wherecopy-to-seriesorpromoteoperations proceed before Launchpad has finished building binaries.The command operates in two phases:
getPublishedSourcesuntil the expected package+version appears in the PPA (filtering out Deleted/Superseded/Obsolete sources)getBuilds()on all matching sources until every build reaches a terminal stateCLI parameters:
--package,--version,--ppa(default: kolibri-proposed),--timeout(default: 1800s),--interval(default: 60s). Exits 0 if all builds succeed, 1 on any failure or timeout.Two new workflow jobs are inserted into the
build_debian.ymlrelease workflow:wait_for_source_builds: afterbuild_package, beforecopy_to_other_distributionswait_for_copy_builds: aftercopy_to_other_distributions, beforeblock_release_step/promoteReferences
Closes #107
Reviewer guidance
LaunchpadWrapper.wait_for_builds()and_poll_builds()— review these for correctness of the state machine (terminal states, failure detection, timeout handling)needsdependency chain is correcttime.timeandtime.sleepto avoid real delays; theside_effectsequences simulate time progressionubuntu-distro-infowhich isn't available outside Ubuntu — this is expectedTest evidence
Test scenarios covered (48 passed, 4 skipped)
CLI argument parsing (13 tests):
wait-for-buildssubcommand recognized with required--packageand--version--ppa=kolibri-proposed,--timeout=1800,--interval=60Build polling (14 tests):
Subcommand dispatch (3 tests):
main()dispatcheswait-for-buildstocmd_wait_for_buildscopy-to-seriesandpromotedispatch unchanged@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?
Closes #107