This is my branch to prevent packaging links to unpublished Ubuntu packages. lp:~sinzui/launchpad/non-existent-packages-bug-204119 Diff size: 305 Launchpad bug: https://bugs.launchpad.net/bugs/204119 Test command: ./bin/test -vv \ -t packaging-views.txt \ -t xx-product-package-pages.txt \ -t xx-productseries-index.txt Pre-implementation: beuno, bigjools, flacoste Target release: 10.01 = Prevent packaging links to unpublished Ubuntu packages = Launchpad allows users to create links to non-existent packages such as https://edge.launchpad.net/ubuntu/breezy/+source/warzone2100. 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) * https://edge.launchpad.net/gdp/+packages * 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-plugins into the source package name field and submit * Verify that the error message is: The source package is not published in Lucid == Lint == Linting changed files: lib/lp/registry/browser/packaging.py lib/lp/registry/browser/productseries.py lib/lp/registry/browser/tests/packaging-views.txt lib/lp/registry/stories/product/xx-product-package-pages.txt lib/lp/registry/stories/productseries/xx-productseries-index.txt lib/lp/registry/templates/product-packages.pt lib/lp/registry/templates/productseries-portlet-packages.pt lib/lp/registry/templates/productseries-ubuntupkg.pt lib/lp/testing/factory.py == Test == * lib/lp/registry/browser/tests/packaging-views.txt * lib/lp/registry/stories/product/xx-product-package-pages.txt * lib/lp/registry/stories/productseries/xx-productseries-index.txt == Implementation == * lib/lp/registry/browser/packaging.py * lib/lp/registry/browser/productseries.py * lib/lp/registry/templates/product-packages.pt * lib/lp/registry/templates/productseries-portlet-packages.pt * lib/lp/registry/templates/productseries-ubuntupkg.pt * lib/lp/testing/factory.py * Fixed makeGPGKey() which was making duplicate fingerprints in the test, causing a constrain violation.