Skip to content
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 new google_chat module #48919

Merged
merged 1 commit into from Aug 6, 2018
Merged

Conversation

luke-orden
Copy link
Contributor

@luke-orden luke-orden commented Aug 3, 2018

What does this PR do?

Add a new google_chat module which allows you to send a message to a google chat room.

What issues does this PR fix or reference?

N/A

New Behavior

Send a message to a google chat room

Tests written?

Yes

Commits signed with GPG?

Yes

Copy link
Contributor

@cachedout cachedout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent! Before we merge this, would you mind adding information about this new feature to the release notes?

Copy link
Contributor

@gtmanfred gtmanfred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one nitpick change.

Otherwise this looks good.

'''
headers = {'Content-Type': 'application/json'}
data = {'text': message}
result = salt.utils.http.query(url,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of importing salt.utils.http, please use __utils__['http.query']()

https://developers.google.com/hangouts/chat/how-tos/webhooks
'''
# Import Python Libs
from __future__ import absolute_import
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add print_function and unicode_literals to this __future__ import? We need that for PY2/PY3 compatibility. :)

Copy link
Contributor

@garethgreenaway garethgreenaway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! 😁

@rallytime
Copy link
Contributor

@loverend If you could add this to the Fluorine release notes we can get this in pending tests. :)

Thanks for this addition!

@luke-orden luke-orden force-pushed the add_google_chat branch 2 times, most recently from 873e105 to fe615d8 Compare August 3, 2018 16:28
@luke-orden
Copy link
Contributor Author

Added to release notes. There wasn't a new modules section like in previous release notes, so added this.

@rallytime
Copy link
Contributor

@loverend Some of your new tests are having some trouble here. Can you take a look?

https://jenkinsci.saltstack.com/job/pr-kitchen-ubuntu1604-py2/job/PR-48919/5/

@luke-orden luke-orden force-pushed the add_google_chat branch 4 times, most recently from 9904e4c to ae0b5a3 Compare August 6, 2018 10:25
To send a message directly to google chat via the api (not via a bot)
you need to configure a webhook and post directly to that webhook url.
@luke-orden
Copy link
Contributor Author

All tests now pass. I have addressed all comments. Please let me know if there are any further changes required.

@rallytime rallytime added the ZRELEASED - Fluorine reitred label label Aug 6, 2018
Copy link
Contributor

@gtmanfred gtmanfred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! thanks for this! looks great.

@rallytime rallytime merged commit d97178c into saltstack:develop Aug 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants