Merge lp:~al-maisan/launchpad/disable-ppa-495975 into lp: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:~al-maisan/launchpad/disable-ppa-495975
Merge into: lp: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:~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.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
=== modified file 'lib/lp/soyuz/browser/archive.py'
--- lib/lp/soyuz/browser/archive.py 2009-11-06 21:06:38 +0000
+++ lib/lp/soyuz/browser/archive.py 2009-12-14 12:59:13 +0000
@@ -1782,7 +1782,7 @@
17821782
1783class ArchiveEditView(BaseArchiveEditView):1783class ArchiveEditView(BaseArchiveEditView):
17841784
1785 field_names = ['displayname', 'description']1785 field_names = ['displayname', 'description', 'enabled']
1786 custom_widget(1786 custom_widget(
1787 'description', TextAreaWidget, height=10, width=30)1787 'description', TextAreaWidget, height=10, width=30)
17881788
17891789
=== modified file 'lib/lp/soyuz/configure.zcml'
--- lib/lp/soyuz/configure.zcml 2009-12-01 08:43:43 +0000
+++ lib/lp/soyuz/configure.zcml 2009-12-14 12:59:13 +0000
@@ -395,11 +395,11 @@
395 <require395 <require
396 permission="launchpad.Edit"396 permission="launchpad.Edit"
397 interface="lp.soyuz.interfaces.archive.IArchiveEdit"397 interface="lp.soyuz.interfaces.archive.IArchiveEdit"
398 set_attributes="description displayname"/>398 set_attributes="description displayname enabled"/>
399 <require399 <require
400 permission="launchpad.Commercial"400 permission="launchpad.Commercial"
401 set_attributes="authorized_size buildd_secret401 set_attributes="authorized_size buildd_secret
402 enabled external_dependencies private402 external_dependencies private
403 require_virtualized relative_build_score "/>403 require_virtualized relative_build_score "/>
404 <require404 <require
405 permission="launchpad.Admin"405 permission="launchpad.Admin"
406406
=== modified file 'lib/lp/soyuz/stories/ppa/xx-ppa-workflow.txt'
--- lib/lp/soyuz/stories/ppa/xx-ppa-workflow.txt 2009-10-14 00:51:54 +0000
+++ lib/lp/soyuz/stories/ppa/xx-ppa-workflow.txt 2009-12-14 12:59:13 +0000
@@ -710,3 +710,36 @@
710 ...710 ...
711 Unauthorized: ...711 Unauthorized: ...
712712
713
714== Enabling or disabling of PPAs by the owner ==
715
716Users with 'launchpad.Edit' permission for a PPA may disable or enable it.
717
718 >>> no_priv_browser = setupBrowser(
719 ... auth='Basic no-priv@canonical.com:test')
720 >>> no_priv_browser.open("http://launchpad.dev/~no-priv/+archive/ppa/+edit")
721
722Initially, the PPA is enabled.
723
724 >>> print no_priv_browser.getControl(name='field.enabled').value
725 True
726
727After disabling the PPA a warning message is displayed on its page.
728
729 >>> no_priv_browser.getControl(name='field.enabled').value = False
730 >>> no_priv_browser.getControl('Save').click()
731 >>> print extract_text(
732 ... first_tag_by_class(no_priv_browser.contents, 'warning message'))
733 This archive has been disabled.
734
735Once we re-enable the PPA the warning message is gone.
736
737 >>> no_priv_browser.open("http://launchpad.dev/~no-priv/+archive/ppa/+edit")
738 >>> print no_priv_browser.getControl(name='field.enabled').value
739 False
740
741 >>> no_priv_browser.getControl(name='field.enabled').value = True
742 >>> no_priv_browser.getControl('Save').click()
743 >>> (first_tag_by_class(no_priv_browser.contents, 'warning message')
744 ... is None)
745 True

Subscribers

People subscribed via source and target branches

to status/vote changes: