Code review comment for lp:~sinzui/launchpad/package-link-validation-1

Revision history for this message
Curtis Hovey (sinzui) wrote :

This is my second branch to ensure valid upstream package links. There
are many oopses relating to the creation and efforts to fix invalid packages.
The root cause is a bad DB constraint and two views that do not do the
required sanity checks: +addpackage and +ubuntupkg

This branch fixes +addpackage to make sane packages.
(+ubuntupkg need major refactoring and is the scope od a single branch.)

    lp:~sinzui/launchpad/package-link-validation-1
    Diff size: 372
    Launchpad bug: https://bugs.launchpad.net/bugs/344376
                   https://bugs.launchpad.net/bugs/89392
                   https://bugs.launchpad.net/bugs/196774
    Test command: ./bin/test -vv -t 'lp.reg.*(productseries|packaging)'
    Pre-implementation: flacoste
    Target release: 3.1.10

== Fixing upstream packaging links ==

Bug 196774 [It shouldn't be possible to link multiple productseries to a
    sourcepackage in a given distroseries]
    +addpackage and +ubuntupkg do not verify that the SP is unlinked for the
    distroseries.

Bug 344376 [+addpackage oopses if the "Source Package Name" is left blank]
    The most common reason users leave the field blank is that they are
    trying to remove an invalid packaging link.

Bug 89392 [+addpackage form contains nonsensical "Packaging" field]
    The final menu is labeled "Packaging" and contains options "Primary
    Product" and "SourcePackage Includes Product". This makes absolutely no
    sense to a product author.

== Rules ==

Bug 196774 [It shouldn't be possible to link multiple productseries to a
    sourcepackage in a given distroseries]
    Verify that the SP for the distroseries is available for linking.
    If not, provide a link to the current package so that the user can
    investigate it.

Bug 344376 [+addpackage oopses if the "Source Package Name" is left blank]
    Use the validate() method and report a form error if the choice is not
    sane.

Bug 89392 [+addpackage form contains nonsensical "Packaging" field]
    rewrite the form instructions

== QA ==

On staging
    * Visit a productseries
    * Choose (+) Add packaging
    * Verify the packaging field explains primary from source
    * Submit the form without a source package name
    * Verify the form error message explains that the source package must
      be provided
    * Submit the form with Ubuntu Karmic, 'gedit', primary
    * Verify the form error message explains that the gedit is already
      packaged in Ubuntu karmic. Follow the link
    * Verify the “gedit” source package in Karmic page displays.

== Lint ==

Linting changed files:
  lib/lp/registry/browser/packaging.py
  lib/lp/registry/browser/tests/productseries-views.txt
  lib/lp/registry/interfaces/packaging.py
  lib/lp/registry/model/packaging.py
  lib/lp/registry/tests/test_packaging.py

== Test ==

    * lib/lp/registry/browser/tests/productseries-views.txt
    * lib/lp/registry/tests/test_packaging.py

== Implementation ==

    * lib/lp/registry/browser/packaging.py
    * lib/lp/registry/interfaces/packaging.py
    * lib/lp/registry/model/packaging.py

« Back to merge proposal