-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
newrelic_deployment: updated code to use v2 api #1501
newrelic_deployment: updated code to use v2 api #1501
Conversation
@felixfontein , can you review this PR? |
are defined") | ||
|
||
if module.params['app_name']: | ||
data = 'filter[name]=' + str(module.params['app_name']) |
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.
Please use a proper encoding function for forms. Since you are using fetch_url
, you can simply pass a dictionary and it will take care of encoding automatically (see https://github.com/ansible-collections/community.hrobot/blob/main/plugins/module_utils/failover.py#L64).
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.
Now, I don't have access to NewRelic so I can't test it.
is this a mandatory change?
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.
You need to fix a proper method which will encode values correctly. Simple string concatenation is a disaster waiting to happen (in the worst case, a security vulnerability).
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 can't modify something which I can't test, module created back in 2018 and was tested and still in use as per my knowledge.
If you say, without modify this it can't be merged than so let it be. I will modify in couple of years once I got access to NewRelic again.
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.
That's unfortunate. In case you don't change this to use urlencode
or simply provide a dict, I will not merge this. Sorry.
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.
if this was so important change, Others/You as Reviewer should have pointed out in my first PR & second PR which was there from 2018 but None.
Now you want this to changed. Hell No!
I will not change any working piece of code which can break the new module implementation. As I don't have access to newrelic to test your enforced changes which means deadend.
Have Fun!
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 a very trivial change to make, which does not affect the whole module. So I see absolutely no need to point out such problems as early as possible in the review process. And if you don't want to make any changes to the code's behavior, well, then I don't see why a review makes sense anyway.
I've now spend quite some time reviewing your code and changes in my free time. If you are not interested in getting this included, then I guess I totally wasted that time.
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.
what about my time man? do you understand the level of patience from my side ( 2 years ) ?
it's not about trivial change, it's about basic testing, if I can't confirm as maintainer that it will work or not with urlencode/dict then I how i can even make a change, I don't understand that part.
If you have access to NewRelic please make the test with urlencode/dict and suggest the actual code change, I happy to update the code.
Just for your knowledge, half of module will stop working if this data is passed in wrong format as the search api will return none and anyone using app_name
as parameter will never work until someone fix it in future.
let's assume your case where it cause some security Issue then it will on NewRelic Side why you/ansible need to worry. NewRelic should not prevent/fix this in there API as a validation and later Ansible Community should fix as part of bugfix process.
Now when I don't have testing resources/credentials, On what base you will merge it even if I change it?
This comment has been minimized.
This comment has been minimized.
are defined") | ||
|
||
if module.params['app_name']: | ||
data = 'filter[name]=' + str(module.params['app_name']) |
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.
You need to fix a proper method which will encode values correctly. Simple string concatenation is a disaster waiting to happen (in the worst case, a security vulnerability).
Co-authored-by: Felix Fontein <felix@fontein.de>
@116davinder this PR contains the following merge commits: Please rebase your branch to remove these commits. |
@116davinder this PR contains the following merge commits: Please rebase your branch to remove these commits. |
Do not use merge commits to rebase, use this document to add this repository as upstream of your repository. You can then use this commands to rebase your branch: |
As the Ansible community reviewer is forcing me to add a code that I can't test and verify. I am closing this PR as it doesn't make any sense to keep it open as nothing will happen in future as nothing happened on my original PR ansible/ansible#40029 which was open for 2+ years, It is just a waste of my time and reviewer time. Last Notes |
SUMMARY
Added support for NewRelic Deployment V2 Api
ISSUE TYPE
Feature Pull Request
COMPONENT NAME
newrelic_deployment
ADDITIONAL INFORMATION
After checking NewRelic Website, as they have depricated v1 api with xml format and they also exposed new v2 api with json/xml so i start this PR to support new v2 api and remove old version.
Original PR on Main Ansible Repoistory: ansible/ansible#40029 [ closed ]
Old PR: #876 [ closed ]
If this PR doesn't get merged than anyone can download same code from my personal repository: https://github.com/116davinder/ansible.missing_collection