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

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

This is my fourth 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. The views are fixed,
but we have not provided users with a way to delete packaging links
to unbuilt packages. User need to do this to fix their mistakes. We want
to do this so that we can delete the duplicate packages.

This branch refactors portlets and forms so that my next branch can add
delete links to the product +packaing report.

    lp:~sinzui/launchpad/package-link-validation-3
    Diff size: 565
    Launchpad bug: https://bugs.launchpad.net/bugs/276409
    Test command: ./bin/test -vv -t 'lp.(reg|soyuz).*(productseries|packaging)'
    Pre-implementation: flacoste, beuno
    Target release: 3.1.10

== Fixing upstream packaging links ==

Bug 276409 ["Delete Link" is too easy on distribution source package page]
    On the page for a distribution source package with upstream links, such as
    <https://launchpad.net/ubuntu/+source/hwdb-client>, the button for
    deleting an upstream link is quite large and prominent, much more so than
    the button for correcting the link.

    A small improvement would be to change the "Delete Link" button to an
    icon-only button, but that would still leave deleting much easier than
    updating.

    There is little value in making the delete action an editing action
    because the user does not have enough information to select another
    series and sourcepackage. The user will almost always delete. Fixing the
    icon is all that is needed.

== Rules ==

Bug 276409 ["Delete Link" is too easy on distribution source package page]
    * Add a link from the productseries packaing portlet to the product
      +packages view.
    * Extract the delete packaging link rules to a separate view so that
      they can be reused
    * Change the Delete link button to a remove icon.

== QA ==

On staging
    * Visit a bzr series
    * Verify the packaging portlet has a link to All packages
    * Visit the bzr DSP
    * Verify eack packaging link has a the remove and edit icons int this
      order: (-) (/)

== Lint ==

Linting changed files:
  lib/canonical/launchpad/icing/style-3-0.css
  lib/lp/registry/browser/configure.zcml
  lib/lp/registry/browser/distributionsourcepackage.py
  lib/lp/registry/browser/packaging.py
  lib/lp/registry/browser/tests/test_packaging.py
  lib/lp/registry/stories/packaging/xx-distributionsourcepackage-packaging-concurrent-deletion.txt
  lib/lp/registry/stories/packaging/xx-distributionsourcepackage-packaging.txt
  lib/lp/registry/templates/distributionsourcepackage-index.pt
  lib/lp/registry/templates/productseries-index.pt
  lib/lp/registry/templates/productseries-portlet-packages.pt
  lib/lp/registry/templates/sourcepackage-index.pt
  lib/lp/registry/templates/team-portlet-membership.pt

== Test ==

    * lib/lp/registry/browser/tests/test_packaging.py
      * Updated the test to use the submit's name since images do not have
        labels.
    * lib/lp/registry/stories/packaging/xx-distributionsourcepackage-packaging-concurrent-deletion.txt
      * Updated the test to use the submit's name since images do not have
        labels.
      * Moved this story to packageing from distribution.
    * lib/lp/registry/stories/packaging/xx-distributionsourcepackage-packaging.txt
      * Updated the test to use the submit's name since images do not have
        labels.
      * Moved this story to packageing from distribution.

== Implementation ==

    * lib/canonical/launchpad/icing/style-3-0.css
      * Added an rule for <submit type="image"> so that they are aligned with
        other images on the same line.
    * lib/lp/registry/browser/configure.zcml
      * Removed sourcepackage-portlet-upstream.pt because it duplicated
        the information in another portlet. The portlet had not other uses
        so I deleted the file.
    * lib/lp/registry/browser/distributionsourcepackage.py
      * Extracted the delete packing links rule to a base view in packaging:
        PackagingDeleteView
      * Added a next_url property and packaging property to satisfy
        PackagingDeleteView
    * lib/lp/registry/browser/packaging.py
      * Copied the delete packaging rules to PackagingDeleteView.
      * Separated the rule to get all the packagng links to a property
        that the extending view must define.
      * remove the next_url rule from the action because the extending view
        must decided how that works.
      * Modified the submit button render to create a submit image: (-)
    * lib/lp/registry/templates/distributionsourcepackage-index.pt
      * Moved the Edit link (/) after the remove link (-) as we do on other
        pages.
      * Added the missing (and required) close script tag.
    * lib/lp/registry/templates/productseries-index.pt
      * Discovered this portlet was inlined I moved it the markup to
        productseries-portlet-packages.pt and call it via
        /@@/+portlet-packages
    * lib/lp/registry/templates/productseries-portlet-packages.pt
      * This portlet was not being used. Instead of deleting it, I revived
        it by copying the working rules to it.
      * Added a see-all link to All packages.
    * lib/lp/registry/templates/sourcepackage-index.pt
      * Removed the call to @@+portlet-upstream because the information was
        was provided by another portlet in the page.
    * lib/lp/registry/templates/team-portlet-membership.pt
      * Rmeove the portlet because it is not used.

« Back to merge proposal