ppa-dev-tools:set-command-private-ppa

Last commit made on 2023-07-21
Get this branch:
git clone -b set-command-private-ppa 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

Name:
set-command-private-ppa
Repository:
lp:ppa-dev-tools

Recent commits

a116288... by Bryce Harrington

Improve error for non-existing PPAs

Since we weren't returning after encountering this error, it allowed the
unhandled error processing to print an error as well, which is not
desired:

   $ ./scripts/ppa set --private ppa:bryce/non-existing-ppa
   The PPA 'non-existing-ppa' does not exist for person or team 'bryce'
   Unhandled error

With this change the 'Unhandled error' line is not printed.

42b9c45... by Bryce Harrington

Handle error for non-existing users

A traceback is generated when attempting to create a PPA for an owner
that is not registered in Launchpad. Catch this and print a friendlier
error:

    $ ./scripts/ppa create ppa:432687dsafkhjafdsadsf/test-ppa
    Error: No such person or team '432687dsafkhjafdsadsf'

7629c77... by Bryce Harrington

Handle unauthorized exception when trying to create/set private PPAs

Special permission is required to create private PPAs or to set an
existing PPA private, and without that the tool generates a traceback.
Instead, handle this exception and print a friendlier error message.

03d3ef6... by Bryce Harrington

Refactor argument handling logic and drop enable/disable

The --enable/--disable options were not actually implemented due to
limitations in the Launchpad API, which does not expose this
functionality AFAICT.

Also do some general cleanup of other argument handling.

4763ecd... by Bryce Harrington

Fix handling of boolean command line options

If a boolean option is being set to False, it would be excluded from the
config and thus fail to get set properly. This treats None and False
as distinct values, with the latter indicating a desired change and the
former indicating no change needed.

33c9a27... by Bryce Harrington

Add support for --private/--public command line args

2dfaec0... by Bryce Harrington

tests: Refactor the set smoketest

Add some helper routines and make the output more nicely formatted

ccda32b... by Bryce Harrington

tests: Add basic smoketest for ppa set command

Create a (real) PPA on Launchpad, set some params and unset them, then
delete the PPA.

12ab050... by Bryce Harrington

Add help text for set command

eca439b... 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
forgiving.

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