← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/fix-dsp-index-version-link into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/fix-dsp-index-version-link into lp:launchpad.

Commit message:
Link to package versions on DSP:+index using fmt:url rather than just a relative link to the version, to avoid problems with epochs.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1629058 in Launchpad itself: "Can access released packages"
  https://bugs.launchpad.net/launchpad/+bug/1629058

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/fix-dsp-index-version-link/+merge/307378

Link to package versions on DSP:+index using fmt:url rather than just a relative link to the version, to avoid problems with epochs.

We arguably ought to actually URL-encode the path rather than relying on browsers stopping parsing the scheme at "/", but this is a much less invasive change for now and fixes the problem at hand; it brings the links on DSP:+index into line with those on DSP:+publishinghistory.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/fix-dsp-index-version-link into lp:launchpad.
=== modified file 'lib/lp/registry/templates/distributionsourcepackage-index.pt'
--- lib/lp/registry/templates/distributionsourcepackage-index.pt	2015-09-07 12:42:33 +0000
+++ lib/lp/registry/templates/distributionsourcepackage-index.pt	2016-10-01 13:32:34 +0000
@@ -146,7 +146,7 @@
           <a class="expander"
              tal:attributes="id string:pub${pub/id}-expander;
                              href string:${pub/archive/fmt:url}/+sourcepub/${pub/id}/+listing-archive-extra"></a>
-          <a tal:attributes="href row/version">
+          <a tal:attributes="href pub/meta_distributionsourcepackagerelease/fmt:url">
             <img src="/@@/package-source" />
             <tal:version content="row/version"/>
           </a>

=== modified file 'lib/lp/soyuz/stories/distribution/xx-distribution-packages.txt'
--- lib/lp/soyuz/stories/distribution/xx-distribution-packages.txt	2016-05-17 09:48:54 +0000
+++ lib/lp/soyuz/stories/distribution/xx-distribution-packages.txt	2016-10-01 13:32:34 +0000
@@ -217,6 +217,13 @@
       iceweasel-1.0.dsc (123 bytes)
       mozilla-firefox_0.9_i386.deb (3 bytes)
 
+The version itself links to the corresponding distro package release.  (Our
+search includes a leading space in order to exclude the "Latest upload:"
+link.)
+
+    >>> print user_browser.getLink(" 1.0").attrs['href']
+    /ubuntu/+source/iceweasel/1.0
+
 There's also a section on the page that gives some package information:
 
     >>> print extract_text(find_tag_by_id(user_browser.contents, 'current'))


Follow ups