Merge lp:~sinzui/launchpad/non-existent-packages-bug-204119 into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Brad Crittenden on 2010-01-12 |
| Approved revision: | not available |
| Merged at revision: | not available |
| Proposed branch: | lp:~sinzui/launchpad/non-existent-packages-bug-204119 |
| Merge into: | lp:launchpad |
| Diff against target: |
326 lines (+105/-46) 10 files modified
lib/lp/bugs/stories/guided-filebug/xx-project-guided-filebug.txt (+12/-0) lib/lp/registry/browser/packaging.py (+9/-0) lib/lp/registry/browser/productseries.py (+27/-3) lib/lp/registry/browser/tests/packaging-views.txt (+37/-2) lib/lp/registry/stories/product/xx-product-package-pages.txt (+9/-8) lib/lp/registry/stories/productseries/xx-productseries-index.txt (+1/-4) lib/lp/registry/templates/product-packages.pt (+2/-2) lib/lp/registry/templates/productseries-portlet-packages.pt (+0/-3) lib/lp/registry/templates/productseries-ubuntupkg.pt (+6/-23) lib/lp/testing/factory.py (+2/-1) |
| To merge this branch: | bzr merge lp:~sinzui/launchpad/non-existent-packages-bug-204119 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Brad Crittenden (community) | code | 2010-01-11 | Approve on 2010-01-12 |
|
Review via email:
|
|||
| Curtis Hovey (sinzui) wrote : | # |
| Brad Crittenden (bac) wrote : | # |
Hi Curtis,
Thanks for the branch. It looks good save for a few small items below.
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -33,6 +33,9 @@
>
> from zope.component import getUtility
> from zope.app.
> +from zope.formlib import form
> +from zope.schema import Choice
> +from zope.schema.
>
> from z3c.ptcompat import ViewPageTemplat
>
> @@ -366,7 +369,7 @@
>
> class ProductSeriesUb
>
> - field_names = ['sourcepackage
> + field_names = ['sourcepackage
> page_title = 'Ubuntu source packaging'
> label = page_title
>
> @@ -374,8 +377,8 @@
> """Set the static packaging information for this series."""
> super(ProductSe
> context, request)
> - ubuntu = getUtility(
> - self._ubuntu_series = ubuntu.
> + self._ubuntu = getUtility(
> + self._ubuntu_series = self._ubuntu.
> try:
> package = self.context.
> self.default_
> @@ -383,6 +386,28 @@
> # The package has never been set.
> self.default_
>
> + def setUpFields(self):
> + """See `LaunchpadFormV
> +
> + The packaging is restricted to ubuntu series and the default value
> + is the current development series.
> + """
> + super(Packaging
As we discussed on IRC the class name is wrong.
> + series_vocabulary = SimpleVocabulary(
> + [SimpleTerm(series, series.name, series.
> + for series in self._ubuntu.
> + choice = Choice(
> + title=_('Series'),
> + default=
> + vocabulary=
> + description=_(
> + "Select the Ubuntu series that this package is published "
> + "in. The current series is most important to the Ubuntu "
> + "community."),
I think "series where this package is published" sounds better. What
do you think?
> + required=True)
> + field = form.Fields(choice, render_
> + self.form_fields = self.form_
> +
> def setUpWidgets(self):
> """See `LaunchpadFormV
>
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -18,6 +18,8 @@
> >>> sourcepackagename = factory.
> >>> sourcepackage = factory.make...
| Curtis Hovey (sinzui) wrote : | # |
On Tue, 2010-01-12 at 18:45 +0000, Brad Crittenden wrote:
> > === modified file 'lib/lp/
> > --- lib/lp/
> > +++ lib/lp/
...
> > @@ -374,8 +377,8 @@
> > """Set the static packaging information for this series."""
> > super(ProductSe
> > context, request)
> > - ubuntu = getUtility(
> > - self._ubuntu_series = ubuntu.
> > + self._ubuntu = getUtility(
> > + self._ubuntu_series = self._ubuntu.
> > try:
> > package = self.context.
> > self.default_
> > @@ -383,6 +386,28 @@
> > # The package has never been set.
> > self.default_
> >
> > + def setUpFields(self):
> > + """See `LaunchpadFormV
> > +
> > + The packaging is restricted to ubuntu series and the default value
> > + is the current development series.
> > + """
> > + super(Packaging
>
> As we discussed on IRC the class name is wrong.
Fixed
> > + series_vocabulary = SimpleVocabulary(
> > + [SimpleTerm(series, series.name, series.
> > + for series in self._ubuntu.
> > + choice = Choice(
> > + title=_('Series'),
> > + default=
> > + vocabulary=
> > + description=_(
> > + "Select the Ubuntu series that this package is published "
> > + "in. The current series is most important to the Ubuntu "
> > + "community."),
>
> I think "series where this package is published" sounds better. What
> do you think?
Much better. Accepted.
> > === modified file 'lib/lp/
> > --- lib/lp/
> > +++ lib/lp/
> > @@ -18,6 +18,8 @@
> > >>> sourcepackagename = factory.
> > >>> sourcepackage = factory.
> > ... sourcepackagena
> > + >>> spph = factory.
> > + ... sourcepackagena
> > >>> product = factory.
> > >>> productseries = factory.
> > ... product=product, name='hotter')
> > @@ -103,6 +105,22 @@
> > ('sourcepackage
> > You must choose the source package name.
> >
> > +In the case of full functionality distributions like Ubuntu, the source
> > +package must be published in the distro series.
> > +
> > + >>> vapour_spn = factory.

This is my branch to prevent packaging links to unpublished Ubuntu packages.
lp:~sinzui/launchpad/non-existent-packages-bug-204119 /bugs.launchpad .net/bugs/ 204119 package- pages.txt \ s-index. txt implementation: beuno, bigjools, flacoste
Diff size: 305
Launchpad bug: https:/
Test command: ./bin/test -vv \
-t packaging-views.txt \
-t xx-product-
-t xx-productserie
Pre-
Target release: 10.01
= Prevent packaging links to unpublished Ubuntu packages =
Launchpad allows users to create links to non-existent packages such as /edge.launchpad .net/ubuntu/ breezy/ +source/ warzone2100.
https:/
The base view does not verify the that the package was published because
it is designed to accommodate any distro. But this feature is intended for
Ubuntu and it would not have been added if it Ubuntu did not want it, so
the rules must favour Ubuntu.
The work in this branch was started months ago. It was stalled by a debate
regarding the motivations for upstream projects linking to Ubuntu, and the
feature's design to accommodate all distros.
It was decided that the feature will never work well for other distros, and
that is why there are less then 100 links after 4 years. The feature must
favour Ubuntu. There is a problem with the Ubuntu-only form; some users
want to select the non-current series, and we should accommodate that before
we remove the generic form.
== Rules ==
* Update the base view to verify the package was published in the series if
the series is full functionality (Ubuntu)
* Update the ubuntu view to show all the Ubuntu series, but retain the
rule to use the current series as the default.
* Update all the project and series pages to use +ubuntupkg instead of
+addpackage.
* ADDENDUM: I improved the instructions to use the ubuntu form.
There will be follow up branches to remove the +addpackage view and a query
to remove the packaging links to the non-existent series package.
== QA ==
On staging (or edge if you are willing to clean up) /edge.launchpad .net/gdp/ +packages -plugins into the source package name field
* https:/
* Verify the action is `(+) Link to Ubuntu package`
* Follow the link
* Verify the form lists all Ubuntu series
* Verify the default series is Lucid
* Enter gedit-developer
and submit
* Verify that the error message is:
The source package is not published in Lucid
== Lint ==
Linting changed files: registry/ browser/ packaging. py registry/ browser/ productseries. py registry/ browser/ tests/packaging -views. txt registry/ stories/ product/ xx-product- package- pages.txt registry/ stories/ productseries/ xx-productserie s-index. txt registry/ templates/ product- packages. pt registry/ templates/ productseries- portlet- packages. pt registry/ templates/ productseries- ubuntupkg. pt testing/ factory. py
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
== Test ==
* lib/lp/ registry/ browser/ tests/packaging -views. txt registry/ stories/ product/ xx-product- package- pages.txt registry/ stories/ productseries/ xx-productserie s-index. txt
* lib/lp/
* lib/lp/
== Implementation ==
* lib/lp/ registry/ browser/ pack...