-
Notifications
You must be signed in to change notification settings - Fork 2.9k
NIFI-5022 InvokeAWSGatewayApi processor #2588
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
Conversation
Notes:
|
@MikeThomsen @pvillard31 @mattyb149 @mans2singh Anyone up for a code review? |
8ec58d4
to
f7bed64
Compare
If you can do this you can test with the pet store sample |
Hey @ottobackwards - I'd love to have a look but I won't have cycles to do a proper review and testing before end of next week at best. |
451949c
to
3cbdab7
Compare
@zenfenan any chance for a review? |
@ottobackwards I would really love to do it but I'm occupied until next week. If no one takes a look by that time, I'll definitely do that. |
It would be better if we would just use RPGreen's maven dep instead off bringing in the classes. I have a pr against his repo to upgrade to the same aws package we use. When that is taken and a release is cut, I'll move over to that. I think we should still review however, in the event that he doesn't take that pr and we have to keep the code. |
Sounds good to me, especially if that project is active, I'd like to keep our dependencies as modules rather than code if possible. |
15b856d
to
9cd1798
Compare
@mattyb149 no word on that pr. @jvwing any chance you may be able to review? |
bump, any takers? |
480f393
to
cb07b4c
Compare
I can provide the reviewers with access to my PETSTORE endpoint for testing and we can work out how not to overload it, if that helps get this going |
*/ | ||
package org.apache.nifi.processors.aws.wag.client; | ||
|
||
import com.amazonaws.util.StringUtils; |
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.
Just wondering if you meant this StringUtils
. I do this a lot when I really want StringUtils
from commons lang.
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 is part of the code from an external library, and I believe this is intentional.
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.
Ok, thanks!
headers = new HashMap<>(); | ||
} | ||
if (apiKey != null) { | ||
final Map<String, String> headersWithApiKey = new HashMap<>(); |
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 it possible to just add the API key to headers
without making a new map and then always return headers;
?
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.
done
@ottobackwards Haven't tested it but code-wise it makes sense. |
@ottobackwards I would be fine merging this in without running additional testing like you've already done. What we cannot have though are the ASF headers on source code we copied from elsewhere. You did a great job of adding it to the NOTICE files but we cannot add the ASF header. Also, why can't we just use the library as it exists as a binary dependency? Are there some critical changes or something? |
@joewitt As for taking the library vs. including the code. I took that code because I was not sure if the library would be updated quickly enough if there where changes in the AWS library versions in nifi or other changes required ( such as my need to add support for query parameters ). Also, there is not a lot of code to work with. @mattyb149 and I talked it out and I have done a pr to the project for a version bump that would allow us to use the library, but there has been no response to that pr since May 3rd when I posted it ( as I had feared at the start ). Currently I think the options are ( in no order )
Obviously I would prefer not to shelve this. Should I remove the headers? |
Do I need to add ratcheck exceptions if I remove the headers? |
@ottobackwards this describes how to handle code contributed to the ASF This describes how to handle code not contributed to but rather pulled into ASF projects (third party works): So yes please remove the header from all files which are sourced externally. If you were simply pulling in a code snippet/etc.. then it would be ok to just cite it like you did and have the header but this case is pretty simple. Anyway, easy fix, just remove header and yes add RAT exclusions for each and put a comment explaining in case someone flags it later. Your comments about them not doing a release with the PR you did are fine. It is ok to pull source in this case just obviously preferable to avoid it where possible. So all good. The other rub here is the author doesn't tag releases which helps us in terms of provenance. Can you please reference a specific commit in the git repo you're pulling from in the notice entry. Not strictly necessary but safer in terms of 'it was ALv2 licensed when i pulled this'. I'll try to look again when that is done |
Thanks @joewitt for clearing that up. I'll get right to it. |
- removed apache headers from 3rd party files per https://www.apache.org/legal/src-headers.html#3party - referenced commit/repo in notice file - created rat configuration to account for files without headers
@joewitt requested changes are in |
full clean build w/contrib check passes. My review was more legal/structural than functional. If there are functional improvements needed we can do them over time as this is safely isolated from impacting other items. So +1 merging to master. |
Thanks everybody! |
This processor's intention is to provide the same interface as InvokeHttp for AWS Gateway Web Api hosted endpoints.
To that end, all of the applicable InvokeHttp tests have been refactored for this processor as well.
Testing will require a hosted api ( Amazon does not have a 'local' version ).
Creating a sample api can be used to stand up an api.
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
Has your PR been rebased against the latest commit within the target branch (typically master)?
Is your initial contribution a single, squashed commit?
For code changes:
For documentation related changes:
Note:
Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.