Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement 'latest' API and release-view endpoints #8615

Closed
wants to merge 42 commits into from

Commits on Jan 22, 2021

  1. Add 'latest' redirect to main project view

    Need to add trailing-slash redirect, also.
    bskinn committed Jan 22, 2021
    Configuration menu
    Copy the full SHA
    cefbbce View commit details
    Browse the repository at this point in the history
  2. Switch to HTTP 307 for the 'latest' redirect

    Always want the browser to recheck this endpoint, in case the
    redirect target changes.
    bskinn committed Jan 22, 2021
    Configuration menu
    Copy the full SHA
    d995624 View commit details
    Browse the repository at this point in the history
  3. Fix routes-check test and add latest_slash

    Still need to actually test the latest logic.
    bskinn committed Jan 22, 2021
    Configuration menu
    Copy the full SHA
    1efceae View commit details
    Browse the repository at this point in the history
  4. Apply reformat

    bskinn committed Jan 22, 2021
    Configuration menu
    Copy the full SHA
    ae850ae View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    9c7818c View commit details
    Browse the repository at this point in the history
  6. Complete API routes and logic

    Switch latest from a redirect to /pypi/{name}/json, and instead
    duplicate the version-search logic. This should make `latest` robust
    against any future changes to the `json_project` logic.
    
    Implement latest-stable and latest-unstable logic.
    bskinn committed Jan 22, 2021
    Configuration menu
    Copy the full SHA
    8a9bde9 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    70d7204 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    187addb View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    728c6d4 View commit details
    Browse the repository at this point in the history
  10. Complete latest tests, add unstable tests

    Need to fix unstable query (or test?), is redirecting to the
    most recent stable version instead of most recent prerelease
    for project_with_pre
    bskinn committed Jan 22, 2021
    Configuration menu
    Copy the full SHA
    b961397 View commit details
    Browse the repository at this point in the history
  11. Reorder project_with_pre release creation

    Apparently, the _pypi_ordering is a function of the order in which
    Releases are added to a Project.
    
    Seems potentially brittle.
    bskinn committed Jan 22, 2021
    Configuration menu
    Copy the full SHA
    ab7f284 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    8967523 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    75b19bc View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    be00837 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    0ee0178 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    eaa9971 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    0f1efaa View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    51662d4 View commit details
    Browse the repository at this point in the history

Commits on Jan 27, 2021

  1. 1) Start docs work

    [skip ci]
    
    2) Draft latest JSON doc chunk
    
    [skip ci]
    
    3) Add docs for 'latest' web UI endpoints
    
    Plus a bit of tweaking to the JSON docs language.
    bskinn committed Jan 27, 2021
    Configuration menu
    Copy the full SHA
    5823118 View commit details
    Browse the repository at this point in the history

Commits on Apr 20, 2021

  1. Merge remote-tracking branch 'upstream/main' into latest-json

    Refreshing base branch underneath the PR.
    bskinn committed Apr 20, 2021
    Configuration menu
    Copy the full SHA
    36a9be3 View commit details
    Browse the repository at this point in the history

Commits on Apr 21, 2021

  1. Convert 'latest' JSON endpoint to direct result

    Not that bad! The sqlalchemy magic is pretty darn intuitive!
    bskinn committed Apr 21, 2021
    Configuration menu
    Copy the full SHA
    1da81c2 View commit details
    Browse the repository at this point in the history
  2. Rework stable and unstable to direct returns.

    Getting errors on local tests; will see how CI does.
    bskinn committed Apr 21, 2021
    Configuration menu
    Copy the full SHA
    930a66d View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2021

  1. Refactor latest version lookup for missing release

    Depending on how the various version lookups are called,
    project.latest_version may itself return None. So, breaking up
    the attribute access chain will be more robust.
    
    Could have used .getattr() here, but stringifying the member names
    in the actual codebase (as opposed to in test code) seemed imprudent.
    bskinn committed Apr 22, 2021
    Configuration menu
    Copy the full SHA
    d81ecc9 View commit details
    Browse the repository at this point in the history
  2. Switch 'latest JSON' tests to mocked responses

    Instead of testing them as redirects, as originally implemented,
    they are now tested via catching the call-through to the underlying
    json_release() JSON API function.
    bskinn committed Apr 22, 2021
    Configuration menu
    Copy the full SHA
    ede8041 View commit details
    Browse the repository at this point in the history
  3. Merge remote-tracking branch 'upstream/main' into latest-json

    Refresh branch base.
    bskinn committed Apr 22, 2021
    Configuration menu
    Copy the full SHA
    b87a826 View commit details
    Browse the repository at this point in the history

Commits on Apr 23, 2021

  1. Refactor check functions to class-scope fixtures

    Fixtures allow monkeypatching; making them class-scope keeps
    their definitions closer to the tests and prevents (possibly
    undesirably) re-use elsewhere.
    
    If they end up needed elsewhere, they can easily be refactored
    out to conftest.py.
    bskinn committed Apr 23, 2021
    Configuration menu
    Copy the full SHA
    c57792c View commit details
    Browse the repository at this point in the history
  2. Switch JSON database query to .one()

    As noted in discussion in pypi#8615, zero or multiple query results in this
    case are a pathological scenario.
    bskinn committed Apr 23, 2021
    Configuration menu
    Copy the full SHA
    ed0baa1 View commit details
    Browse the repository at this point in the history

Commits on Apr 27, 2021

  1. Switch 'latest' properties to return Releases

    No failures introduced to test suite on the change.
    bskinn committed Apr 27, 2021
    Configuration menu
    Copy the full SHA
    1cb61d6 View commit details
    Browse the repository at this point in the history

Commits on May 17, 2021

  1. Configuration menu
    Copy the full SHA
    ee873dd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ea27efa View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b1dfd94 View commit details
    Browse the repository at this point in the history
  4. Revise JSON docs to remove 'redirect' mentions

    JSON API views now directly return, rather than redirecting.
    
    Per
    pypi#8615 (review)
    bskinn committed May 17, 2021
    Configuration menu
    Copy the full SHA
    0306080 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    dc83830 View commit details
    Browse the repository at this point in the history
  6. Add 'latest' views tests for no-release projects

    For completeness, and to satisfy 100% coverage requirement.
    bskinn committed May 17, 2021
    Configuration menu
    Copy the full SHA
    a8a0cf4 View commit details
    Browse the repository at this point in the history
  7. Streamline release handling in latest JSON calls

    Addresses pypi#8615 (comment).
    
    The database queries inline here may be duplicative; will check
    in a subsequent commit.
    bskinn committed May 17, 2021
    Configuration menu
    Copy the full SHA
    9415413 View commit details
    Browse the repository at this point in the history
  8. Remove redundant dbquery in 'latest' JSON

    The 'latest' members off of the Project model now return
    fully-realized Release instances, making a subsequent database
    call unnecessary.
    bskinn committed May 17, 2021
    Configuration menu
    Copy the full SHA
    688d842 View commit details
    Browse the repository at this point in the history

Commits on May 18, 2021

  1. Merge pull request #1 from bskinn/latest-json-pr-review

    Latest json pr review
    bskinn committed May 18, 2021
    Configuration menu
    Copy the full SHA
    58b13aa View commit details
    Browse the repository at this point in the history
  2. Add sidestep for pypa/pip#9644

    Should be removed before merging pypi#8615
    bskinn committed May 18, 2021
    Configuration menu
    Copy the full SHA
    c6f664a View commit details
    Browse the repository at this point in the history
  3. Revert "Add sidestep for pypa/pip#9644"

    This reverts commit c6f664a.
    bskinn committed May 18, 2021
    Configuration menu
    Copy the full SHA
    715816c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b66109f View commit details
    Browse the repository at this point in the history

Commits on May 19, 2021

  1. Configuration menu
    Copy the full SHA
    9957daa View commit details
    Browse the repository at this point in the history

Commits on May 28, 2021

  1. Configuration menu
    Copy the full SHA
    4f0b075 View commit details
    Browse the repository at this point in the history