Merge lp://staging/~sinzui/launchpad/obsolete-series-0 into lp://staging/launchpad

Proposed by Curtis Hovey
Status: Merged
Approved by: Brad Crittenden
Approved revision: no longer in the source branch.
Merged at revision: 11002
Proposed branch: lp://staging/~sinzui/launchpad/obsolete-series-0
Merge into: lp://staging/launchpad
Diff against target: 271 lines (+90/-19)
10 files modified
lib/lp/registry/browser/__init__.py (+3/-0)
lib/lp/registry/browser/product.py (+1/-1)
lib/lp/registry/browser/tests/product-files-views.txt (+20/-0)
lib/lp/registry/browser/tests/productseries-views.txt (+8/-0)
lib/lp/registry/interfaces/productseries.py (+5/-2)
lib/lp/registry/scripts/productreleasefinder/finder.py (+3/-1)
lib/lp/registry/stories/team/xx-team-membership.txt (+8/-0)
lib/lp/registry/stories/webservice/xx-project-registry.txt (+1/-0)
lib/lp/registry/templates/person-participation.pt (+17/-13)
lib/lp/registry/tests/test_prf_finder.py (+24/-2)
To merge this branch: bzr merge lp://staging/~sinzui/launchpad/obsolete-series-0
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code Approve
Review via email: mp+27319@code.staging.launchpad.net

Description of the change

This is my branch to prevent timeout caused by the product-release-finder.

    lp:~sinzui/launchpad/obsolete-series-0
    Diff size:
    Launchpad bug:5
          https://bugs.launchpad.net/bugs/590806
          https://bugs.launchpad.net/bugs/490945
    Test command: ./bin/test -vv \
          -t productseries-views -t GetFiltersTestCase -t xx-project-registry
    Pre-implementation: no one.
    Target release: 10.06

prevent timeout caused by the product-release-finder
----------------------------------------------------

A review of the PRF revealed that it was downloading files and creating
released for series that belong to obsolete junk. These series are obsolete so
the PRF must ignore them. The releases were deleted when the series was moved
to obsolete junk. There are timeouts on obsolete-junks pages because there
PRF recreated information that users wanted gone.

ADDENDUM Bug #490945 [obsolete series takes precedence over stable]
    If I move milestone 1.5, for instance, to obsolete instead of stable, the
    main download page ( https://launchpad.net/kabikaboo/ ) changes the
    primary download to the newest obsolete download

Rules
-----

    * Ensure the file release glob is set to Null during series delete
    * Ensure that the series status is set to Obsolete
    * Ensure that the PRF ignores Obsolete series
    * Export releasefileglob to API so that problem series can be fixed
      before 10.06 is released.

ADDENDUM Bug #490945 [obsolete series takes precedence over stable]
    * latest_release_with_download_files() should use
      sorted_active_series_list() to filter out obsolete series.

QA
--

    * Verify that a deletes series is marked obsolete and that the
      filereleaseglob is set to None
    * Verify that the release_file_glob is visible:
        from lpscripts import lp_factory
        from launchpadlib.launchpad import (
            Launchpad, EDGE_SERVICE_ROOT, STAGING_SERVICE_ROOT)
        lp = lp_factory('edge', app_name='testing')
        project = lp.projects['gedit']
        series = project.getSeries(name='master')
        print series.name
        print series.release_file_glob

ADDENDUM Bug #490945 [obsolete series takes precedence over stable]
    * Visit a project with a release shown of the front page.
    * Mark the series obsolete
    * Verify the release changes on the front page.

Lint
----

Linting changed files:
  lib/lp/registry/browser/__init__.py
  lib/lp/registry/browser/product.py
  lib/lp/registry/browser/tests/product-files-views.txt
  lib/lp/registry/browser/tests/productseries-views.txt
  lib/lp/registry/interfaces/productseries.py
  lib/lp/registry/scripts/productreleasefinder/finder.py
  lib/lp/registry/stories/webservice/xx-project-registry.txt
  lib/lp/registry/tests/test_prf_finder.py

Test
----
    * lib/lp/registry/browser/tests/product-files-views.txt
      * Verify that obsolete releases are not shown on the project's index
        page.
    * lib/lp/registry/browser/tests/productseries-views.txt
      * Verify that the "deleted" series was marked obsolete and the
        relasefileglob was set to None.
    * lib/lp/registry/stories/webservice/xx-project-registry.txt
      * Verify that release_file_glob is exported.
    * lib/lp/registry/tests/test_prf_finder.py
      * Verify that obsolete series are not included in the finder filters.

Implementation
--------------

    * lib/lp/registry/browser/__init__.py
      * Marked the series as obsolete and clear the releasefileglob when
        the user deletes (moves) the series.
    * lib/lp/registry/browser/product.py
      * Use sorted_active_series_list in latest_release_with_download_files().
    * lib/lp/registry/interfaces/productseries.py
      * Export release_file_glob so that I can see and fix the damage.
    * lib/lp/registry/scripts/productreleasefinder/finder.py
      * Skip obsolete series.

To post a comment you must log in.
Revision history for this message
Brad Crittenden (bac) wrote :

Hi Curtis, thanks for this branch.

On IRC we discussed the following:

* Test update to lib/lp/registry/browser/tests/product-files-views.txt to properly show the latest release with downloads. (http://pastebin.ubuntu.com/448271/)

Also,

* I hate 'releasefileglob' but it is too ingrained to change.

* What would you think about adding a launchpadlib test to exercise the newly exported release_file_glob? On the one hand it would be a dumb test showing just that one field out of a zillion. On the other, we've got to start somewhere.

review: Approve (code)

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.