NASA-PDS / registry-api

Web API service for the PDS Registry, providing the implementation of the PDS Search API (https://github.com/nasa-pds/pds-api) for the PDS Registry.
https://nasa-pds.github.io/pds-api
Apache License 2.0
2 stars 5 forks source link

As a user, by default, I want to search only for the latest versions of all products on the `/products` endpoint #426

Closed jordanpadams closed 1 month ago

jordanpadams commented 2 years ago

šŸ’Ŗ Motivation

...so that I am not confused by seeing superseded data returned in search results

šŸ“– Additional Details

Per the parent epic, and the design we need to update the API to implement these changes so we can sufficiently understand the version history.

See parent epic for more details.

āš–ļø Acceptance Criteria

AC 1

Given the products urn:nasa:pds:mars2020.spice::1.0, urn:nasa:pds:mars2020.spice::2.0, and urn:nasa:pds:mars2020.spice::3.0 have been loaded into the registry (see registry-ref-data) and in archived status When I perform a query of the API for /products and paginate through the results and/or apply any other filtering that would include this SPICE bundle Then I expect I should get only the latest v3.0 product returned (urn:nasa:pds:mars2020.spice::3.0)

AC 2

Given the products urn:nasa:pds:mars2020.spice::1.0, urn:nasa:pds:mars2020.spice::2.0, and urn:nasa:pds:mars2020.spice::3.0 have been loaded into the registry (see registry-ref-data) and in archived status When I perform a query of the API for /products/urn:nasa:pds:mars2020.spice::1.0 Then I expect I should get the older version 1.0 of the product (urn:nasa:pds:mars2020.spice::1.0) because it was explicitly requested

AC 3

Note: This AC depends upon the completion of this requirement: https://github.com/NASA-PDS/registry-api/issues/427 Given the context products urn:nasa:pds:context:instrument:crs.vg1::1.0 and urn:nasa:pds:context:instrument:vg1.crs::1.0 ingested into the registry When I perform a query of the API for /products and paginate through the results, or perform any additional filtering on the data Then I expect I should only see the product metadata for urn:nasa:pds:context:instrument:vg1.crs::1.0 returned, not the superseded/deprecated urn:nasa:pds:context:instrument:crs.vg1::1.0

āš™ļø Engineering Details

See parent ticket for related requirements:

jordanpadams commented 2 years ago

alternate_ids implemented but we now need to build this into the API so we use this field and date time to properly support version histories.

tloubrieu-jpl commented 2 years ago

@jordanpadams @al-niessner I believe it will be better to wait for the redesign to be completed before working on that.

jordanpadams commented 1 month ago

@alexdunnjpl just want to confirm that this has a test in the test suite and can be closed alongside #503 #487 #484 #485 #486 ?

alexdunnjpl commented 1 month ago

@jordanpadams There is not a distinct test for this issue, but coverage (of the common code path subsetting a result set to non-superseded products) is provided by the new tests for those tickets.