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

update API #177

Merged
merged 10 commits into from
Sep 3, 2022
Merged

update API #177

merged 10 commits into from
Sep 3, 2022

Conversation

al-niessner
Copy link
Contributor

@al-niessner al-niessner commented Aug 29, 2022

🗒️ Summary

Changed the endpoints to match the desires of the review board. Implement all of the requested endpoints.

⚙️ Test Data and/or Report

Output from ut/regress.sh

♻️ Related Issues

Closes NASA-PDS/pds-api#202

Added all of the new endpoints in groups classes, references, and products.

Added all of the old endpoints in the group deprecrated.
@al-niessner al-niessner self-assigned this Aug 29, 2022
Al Niessner added 3 commits September 1, 2022 05:53
Update swagger.yml to match the proposal plus any additions and clarification on the original ticket NASA-PDS/pds-api#202.

Re-arranged the code to fit the new API. Required some new exceptions and tweaks to the basic interfaces to support the membership concept outside of just referencing in general and that a lidvid necessarily match a particular product type.

Added new swagger transmutation layers to support the easy removal of deprecated code in the future and to support easier maintenance in the future. Left the old referencing suff only because there is a chance it may come back in the newish future to support some other use cases.

The new swagger transmutation layers still all funnel through a single processor once all of the inputs have been collected. The deprecated code mostly works itself through the new API showing that what could be done still can using the inew API. Did not want to update the standard handler to also check that desired class matches the lid(vid) so did not route those but they could also be done with a touch more code change just for that demonstration whcih is why it was not done.
@al-niessner al-niessner marked this pull request as draft September 1, 2022 20:15
@al-niessner al-niessner marked this pull request as ready for review September 1, 2022 21:16
Given the new endpoints of /classes/{class}/{identifier} have to verify the {identifier} is actually of the type {class}. Previous commit had a blank for this function but need it filled out to test it.
Copy link
Member

@jordanpadams jordanpadams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple questions, but approved with a pre-req that tests pass successfully.

model/swagger.yml Show resolved Hide resolved
model/swagger.yml Show resolved Hide resolved
@al-niessner
Copy link
Contributor Author

@jordanpadams @jimmie @tloubrieu-jpl

Struggling right now because none of the endpoints are reachable despite no errors during build. Changed all version numbers to make sure that is not the problem, but seems not be. Trying to get it fixed and tested during driving breaks.

@al-niessner
Copy link
Contributor Author

@jordanpadams @jimmie @tloubrieu-jpl

Struggling right now because none of the endpoints are reachable despite no errors during build. Changed all version numbers to make sure that is not the problem, but seems not be. Trying to get it fixed and tested during driving breaks.

@jordanpadams @jimmie @tloubrieu-jpl

Figured it out. A limitation of swagger/spring forces all of the methods to be in the @controller rather than inherited. Luckily eclipse put the methods in for and forwarded them to the inherited methods. Moving forward.

Al Niessner added 4 commits September 3, 2022 11:10
Seems there is a limitation in spring (maybe swagger) that the methods to be used in a @controller must be present in the class and not inherited. This makes the code a bit more repetitive, but it works.
Had to update the endpoints to match the new API. Simply tested what already existed and did not add any new tests for new corner cases.

Had to update the number of collections and products too. Seems my latest install of data from harvest is smaller than before. However it all fits the current data in my opensearch now.
@al-niessner
Copy link
Contributor Author

@jordanpadams @jimmie @tloubrieu-jpl

All working once again:

niessner@elysium:~/Projects/PDS/registry-api$ service/ut/regress.sh 
============================= test session starts ==============================
platform linux -- Python 3.8.10, pytest-4.6.9, py-1.8.1, pluggy-0.13.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /home/niessner/Projects/PDS/registry-api
collected 30 items                                                             

service/ut/base_ut.py::test_bad_group PASSED                             [  3%]
service/ut/base_ut.py::test_bad_lidvid PASSED                            [  6%]
service/ut/base_ut.py::TestAny::test_bundles PASSED                      [ 10%]
service/ut/base_ut.py::TestAny::test_collections PASSED                  [ 13%]
service/ut/base_ut.py::TestAny::test_lidvid PASSED                       [ 16%]
service/ut/base_ut.py::TestAny::test_lidvid_all PASSED                   [ 20%]
service/ut/base_ut.py::TestAny::test_lidvid_latest PASSED                [ 23%]
service/ut/base_ut.py::TestAny::test_products PASSED                     [ 26%]
service/ut/base_ut.py::TestBundles::test_bundles PASSED                  [ 30%]
service/ut/base_ut.py::TestBundles::test_collections PASSED              [ 33%]
service/ut/base_ut.py::TestBundles::test_collections_all PASSED          [ 36%]
service/ut/base_ut.py::TestBundles::test_collections_latest PASSED       [ 40%]
service/ut/base_ut.py::TestBundles::test_lidvid PASSED                   [ 43%]
service/ut/base_ut.py::TestBundles::test_lidvid_all PASSED               [ 46%]
service/ut/base_ut.py::TestBundles::test_lidvid_latest PASSED            [ 50%]
service/ut/base_ut.py::TestBundles::test_products PASSED                 [ 53%]
service/ut/base_ut.py::TestCollections::test_bundles PASSED              [ 56%]
service/ut/base_ut.py::TestCollections::test_collections PASSED          [ 60%]
service/ut/base_ut.py::TestCollections::test_lidvid PASSED               [ 63%]
service/ut/base_ut.py::TestCollections::test_lidvid_all PASSED           [ 66%]
service/ut/base_ut.py::TestCollections::test_lidvid_latest PASSED        [ 70%]
service/ut/base_ut.py::TestCollections::test_products PASSED             [ 73%]
service/ut/base_ut.py::TestCollections::test_products_all PASSED         [ 76%]
service/ut/base_ut.py::TestCollections::test_products_latest PASSED      [ 80%]
service/ut/base_ut.py::TestProducts::test_bundles PASSED                 [ 83%]
service/ut/base_ut.py::TestProducts::test_collections PASSED             [ 86%]
service/ut/base_ut.py::TestProducts::test_lidvid PASSED                  [ 90%]
service/ut/base_ut.py::TestProducts::test_lidvid_all PASSED              [ 93%]
service/ut/base_ut.py::TestProducts::test_lidvid_latest PASSED           [ 96%]
service/ut/base_ut.py::TestProducts::test_products PASSED                [100%]

========================== 30 passed in 0.81 seconds ===========================

@al-niessner al-niessner merged commit de5ef63 into main Sep 3, 2022
@al-niessner al-niessner deleted the pds-api-202 branch September 3, 2022 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Complete refactoring per API WG discussion on end-point redesign
2 participants