-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Avoid override of routes() in BaseRestHandler to respect the default behavior defined in RestHandler #889
Avoid override of routes() in BaseRestHandler to respect the default behavior defined in RestHandler #889
Conversation
✅ Gradle Wrapper Validation success f719e69883e71682fa7d1150c1f5c98c1299d11f |
❌ DCO Check Failed f719e69883e71682fa7d1150c1f5c98c1299d11f |
✅ Gradle Precommit success f719e69883e71682fa7d1150c1f5c98c1299d11f |
@cliu123 Can you add more information to this PR? Thanks... |
Sure. This can be post-GA. I'll add more info later. |
✅ Gradle Wrapper Validation success f719e69883e71682fa7d1150c1f5c98c1299d11f |
❌ DCO Check Failed f719e69883e71682fa7d1150c1f5c98c1299d11f |
✅ Gradle Precommit success f719e69883e71682fa7d1150c1f5c98c1299d11f |
f719e69
to
9af8727
Compare
✅ Gradle Wrapper Validation success 9af872758921add7c07210112a6a89d114daf623 |
✅ DCO Check Passed 9af872758921add7c07210112a6a89d114daf623 |
✅ Gradle Precommit success 9af872758921add7c07210112a6a89d114daf623 |
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.
Assuming routes
becomes private
, how does one add a route?
How will existing implementers of BaseRestHandler
need to be changed? I imagine many define routes
in their own implementations?
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.
Can we add more details on what this PR intends to solve
@Bukhtawar The issue #694 describes what this PR intends to solve. |
They can remove the implementation of the abstract method
That is what happens, for example. |
From what I understand, we need to also ensure one of routes() or replacedRoutes() are implemented so that an implementer cannot get away without specifying any? |
@Bukhtawar Agree. The intention of this PR is not to force implementers to implement the abstract method |
Why is it necessary to overwrite the default |
IMO, It is actually unnecessary.
Is our goal that the subclasses of
For this purpose, removing the |
Is there a harm returning an empty list and let the contract stay |
I do not think there is a harm returning an empty list, but looks like |
@cliu123 The reason |
✅ DCO Check Passed dc0b1dd |
Signed-off-by: cliu123 <lc12251109@gmail.com>
✅ DCO Check Passed 15bf7ae |
✅ Gradle Wrapper Validation success 15bf7ae |
✅ Gradle Precommit success 15bf7ae |
LGTM except for PR title |
@vrozov Changed the PR title |
@dblock @Bukhtawar How do the changes look to you? |
Now that the unnecessary implementations have been removed in tests, this makes a lot more sense! Good with me. You should still update the description in the PR for anyone reading this for the first time. |
start gradle check |
@dblock Done. |
Looks like I missed the whole party of conversation. |
@dblock are we waiting for anything else to merge this ? |
Merged, thanks @cliu123! |
@dblock @saratvemulapalli Are we going to backport this to 1.0 or 1.x(for 1.1.0) branches? |
Since this is not a security fix it definitely doesn't go to 1.0, but I don't see why we wouldn't backport to 1.1. Feel free to make that PR @cliu123 if you need it. |
…behavior defined in RestHandler (opensearch-project#889) Signed-off-by: cliu123 <lc12251109@gmail.com>
Description
Remove override for
routes()
inBaseRestHandler
to respect default behavior of routes() defined inRestHandler
.This will help developers avoid re-implementing
routes()
in the subclasses ofBaseRestHandler
They can always override the method if they'd like.
Issues Resolved
#694
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.