-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add support for Elasticsearch 7.x #19
base: master
Are you sure you want to change the base?
Add support for Elasticsearch 7.x #19
Conversation
The CI passes on Python 2.7 but on Python 3.6 the failure looks unrelated:
|
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.
First off, thank you VERY much for these updates!
Along with the comments below, please:
- Add a CHANGELOG entry.
- Bump the version by 0.x to represent new features.
- Make sure builds are passing.
Thanks again for the support here, let me know if i can be of any help.
@@ -40,7 +40,23 @@ def poll(self): | |||
data = self.es.search(index=self.index, body=query_payload) | |||
|
|||
hits = data.get('hits', None) | |||
if hits.get('total', 0) > self.count_threshold: | |||
if hits is None: |
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.
Would be great to see some unit tests for these new conditions.
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.
@nmaludy I was unable to find any tests apart from the bash scripts in /test
. I tried to use Docker Compose but I believe that is broken because there is no st2
image on DockerHub. From the CI output, it doesn't look like that script is being run. Where and how should I add tests?
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.
@AbhyudayaSharma Unit tests go in the tests/
folder. These use the standard python unittest2
framework. Some examples can be seen in the vSphere pack here: https://github.com/StackStorm-Exchange/stackstorm-vsphere/blob/master/tests/test_action_affinity_rule_create.py
The build failures on Python 3.6 is not looking at all related to this PR. Can you point me in the right direction? |
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.
@AbhyudayaSharma we've fixed the upstream build issue.
Only requested change now is to please bump the pack version to 1.2.0
here: https://github.com/StackStorm-Exchange/stackstorm-elasticsearch/blob/master/pack.yaml#L9
@nmaludy Done! I would also suggest using https://github.com/release-drafter/release-drafter which can automatically changelog entries from pull requests. |
@nmaludy do I need to change anything else? |
@AbhyudayaSharma Still looking for unit tests here, if you wouldn't mind? |
Okay. Will try to add some tests tomorrow. |
@AbhyudayaSharma any luck on the unit tests? |
@nmaludy Sorry. My internship got over and I no longer have access to the StackStorm and Elasticsearch instances that I was using. I'm really busy with university stuff right now but will try to set everything up and add the tests when I get some time. |
|
Hi! We are using Elasticsearch 7.4.0 with which this pack is not compatible. This PR handles some of the breaking changes introduced in 7.0 and makes it compatible with 7.x. I've tested the changes in this PR with our local Elasticsearch instance and it works just fine.