Merge lp://staging/~al-maisan/launchpad/disable-ppa-495975 into lp://staging/launchpad/db-devel

Proposed by Muharem Hrnjadovic
Status: Merged
Approved by: Julian Edwards
Approved revision: not available
Merged at revision: not available
Proposed branch: lp://staging/~al-maisan/launchpad/disable-ppa-495975
Merge into: lp://staging/launchpad/db-devel
Diff against target: 71 lines (+36/-3)
3 files modified
lib/lp/soyuz/browser/archive.py (+1/-1)
lib/lp/soyuz/configure.zcml (+2/-2)
lib/lp/soyuz/stories/ppa/xx-ppa-workflow.txt (+33/-0)
To merge this branch: bzr merge lp://staging/~al-maisan/launchpad/disable-ppa-495975
Reviewer Review Type Date Requested Status
Julian Edwards (community) code Approve
Данило Шеган (community) release-critical Approve
Review via email: mp+16125@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Muharem Hrnjadovic (al-maisan) wrote :

Hello there,

this is a simple branch that boosts the usability of PPAs quite a bit by
allowing users with edit permissions for a PPA to disable and enable the
latter.

Tests to run:

    bin/test -vv -t ppa -t archive

No pertinent "make lint" errors or warnings.

Revision history for this message
Данило Шеган (danilo) wrote :

Looks good, though this is the kind of thing I'd rather see during regular development: it's a new feature. Accepted solely on the basis that LOSAs would very much like it, and it's a very simple change.

It's conditional on doing QA on dogfood and getting a regular review before landing it.

review: Approve (release-critical)
Revision history for this message
Julian Edwards (julian-edwards) wrote :

This is fine. Muharem, please QA on dogfood before landing, and also ensure that the old +admin form still works to enable/disable.

Cheers.

review: Approve (code)
Revision history for this message
Muharem Hrnjadovic (al-maisan) wrote :

Julian Edwards wrote:
> Review: Approve code
> This is fine. Muharem, please QA on dogfood before landing, and also
> ensure that the old +admin form still works to enable/disable.

Hello,

thanks for the review, I tried the patch on dogfood and it works as
expected, I

  - first disabled/re-enabled one of my PPAs
    (https://dogfood.launchpad.net/~al-maisan/+archive/merges)
  - then added myself to the https://dogfood.launchpad.net/~admins group
    and disabled/re-enabled
    https://dogfood.launchpad.net/~cprov/+archive/ppa via "Administer
    archive"

Best regards

--
Muharem Hrnjadovic <email address hidden>
Public key id : B2BBFCFC
Key fingerprint : A5A3 CC67 2B87 D641 103F 5602 219F 6B60 B2BB FCFC

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/soyuz/browser/archive.py'
2--- lib/lp/soyuz/browser/archive.py 2009-11-06 21:06:38 +0000
3+++ lib/lp/soyuz/browser/archive.py 2009-12-14 12:59:13 +0000
4@@ -1782,7 +1782,7 @@
5
6 class ArchiveEditView(BaseArchiveEditView):
7
8- field_names = ['displayname', 'description']
9+ field_names = ['displayname', 'description', 'enabled']
10 custom_widget(
11 'description', TextAreaWidget, height=10, width=30)
12
13
14=== modified file 'lib/lp/soyuz/configure.zcml'
15--- lib/lp/soyuz/configure.zcml 2009-12-01 08:43:43 +0000
16+++ lib/lp/soyuz/configure.zcml 2009-12-14 12:59:13 +0000
17@@ -395,11 +395,11 @@
18 <require
19 permission="launchpad.Edit"
20 interface="lp.soyuz.interfaces.archive.IArchiveEdit"
21- set_attributes="description displayname"/>
22+ set_attributes="description displayname enabled"/>
23 <require
24 permission="launchpad.Commercial"
25 set_attributes="authorized_size buildd_secret
26- enabled external_dependencies private
27+ external_dependencies private
28 require_virtualized relative_build_score "/>
29 <require
30 permission="launchpad.Admin"
31
32=== modified file 'lib/lp/soyuz/stories/ppa/xx-ppa-workflow.txt'
33--- lib/lp/soyuz/stories/ppa/xx-ppa-workflow.txt 2009-10-14 00:51:54 +0000
34+++ lib/lp/soyuz/stories/ppa/xx-ppa-workflow.txt 2009-12-14 12:59:13 +0000
35@@ -710,3 +710,36 @@
36 ...
37 Unauthorized: ...
38
39+
40+== Enabling or disabling of PPAs by the owner ==
41+
42+Users with 'launchpad.Edit' permission for a PPA may disable or enable it.
43+
44+ >>> no_priv_browser = setupBrowser(
45+ ... auth='Basic no-priv@canonical.com:test')
46+ >>> no_priv_browser.open("http://launchpad.dev/~no-priv/+archive/ppa/+edit")
47+
48+Initially, the PPA is enabled.
49+
50+ >>> print no_priv_browser.getControl(name='field.enabled').value
51+ True
52+
53+After disabling the PPA a warning message is displayed on its page.
54+
55+ >>> no_priv_browser.getControl(name='field.enabled').value = False
56+ >>> no_priv_browser.getControl('Save').click()
57+ >>> print extract_text(
58+ ... first_tag_by_class(no_priv_browser.contents, 'warning message'))
59+ This archive has been disabled.
60+
61+Once we re-enable the PPA the warning message is gone.
62+
63+ >>> no_priv_browser.open("http://launchpad.dev/~no-priv/+archive/ppa/+edit")
64+ >>> print no_priv_browser.getControl(name='field.enabled').value
65+ False
66+
67+ >>> no_priv_browser.getControl(name='field.enabled').value = True
68+ >>> no_priv_browser.getControl('Save').click()
69+ >>> (first_tag_by_class(no_priv_browser.contents, 'warning message')
70+ ... is None)
71+ True

Subscribers

People subscribed via source and target branches

to status/vote changes: