Merge lp://qastaging/~edwin-grubbs/launchpad/bug-602385-register-project-from-sourcepackage-page-part2 into lp://qastaging/launchpad/db-devel

Proposed by Edwin Grubbs
Status: Merged
Approved by: Curtis Hovey
Approved revision: no longer in the source branch.
Merged at revision: 9653
Proposed branch: lp://qastaging/~edwin-grubbs/launchpad/bug-602385-register-project-from-sourcepackage-page-part2
Merge into: lp://qastaging/launchpad/db-devel
Prerequisite: lp://qastaging/~edwin-grubbs/launchpad/bug-602385-register-project-from-sourcepackage-page
Diff against target: 772 lines (+340/-97)
10 files modified
README (+106/-4)
lib/canonical/launchpad/emailtemplates/product-other-license.txt (+3/-2)
lib/canonical/widgets/product.py (+1/-0)
lib/canonical/widgets/templates/license.pt (+23/-5)
lib/lp/registry/browser/product.py (+81/-9)
lib/lp/registry/browser/sourcepackage.py (+9/-6)
lib/lp/registry/browser/tests/project-add-views.txt (+23/-23)
lib/lp/registry/browser/tests/test_sourcepackage_views.py (+71/-39)
lib/lp/registry/stories/packaging/xx-sourcepackage-packaging.txt (+19/-5)
lib/lp/registry/templates/product-new.pt (+4/-4)
To merge this branch: bzr merge lp://qastaging/~edwin-grubbs/launchpad/bug-602385-register-project-from-sourcepackage-page-part2
Reviewer Review Type Date Requested Status
Curtis Hovey (community) ui Approve
Leonard Richardson (community) Approve
Review via email: mp+32234@code.qastaging.launchpad.net

Description of the change

Summary
-------

This branch finishes the work on bug 602385. When you register a project
off of the source package page, you will now get to see the source
package's copyright info, so that you can choose the license more
easily. When the project is created, it will automatically be linked to
the source package.

Implementation details
----------------------

Added LicenseWidget.source_package_release attribute, so that the widget
template can display $source_package_release/+copyright.
    lib/canonical/widgets/product.py
    lib/canonical/widgets/templates/license.pt

Add source_package_name and distroseries hidden fields to
ProjectAddStepOne/Two. Removed unnecessary copying of data variables
into self.request.form, since they are already available as
self.request.form['field.*'].
Verify that the user is redirected back to the source package, that they
are linked, and that there is an informational message explaining that.
    lib/lp/registry/browser/product.py
    lib/lp/registry/stories/packaging/xx-sourcepackage-packaging.txt
    lib/lp/registry/templates/product-new.pt

Add source_package_name and distroseries to the url that takes you from
the source package page to the /projects/+new page. Since the source
package is autolinked after creating the project, there is no need to
redirect the user back to +edit-packaging, so the return_url is now just
set to the canonical url for the source package.
    lib/lp/registry/browser/sourcepackage.py
    lib/lp/registry/browser/tests/test_sourcepackage_views.py

Fixed bad tests that were dependent on copying fields from data to
self.request.form.
    lib/lp/registry/browser/tests/project-add-views.txt

Tests
-----

./bin/test -vv -t 'test_sourcepackage_views|project-add-views|xx-sourcepackage-packaging'

Demo and Q/A
------------

Add copyright information on launchpad.dev by running this query.
 UPDATE SourcePackageRelease
 SET copyright =
   'The following line should be highlighted since it looks like a license
    /usr/share/common-licenses/GPL-2
    foo
    bar
    baz
    1
    2
    3
    4';

* Open http://launchpad.dev/ubuntu/hoary/+source/pmount
    1. Select "Register the upstream project" radio button.
    2. Click on "Link to Upstream Project"
    3. You should now be on Step 2 of the /projects/+new page.
    4. Verify that clicking on the green "Copyright info from source package"
       link expands the copyright.
    5. Select a license.
    6. Click on "Complete registration and link to pmount package".
    7. You now be redirected back to
       http://launchpad.dev/ubuntu/hoary/+source/pmount
       There should be an informational message saying:
       "Linked Pmount project to pmount source package"
       and the "Upstream connections" portlet should show Pmount=>trunk.
* Click on the yellow edit-icon next to Pmount=>trunk.
    * Click on the "Register the upstream project" link.
    * The /projects/+new page should give you an error that pmount is
      already used by another project.
    * Choose a different URL, click Continue, click
      "No, this is a new project", and then follow steps 3 through 6 above.
    * If you didn't use a different displayname, you will have to hover
      over the first link in Pmount=>trunk to see that it points to the
      new pmount project and not the first one you created.

To post a comment you must log in.
Revision history for this message
Leonard Richardson (leonardr) wrote :

r=me with the minor changes discussed on IRC (Seeing whether 'count' is really neccessary, reformatting the line wrap when printing out the email so as to avoid confusing readers of the tests.)

review: Approve
Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

Thanks for the review. The count was actually used by the javascript to decide whether to expand a section of licenses by the count of licenses checked. I changed the attribute to start_expanded to clearly describe its intent.

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

This looks nice. The lack realistic sourcepackages in sample data make this hard to see. I like what I do see. I think this is fine to land. We can fix issues that users report, or we see when the form is used with real data.

review: Approve (ui)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to status/vote changes: