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

Issue 131: increase adaptability #142

Merged
merged 31 commits into from
Jun 13, 2022
Merged

Issue 131: increase adaptability #142

merged 31 commits into from
Jun 13, 2022

Conversation

al-niessner
Copy link
Contributor

@al-niessner al-niessner commented May 24, 2022

🗒️ Summary

Changed endpoints to be more adaptable to changes

⚙️ Test Data and/or Report

Ran tests developed previously to check the basic combinations as step before integration testing:

$ 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 24 items                                                             

service/ut/base_ut.py::test_bad_group PASSED                             [  4%]
service/ut/base_ut.py::test_bad_lidvid PASSED                            [  8%]
service/ut/base_ut.py::TestBundles::test_bundles PASSED                  [ 12%]
service/ut/base_ut.py::TestBundles::test_collections PASSED              [ 16%]
service/ut/base_ut.py::TestBundles::test_collections_all PASSED          [ 20%]
service/ut/base_ut.py::TestBundles::test_collections_latest PASSED       [ 25%]
service/ut/base_ut.py::TestBundles::test_lidvid PASSED                   [ 29%]
service/ut/base_ut.py::TestBundles::test_lidvid_all PASSED               [ 33%]
service/ut/base_ut.py::TestBundles::test_lidvid_latest PASSED            [ 37%]
service/ut/base_ut.py::TestBundles::test_products PASSED                 [ 41%]
service/ut/base_ut.py::TestCollections::test_bundles PASSED              [ 45%]
service/ut/base_ut.py::TestCollections::test_collections PASSED          [ 50%]
service/ut/base_ut.py::TestCollections::test_lidvid PASSED               [ 54%]
service/ut/base_ut.py::TestCollections::test_lidvid_all PASSED           [ 58%]
service/ut/base_ut.py::TestCollections::test_lidvid_latest PASSED        [ 62%]
service/ut/base_ut.py::TestCollections::test_products PASSED             [ 66%]
service/ut/base_ut.py::TestCollections::test_products_all PASSED         [ 70%]
service/ut/base_ut.py::TestCollections::test_products_latest PASSED      [ 75%]
service/ut/base_ut.py::TestProducts::test_bundles PASSED                 [ 79%]
service/ut/base_ut.py::TestProducts::test_collections PASSED             [ 83%]
service/ut/base_ut.py::TestProducts::test_lidvid PASSED                  [ 87%]
service/ut/base_ut.py::TestProducts::test_lidvid_all PASSED              [ 91%]
service/ut/base_ut.py::TestProducts::test_lidvid_latest PASSED           [ 95%]
service/ut/base_ut.py::TestProducts::test_products PASSED                [100%]

========================== 24 passed in 1.09 seconds =======================

♻️ Related Issues

#141
#133
#131
#118
#12
#11

Al Niessner added 18 commits May 4, 2022 14:47
Having /{group} and /{id} is too much for swagger as it is not smart enough at the Java layer to differentiate. Had to put gid (group ID) and uid (unique ID as in lid, lidvid, or doi or...) in the front to separate them out.
/gid/{group} and /uid/{identifier} are working again. Need to test the parent/child relationships but seems to be on the right track.

/ still is broken but it seems to be a spring 2.6.6 thing. Not the only person in the world to have this problem but it is not about finding / as much as finding the redirect to /swagger-ui.html. Need to track that down.
@al-niessner al-niessner self-assigned this May 24, 2022
@tloubrieu-jpl
Copy link
Member

Hi @al-niessner , @jordanpadams

I am not finding the ticket where Al's full proposal for refactoring the URL path is (although I have pasted your proposal in a note of mine).
Sorry if it feels like I am ignoring some aspects of Al's proposal but I am trying to stick to some design principles that I am providing here and the ticket objective (and Al's proposal) was mainly focused on simplification of the registry API code which is important but not our main driver I think.

Here is my proposal, that we can discuss this afternoon:

Drivers for the design:
In this order of priority:

  1. Transparently shows the PDS4 model (as much as possible) so not to re-invent a PDS model and require to document new concepts specifically for the API (for example use relationships as specified in https://pds.nasa.gov/datastandards/documents/dd/current/PDS4_PDS_DD_1H00.html#N-2021801474)
  2. Follow the web restful API design principle and best practices (for example resources specified as nouns are preferred over verbs in the URL path)
  3. Refer to use cases to validate the design
  4. Have in mind a simple implementation which will help with the maintainability of the code and the readability of the behavior of the API

Search and identifier resolution:

For all products:
http://pds.nasa.gov/api/search/1.0/products/{id}

For specific groups of products (classes):
http://pds.nasa.gov/api/search/1.0/{class} as found in https://pds.nasa.gov/datastandards/documents/dd/current/PDS4_PDS_DD_1H00.html#d5e85, by taking the part after Product_ and making it lower case and plural, for example:

Note the list given in https://pds.nasa.gov/datastandards/documents/dd/current/PDS4_PDS_DD_1H00.html#d5e85 is sometimes not consistent in having nouns as the part after Product_ although most of them are nouns. Rest-ful apis prefers nouns (see https://restfulapi.net/resource-naming/ ). We could replace the adjective or verbs by related nouns:

  • browse --> browseable (anything better ?)
  • observational --> observation

in swagger specification we would only have this endpoint entry:
http://pds.nasa.gov/api/search/1.0/{class} where class is 'products' (anything) or other specific classes (softwares, bundles...)

Referencing:
Post used a reference: https://www.moesif.com/blog/technical/api-design/REST-API-Design-Best-Practices-for-Sub-and-Nested-Resources/

From any identifier resolution URL (for example http://pds.nasa.gov/api/search/1.0/observationals/{id} or http://pds.nasa.gov/api/search/1.0/bundles /{id}) we can get their references by roles of the association as shown on the diagram on page https://pds.nasa.gov/datastandards/documents/im/current/index_1H00.html

For example:

  • bundles has-member collections --> bundles/{id}/member-collections returns list of collection ids
  • collections has-member observationals --> collections/{id}/member-observationals returns list of observationals and documents
  • collections as-member documents --> collections/{id}/document-members
  • bundles has members collections have members observationals or documents --> /bundles/{id}/member-collections/member-observationals (but should we do that or rely on the user to do 2 requests instead of one, since I don't know the exact use case, I would lean toward the later)
  • observationals is-member-of collections --> observationals/{id}/owner-collections returns list of collection ids
  • documents is-member-of collections --> documents/{id}/owner-collections returns list of collection ids
  • collections is-member-of bundles--> collections/{id}/owner-bundles returns list of bundles id
  • observationals is-member-of collections is-member-of bundles --> observationals/{id}/owner-collections/owner-bundles (but should we do that or rely on the user to do 2 requests instead of one)

Alternate option is not to have instead of collection-members only members or instead of bundle-owners only owners . That would less explicit for the user but more simple and that might be obvious enough/documented elsewhere for the users.

products/{id} would not have any referencing besides the generic referencing that a product might have, could be for example Citation_Information which applies to any class of product (see https://pds.nasa.gov/datastandards/documents/dd/current/PDS4_PDS_DD_1H00.html#N-2006280352). Although we don't have specific entries with identifiers for dois in the registry yet.

@al-niessner
Copy link
Contributor Author

al-niessner commented Jun 2, 2022

/products/{id}/[containers,members]/[all,latest]
/products/{id}/[references,referenced_by}]{group name}/[all,latest]
/products/{id}/[all,latest]
/groups/{group name}/[all,latest]

@tloubrieu-jpl
Copy link
Member

tloubrieu-jpl commented Jun 2, 2022

CANCELLED

@tloubrieu-jpl
Copy link
Member

tloubrieu-jpl commented Jun 9, 2022

@al-niessner I am seeing that you developed regression tests in python. We would like to consolidate the postman test suite as well (which can be run also in command line), could you work with that in the future ? Thanks

If we can have unit tests they would be developed in Java but I believe what you did is integration tests since they require the registry database to be up and populated.

Let me know if you have questions on that.

Thanks

@al-niessner
Copy link
Contributor Author

@tloubrieu-jpl

Yes, will move to postman when postman checks are integrated into checks done a pull request.

@tloubrieu-jpl
Copy link
Member

tloubrieu-jpl commented Jun 10, 2022

Hi @al-niessner I am getting an error when I do the request ``http://localhost:8081/` which redirects on http://localhost:8081/swagger-ui.html

Error sent is:
image

Logs give:

2022-06-10 21:08:53.853 DEBUG 75288 --- [nio-8081-exec-1] o.a.tomcat.util.net.SocketWrapperBase    : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@49e76d18:org.apache.tomcat.util.net.NioChannel@3a6d0e08:java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1:8081 remote=/0:0:0:0:0:0:0:1:51305]], Read from buffer: [0]
2022-06-10 21:08:53.855 DEBUG 75288 --- [nio-8081-exec-1] org.apache.tomcat.util.net.NioEndpoint   : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@49e76d18:org.apache.tomcat.util.net.NioChannel@3a6d0e08:java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1:8081 remote=/0:0:0:0:0:0:0:1:51305]], Read direct from socket: [920]
2022-06-10 21:08:53.860 DEBUG 75288 --- [nio-8081-exec-1] o.a.coyote.http11.Http11InputBuffer      : Received [GET / HTTP/1.1
Host: localhost:8081
Connection: keep-alive
sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="102", "Google Chrome";v="102"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "macOS"
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Sec-Fetch-Site: none
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Cookie: _xsrf=2|7ae24c7b|1c43e20182b08315fc49ef578046eb03|1653281851; username-localhost-8888="2|1:0|10:1653456473|23:username-localhost-8888|44:YzM1ZTA5YTUzYTQzNDVlZjhkODUzZjkwZjRiYTBkMzE=|5bd02739555131d2cd77b80629b63f111fae2a623c2f758727c004f291eb729b"

]
2022-06-10 21:08:53.875 DEBUG 75288 --- [nio-8081-exec-1] o.a.t.util.http.Rfc6265CookieProcessor   : Cookies: Parsing b[]: _xsrf=2|7ae24c7b|1c43e20182b08315fc49ef578046eb03|1653281851; username-localhost-8888="2|1:0|10:1653456473|23:username-localhost-8888|44:YzM1ZTA5YTUzYTQzNDVlZjhkODUzZjkwZjRiYTBkMzE=|5bd02739555131d2cd77b80629b63f111fae2a623c2f758727c004f291eb729b"
2022-06-10 21:08:53.885 DEBUG 75288 --- [nio-8081-exec-1] o.a.c.authenticator.AuthenticatorBase    : Security checking request GET /
2022-06-10 21:08:53.888 DEBUG 75288 --- [nio-8081-exec-1] org.apache.catalina.realm.RealmBase      :   No applicable constraints defined
2022-06-10 21:08:53.889 DEBUG 75288 --- [nio-8081-exec-1] o.a.c.authenticator.AuthenticatorBase    : Not subject to any constraint
2022-06-10 21:08:53.906 DEBUG 75288 --- [nio-8081-exec-1] org.apache.tomcat.util.http.Parameters   : Set encoding to UTF-8
2022-06-10 21:08:53.918 DEBUG 75288 --- [nio-8081-exec-1] o.s.web.servlet.DispatcherServlet        : GET "/", parameters={}
2022-06-10 21:08:53.926 DEBUG 75288 --- [nio-8081-exec-1] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to gov.nasa.pds.api.registry.configuration.ApiDocumentation#index()
/swagger-ui.html
2022-06-10 21:08:53.944 DEBUG 75288 --- [nio-8081-exec-1] o.s.web.servlet.view.RedirectView        : View name 'redirect:', model {}
2022-06-10 21:08:53.959 DEBUG 75288 --- [nio-8081-exec-1] o.s.web.servlet.DispatcherServlet        : Completed 302 FOUND
2022-06-10 21:08:53.966 DEBUG 75288 --- [nio-8081-exec-1] o.a.coyote.http11.Http11InputBuffer      : Before fill(): parsingHeader: [true], parsingRequestLine: [true], parsingRequestLinePhase: [0], parsingRequestLineStart: [0], byteBuffer.position(): [0], byteBuffer.limit(): [0], end: [920]
2022-06-10 21:08:53.971 DEBUG 75288 --- [nio-8081-exec-1] o.a.tomcat.util.net.SocketWrapperBase    : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@49e76d18:org.apache.tomcat.util.net.NioChannel@3a6d0e08:java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1:8081 remote=/0:0:0:0:0:0:0:1:51305]], Read from buffer: [0]
2022-06-10 21:08:53.973 DEBUG 75288 --- [nio-8081-exec-1] org.apache.tomcat.util.net.NioEndpoint   : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@49e76d18:org.apache.tomcat.util.net.NioChannel@3a6d0e08:java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1:8081 remote=/0:0:0:0:0:0:0:1:51305]], Read direct from socket: [0]
2022-06-10 21:08:53.976 DEBUG 75288 --- [nio-8081-exec-1] o.a.coyote.http11.Http11InputBuffer      : Received []
2022-06-10 21:08:53.985 DEBUG 75288 --- [nio-8081-exec-1] o.apache.coyote.http11.Http11Processor   : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@49e76d18:org.apache.tomcat.util.net.NioChannel@3a6d0e08:java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1:8081 remote=/0:0:0:0:0:0:0:1:51305]], Status in: [OPEN_READ], State out: [OPEN]
2022-06-10 21:08:53.990 DEBUG 75288 --- [nio-8081-exec-1] org.apache.tomcat.util.net.NioEndpoint   : Registered read interest for [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@49e76d18:org.apache.tomcat.util.net.NioChannel@3a6d0e08:java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1:8081 remote=/0:0:0:0:0:0:0:1:51305]]
2022-06-10 21:08:54.006 DEBUG 75288 --- [nio-8081-exec-3] o.a.coyote.http11.Http11InputBuffer      : Before fill(): parsingHeader: [true], parsingRequestLine: [true], parsingRequestLinePhase: [0], parsingRequestLineStart: [0], byteBuffer.position(): [0], byteBuffer.limit(): [0], end: [920]
2022-06-10 21:08:54.011 DEBUG 75288 --- [nio-8081-exec-3] o.a.tomcat.util.net.SocketWrapperBase    : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@49e76d18:org.apache.tomcat.util.net.NioChannel@3a6d0e08:java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1:8081 remote=/0:0:0:0:0:0:0:1:51305]], Read from buffer: [0]
2022-06-10 21:08:54.018 DEBUG 75288 --- [nio-8081-exec-3] org.apache.tomcat.util.net.NioEndpoint   : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@49e76d18:org.apache.tomcat.util.net.NioChannel@3a6d0e08:java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1:8081 remote=/0:0:0:0:0:0:0:1:51305]], Read direct from socket: [935]
2022-06-10 21:08:54.019 DEBUG 75288 --- [nio-8081-exec-3] o.a.coyote.http11.Http11InputBuffer      : Received [GET /swagger-ui.html HTTP/1.1
Host: localhost:8081
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Sec-Fetch-Site: none
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="102", "Google Chrome";v="102"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "macOS"
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Cookie: _xsrf=2|7ae24c7b|1c43e20182b08315fc49ef578046eb03|1653281851; username-localhost-8888="2|1:0|10:1653456473|23:username-localhost-8888|44:YzM1ZTA5YTUzYTQzNDVlZjhkODUzZjkwZjRiYTBkMzE=|5bd02739555131d2cd77b80629b63f111fae2a623c2f758727c004f291eb729b"

]
2022-06-10 21:08:54.021 DEBUG 75288 --- [nio-8081-exec-3] o.a.t.util.http.Rfc6265CookieProcessor   : Cookies: Parsing b[]: _xsrf=2|7ae24c7b|1c43e20182b08315fc49ef578046eb03|1653281851; username-localhost-8888="2|1:0|10:1653456473|23:username-localhost-8888|44:YzM1ZTA5YTUzYTQzNDVlZjhkODUzZjkwZjRiYTBkMzE=|5bd02739555131d2cd77b80629b63f111fae2a623c2f758727c004f291eb729b"
2022-06-10 21:08:54.023 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.authenticator.AuthenticatorBase    : Security checking request GET /swagger-ui.html
2022-06-10 21:08:54.023 DEBUG 75288 --- [nio-8081-exec-3] org.apache.catalina.realm.RealmBase      :   No applicable constraints defined
2022-06-10 21:08:54.024 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.authenticator.AuthenticatorBase    : Not subject to any constraint
2022-06-10 21:08:54.025 DEBUG 75288 --- [nio-8081-exec-3] org.apache.tomcat.util.http.Parameters   : Set encoding to UTF-8
2022-06-10 21:08:54.025 DEBUG 75288 --- [nio-8081-exec-3] o.s.web.servlet.DispatcherServlet        : GET "/swagger-ui.html", parameters={}
2022-06-10 21:08:54.033 DEBUG 75288 --- [nio-8081-exec-3] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped to ResourceHttpRequestHandler [classpath [META-INF/resources/]]
2022-06-10 21:08:54.037 DEBUG 75288 --- [nio-8081-exec-3] o.s.w.s.r.ResourceHttpRequestHandler     : Resource not found
2022-06-10 21:08:54.038 DEBUG 75288 --- [nio-8081-exec-3] o.s.web.servlet.DispatcherServlet        : Completed 404 NOT_FOUND
2022-06-10 21:08:54.040 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.c.C.[Tomcat].[localhost]           : Processing ErrorPage[errorCode=0, location=/error]
2022-06-10 21:08:54.041 DEBUG 75288 --- [nio-8081-exec-3] o.s.web.servlet.DispatcherServlet        : "ERROR" dispatch for GET "/error", parameters={}
2022-06-10 21:08:54.043 DEBUG 75288 --- [nio-8081-exec-3] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#errorHtml(HttpServletRequest, HttpServletResponse)
2022-06-10 21:08:54.051 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.loader.WebappClassLoaderBase       : getResource(META-INF/resources/error/404.html)
2022-06-10 21:08:54.052 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.loader.WebappClassLoaderBase       :   Delegating to parent classloader jdk.internal.loader.ClassLoaders$AppClassLoader@5c29bfd
2022-06-10 21:08:54.055 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.loader.WebappClassLoaderBase       :   --> Resource not found, returning null
2022-06-10 21:08:54.055 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.loader.WebappClassLoaderBase       : getResource(resources/error/404.html)
2022-06-10 21:08:54.055 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.loader.WebappClassLoaderBase       :   Delegating to parent classloader jdk.internal.loader.ClassLoaders$AppClassLoader@5c29bfd
2022-06-10 21:08:54.057 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.loader.WebappClassLoaderBase       :   --> Resource not found, returning null
2022-06-10 21:08:54.057 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.loader.WebappClassLoaderBase       : getResource(static/error/404.html)
2022-06-10 21:08:54.059 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.loader.WebappClassLoaderBase       :   Delegating to parent classloader jdk.internal.loader.ClassLoaders$AppClassLoader@5c29bfd
2022-06-10 21:08:54.060 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.loader.WebappClassLoaderBase       :   --> Resource not found, returning null
2022-06-10 21:08:54.060 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.loader.WebappClassLoaderBase       : getResource(public/error/404.html)
2022-06-10 21:08:54.060 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.loader.WebappClassLoaderBase       :   Delegating to parent classloader jdk.internal.loader.ClassLoaders$AppClassLoader@5c29bfd
2022-06-10 21:08:54.061 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.loader.WebappClassLoaderBase       :   --> Resource not found, returning null
2022-06-10 21:08:54.062 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.loader.WebappClassLoaderBase       : getResource(META-INF/resources/error/4xx.html)
2022-06-10 21:08:54.062 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.loader.WebappClassLoaderBase       :   Delegating to parent classloader jdk.internal.loader.ClassLoaders$AppClassLoader@5c29bfd
2022-06-10 21:08:54.063 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.loader.WebappClassLoaderBase       :   --> Resource not found, returning null
2022-06-10 21:08:54.063 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.loader.WebappClassLoaderBase       : getResource(resources/error/4xx.html)
2022-06-10 21:08:54.064 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.loader.WebappClassLoaderBase       :   Delegating to parent classloader jdk.internal.loader.ClassLoaders$AppClassLoader@5c29bfd
2022-06-10 21:08:54.067 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.loader.WebappClassLoaderBase       :   --> Resource not found, returning null
2022-06-10 21:08:54.070 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.loader.WebappClassLoaderBase       : getResource(static/error/4xx.html)
2022-06-10 21:08:54.070 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.loader.WebappClassLoaderBase       :   Delegating to parent classloader jdk.internal.loader.ClassLoaders$AppClassLoader@5c29bfd
2022-06-10 21:08:54.071 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.loader.WebappClassLoaderBase       :   --> Resource not found, returning null
2022-06-10 21:08:54.072 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.loader.WebappClassLoaderBase       : getResource(public/error/4xx.html)
2022-06-10 21:08:54.072 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.loader.WebappClassLoaderBase       :   Delegating to parent classloader jdk.internal.loader.ClassLoaders$AppClassLoader@5c29bfd
2022-06-10 21:08:54.073 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.loader.WebappClassLoaderBase       :   --> Resource not found, returning null
2022-06-10 21:08:54.074 DEBUG 75288 --- [nio-8081-exec-3] o.s.web.servlet.DispatcherServlet        : Exiting from "ERROR" dispatch, status 404
2022-06-10 21:08:54.075 DEBUG 75288 --- [nio-8081-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet]    :  Disabling the response for further output
2022-06-10 21:08:54.076 DEBUG 75288 --- [nio-8081-exec-3] o.a.coyote.http11.Http11InputBuffer      : Before fill(): parsingHeader: [true], parsingRequestLine: [true], parsingRequestLinePhase: [0], parsingRequestLineStart: [0], byteBuffer.position(): [0], byteBuffer.limit(): [0], end: [935]
2022-06-10 21:08:54.076 DEBUG 75288 --- [nio-8081-exec-3] o.a.tomcat.util.net.SocketWrapperBase    : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@49e76d18:org.apache.tomcat.util.net.NioChannel@3a6d0e08:java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1:8081 remote=/0:0:0:0:0:0:0:1:51305]], Read from buffer: [0]
2022-06-10 21:08:54.076 DEBUG 75288 --- [nio-8081-exec-3] org.apache.tomcat.util.net.NioEndpoint   : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@49e76d18:org.apache.tomcat.util.net.NioChannel@3a6d0e08:java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1:8081 remote=/0:0:0:0:0:0:0:1:51305]], Read direct from socket: [0]
2022-06-10 21:08:54.077 DEBUG 75288 --- [nio-8081-exec-3] o.a.coyote.http11.Http11InputBuffer      : Received []
2022-06-10 21:08:54.077 DEBUG 75288 --- [nio-8081-exec-3] o.apache.coyote.http11.Http11Processor   : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@49e76d18:org.apache.tomcat.util.net.NioChannel@3a6d0e08:java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1:8081 remote=/0:0:0:0:0:0:0:1:51305]], Status in: [OPEN_READ], State out: [OPEN]
2022-06-10 21:08:54.080 DEBUG 75288 --- [nio-8081-exec-3] org.apache.tomcat.util.net.NioEndpoint   : Registered read interest for [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@49e76d18:org.apache.tomcat.util.net.NioChannel@3a6d0e08:java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1:8081 remote=/0:0:0:0:0:0:0:1:51305]]
2022-06-10 21:09:21.840 DEBUG 75288 --- [alina-utility-2] org.apache.catalina.session.ManagerBase  : Start expire sessions StandardManager at 1654888161830 sessioncount 0
2022-06-10 21:09:21.840 DEBUG 75288 --- [alina-utility-2] org.apache.catalina.session.ManagerBase  : End expire sessions StandardManager processingTime 10 expired sessions: 0

Thanks

@al-niessner
Copy link
Contributor Author

al-niessner commented Jun 10, 2022

@tloubrieu-jpl

Yes. It is the upgrade to latest spring that did this. Not sure how to fix but needs another ticket as it is not related to this work. Although it might be some weird resource that I am not aware of that needs updating because of name changes in this work. However when googled, it seems to be known and related to latest version of spring.

See #141

@tloubrieu-jpl
Copy link
Member

Thanks @al-niessner for creating the ticket

@tloubrieu-jpl
Copy link
Member

tloubrieu-jpl commented Jun 10, 2022

Hi @al-niessner ,

Weirdly, I am having this error again that we were not able to reproduce in ticket #133

The request:

curl --location --request GET 'http://localhost:8081/uid/urn:nasa:pds:insight_rad:data_derived:hp3_rad_der_00014_20181211_073042::1.0/referencing/bundle' \
--header 'Accept: application/json'

Returns again:
{"summary":{"q":"","hits":0,"took":16,"start":0,"limit":100,"sort":[],"properties":[]},"data":[]}%

The same thing happen with this request:

curl --location --request GET 'http://localhost:8081/uid/urn:nasa:pds:insight_rad:data_derived::7.0/referencing/bundle' \
--header 'Accept: application/json'

@al-niessner
Copy link
Contributor Author

@tloubrieu-jpl

My Python unit tests stay that those do work in the new code. Does not verify it is the right lidvid but verifies that it 1 returned and that an actual lidvid comes with it.

Being that you thought release 1.0.1 had same problem I am going to say it is your test harness and/or database. Are you testing by hand or are you using postman?

Strange JUnit thing where org.junit.Test does not work but org.junit.jupiter.Test does. Seems the antlr unit tests are back on line.

Tried updating to todays latest spring to see if that fixes the root white label error problem.
model/pom.xml Show resolved Hide resolved
It is swagger 2 that change the help. It is now /swagger-ui/index.html. All references have been updated.
model/pom.xml Show resolved Hide resolved
@al-niessner al-niessner mentioned this pull request Jun 11, 2022
Copy link
Member

@tloubrieu-jpl tloubrieu-jpl left a comment

Choose a reason for hiding this comment

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

Thanks @al-niessner I successfully tested all the tickets embedded in this pull request.

I only removed #128 which does not sound like it is part of the PR (it is closed anyway).

I created 2 minor tickets:
#150 which is alike #133, hopefully you will be able to reproduce this time. I need you to help me to understand why I am having this behavior.
#149 a minor ticket on the newly repaired swagger-ui

Thanks again, you can merge this PR

Thomas

@al-niessner al-niessner merged commit 44602e9 into main Jun 13, 2022
@al-niessner al-niessner deleted the issue_131 branch June 13, 2022 19:17
@al-niessner al-niessner restored the issue_131 branch June 13, 2022 19:17
al-niessner added a commit that referenced this pull request Aug 16, 2022
* Issue 131: increase adaptability (#142)

* endpoints

Had to change the planned endpoints to /gid/{group name} to /pid/{lidvid}. Also had to add /gid and /pid as prefixes for the referencing endpoints as well. The point really is that had to add the prefixes is because swagger cannot tell /{group name} from /{lidvid} even though the group names are a well defined enum. The prefixes allow swagger to identify the endpoints as unique. While the actual characters gid and pid are not required, whatever is chosen must be unique and different.

* reshape the architecture/design

The base architecture is MVC, but the code does not directly represent it. Moved business to model and serializer to view to match the architecture. Reduced the multiple controllers to one and use a facade/plug-n-play pattern (ReferencingLogic) to manage the polymorphism needed  for each of the ancestral paths to find information.

Added a Java enum to do the mapping among the group names and the product class in the data itself. The enum holds the ReferencingLogic allowing either side (controller or model) to work with the given inputs and collect the desired output.

Most of the code in the DAO objects moved to ReferencingLogic implementations. These objects understand the relationship between model elements and internalize the relationship as code. An example is for bundles finding their grandchildren.

* CONTRIBUTING.md updated

Once the refactoring was complete, updated the documentation to reflect the new code naming and its relationship to the architecture/design.

* docker update by Jimmie Young <[email protected]>

* Add a Dockerfile for building images for AWS deployments (#151)

* Creation of AWS-specific Dockerfile, update README to indicate its purpose

* Fix typo in both Dockerfiles (extraneous ']' in CMD)

* Anonymous changes from main stomp

* Switch back to 8080 by default (#157)

* fix for 141 (#147) (#156)

* changed string searching (#158) by  Al Niessner <[email protected]>

Seems that wildcards is not well implemented in the later elasticsearch and opensearch implementations. The most recent documentation for either has changed significantly that if searhing for strings, then they offer a short globish like set of patterns. Moved from using wildcards to this new string and it seems to be working.

The eq operator had some problems because it was using should instead of filter for the or condition. SHould returns everything with a score value to represent the closes match from the furthest. Changed over to filter and the or condition is now behaving as expected.

* Anonymous changes from main stomp

* fixes for issue 162

* fixes for issue 162

* fix for issue 149
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.

3 participants