Last commit made on 2023-06-27
Get this branch:
git clone -b fix-lp1997122-and-other-errors https://git.launchpad.net/ppa-dev-tools
Only Bryce Harrington can upload to this branch. If you are Bryce Harrington please log in for upload directions.

Branch merges

Branch information


Recent commits

7e8f556... by Bryce Harrington

wait: Handle lazr BadRequest during wait operation

Launchpad can return BadRequest errors in some indeterminate situations,
possibly such as if Launchpad is under heavy loads, but also potentially
due to usage/configuration issues.

Include logic to retry the Launchpad operations in case the problem is
server-side, but also limit the number of sequential retries to 3, to
avoid getting stuck in a loop if the problem is something else. The
counter is reset to zero each time we successfully complete a wait
cycle, so that if Launchpad is *slightly* glitchy this will be

Fixes: https://bugs.launchpad.net/ppa-dev-tools/+bug/1997122

4c55c4e... by Bryce Harrington

ppa_address_split: Fix handling of +packages URLs

The PPA web interface includes an overview page (suited to end users)
and a more technically detailed +packages page. This latter page tends
to be what Ubuntu packagers need, so it is not uncommon for people to
share links to PPAs as this +packages link. So, support handling of
this (and any other +whatever pages under the PPA namespace that might

f823e85... by Bryce Harrington

ppa_address_split: Allow optional trailing / in the PPA URL

4c2b3d1... by Bryce Harrington

Quell traceback for unparsable PPA names

Discovered when running:

    $ ./scripts/ppa tests https://launchpad.net/~athos-ribeiro/+archive/ubuntu/squid-halt-build-on-test-failures/+packages --release kinetic
    Error: Invalid ppa name 'https://launchpad.net/~athos-ribeiro/+archive/ubuntu/squid-halt-build-on-test-failures/+packages'

Issue is the +packages element, however any unrecognized URL will
trigger the traceback from the exception throw.

Instead, print the exception's message and exit with an error code.

aa1531c... by Bryce Harrington

Quell traceback on user interrupt during configuration

The create_config() command may include a call to Launchpad to determine
the current LP username in some circumstances. If there are issues this
can cause some unexpected delay, leading to the user cancelling the
process (via <control>+c) which triggers the usual python traceback for
the KeyboardInterrupt exception.

The various PPA commands already include exception handling for this
case, but the config loading occurs prior to the command execution
itself. So, the fix is to include similar exception handling for the
create_config() command.

33b9284... by Massimiliano Girardi

Add LP_CREDENTIALS login and documentation

9dbaa6f... by Bryce Harrington

Refactor team name to owner name

Hat tip to Andreas for pointing out 'owner' is Launchpad's preferred
jargon for the person or team that a PPA belongs to.

Support the --team-name argument and the 'team_name' configuration
parameter for legacy reasons, even though the former didn't exist and
the latter was bugged.

df6d293... by Bryce Harrington

Add --team-name argument for create command

Modify ppa_address_split() to not use a default team if the team name
was undefined, and instead let it be returned as None. Then handled
undefined team names in create_config() by making use of any team
specified on the command line or config file, before falling back to the
lp username as the final default. And error out if that still doesn't

With this, allow synonym options --owner and --team for convenience.

Fixes: https://bugs.launchpad.net/ppa-dev-tools/+bug/1990244

2a8e2ef... by Massimiliano Girardi

wait: Improve exit behavior on build failures of subset of PPA

By default `ppa wait` monitors all build jobs, but this adds a couple
parameters to narrow this to just jobs for a specific source package via
the 'name' parameter, and/or jobs created within a timeframe specified
by the 'wait_max_age_hours' configuration parameter.

This also adds another configuration parameter
'exit_on_only_build_failure' which when true will make the ppa wait
command terminate if the only jobs that it is monitoring are failed
builds (this is helpful for CI/CD integration).

de7c5b7... by Bryce Harrington

results: Add show_results() for managing display of results

With most of the formatting logic for a single result now moved to the
new to_bullet_tree() member for the Results class, a new helper function
show_results() is added to manage the high level results display logic
for a list of results.

This new function is intended to follow the design style of
show_running() and show_waiting() from the Jobs module.

Notably, the one user-visible change in this refactoring is that, like
show_running() and show_waiting(), it will display "(none)" when there
are no results.