-
Notifications
You must be signed in to change notification settings - Fork 5
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
Miscellaneous internal changes #256
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I like the simplification of the code, but I would like to make sure the behavior is still what we expect/want.
Thanks Alex
@@ -1149,8 +1149,6 @@ components: | |||
syntax: limit=10 | |||
|
|||
behavior: maximum number of matching results returned, for pagination | |||
|
|||
note: limit=0 returns just the summary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll keep that note, although data is still returned with length 0, I would like that we made obvious to the users that limit=0 is the way to get the summary only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that useful information to provide to the user? "If you request zero data you'll get zero data" seems pointless, and specifying that you'll get just the summary (which is actually the search metadata) seems to indicate that something nonstandard occurs. Your call, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexdunnjpl we wanted a way for the user to get the metadata for a set of results, beyond the pagination limits, without requesting them all. That is useful for a user who would like to know the set of properties which can be requested in this products.
The use case is:
- user want to explore the product's of a collection (e.g. 100000s products)
- the user needs to know which properties are used to describe these products
- the user can apply search criteria on some of the available properties to subset the collection of products (these properties cannot be guessed by the user)
That is for step 2 that we initially defined the summaryOnly
keyword, and then we decided to remove this keyword to use limit=0 instead. That being said it sounds like the summary does not provide the description for the full request results beyond pagination limits but only for the current page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tloubrieu-jpl if I understand you correctly, it sounds like limit=0
is supposed to behave in a different/non-standard manner, then? Specifically, to provide the union of the set of properties present in each product for the given query? (That's a non-homogeneous collection of property sets, yeah? Otherwise the user could just get it with limit=1
and extract the property set themselves)
It currently doesn't, iirc, so sounds like there's a need to make some kind of fix if that's necessary, but that almost seems like a job for a subroute like products/properties?{someQuery}
rather than serving it implicitly in the case of products?{someQuery}&limit=0
? This also seems like a potentially-expensive operation in the case of large query results, not that there's any getting around that if it's needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexdunnjpl I was unclear, I am not looking for a non standard management of limit=0. I believe what is rather needed to be updated is the way the summary is prepared. For the use case I described above, the summary need to be made from the products matching the query (q, keyword) but ignoring the pagination parameters (start, limit). I will make a more detailed ticket for that, because all the summary properties are not equivalent.
} | ||
|
||
this.limit = limit; | ||
this.returnSingularDatum = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somehow the property name is not meaningful to me. A bit too abstract maybe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This replaces isSingular
(dragged down from RequestAndResponseContext
). The meaning is "this URIParameters
is being used for an API route which returns a single element (ex. /bundles/{identifier}
) rather than a collection of elements (ex. /bundles/{identifier}/products
)".
Open to suggestions on this as you're right - it's not great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexdunnjpl , What about something like expectSingularResponse
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's slightly better, but I'm starting to feel like if it's worth worrying about, it's worth doing properly (see the last bit of the comment in the next thread), so unless you have an objection I think that I should
- make it an enum type instead of a boolean
- put an explanatory comment in the enum type so that anyone who wonders/cares what exactly it refers to can jump to the explanation with a minimum of effort
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, how about singletonResultExpected
?
Communicates that the expected singularness applies to the result (of the query), and I think that "singleton" makes the connection a little clearer because it either means "a unique instance" or "a set with cardinality 1", both of which are correct in this context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tloubrieu-jpl tentatively resolved by 90c4fb9 (if you agree with the new naming)
service/src/main/java/gov/nasa/pds/api/registry/model/Pds4ProductBusinessObject.java
Show resolved
Hide resolved
service/src/main/java/gov/nasa/pds/api/registry/model/RequestAndResponseContext.java
Outdated
Show resolved
Hide resolved
0d41106
to
c0fa24b
Compare
…etLimit() methods and code simplifications
c0fa24b
to
07e6c30
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed the conflict (that I introduced through an update on main branch).
I ran the integration test and I don't see an impact, before merging that would be good to have a review from @al-niessner.
@al-niessner could you review this PR ? Thanks |
@al-niessner @tloubrieu-jpl still a couple of outstanding convos (above) before finalization, FYI |
presence of emoji breaks branch integration testing
Squash when merging, with following commit message (we've lost the commit history, but at least we can retain the granular messages):
|
🗒️ Summary
Preliminary work undertaken as part of #252 which does not actually resolve it (since it has been deprioritized but the work is still useful).
IllegalArgumentException
to invalidstart
andlimit
setter calls⚙️ Test Data and/or Report
One of the following should be included here:
See Github Actions tests
♻️ Related Issues
Fixes #255
Related to #252