-
Notifications
You must be signed in to change notification settings - Fork 638
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
Updated Logic and Tests for Slack SDK v3 support #309
Merged
Merged
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
744359d
updated logic and tests to support v3 of node-slack-sdk
e5dd2f8
clean up unused functions
c244c3d
reverted clean up of unused functions
cd61c60
added some coveralls tests and ignores
62062c7
No function getBody()
710454c
Repair the missing getBody method, not updated in testing
7441fad
This should handle a number of the errors we've seen
d5b5cd7
corrected package.json
2a66fb4
fixed channel test
7679d26
Initial attempt at fixing #114 to correct formatting urls
900402e
an attempt at rewriting to have better support for complex messages a…
93d01dc
adjusted method names
0224285
adjusted method names
09514bf
Merge pull request #314 from slackhq/hubot-v4-proto
9153bf5
Fix errors handling message with un-handled subtypes that may or may …
4e078ac
Getting at least some of the tests to pass. This is terrible.
aef4233
Tests are running...and passing!
12bcff4
Look at that, so many green lights.
705ffd2
All original passing tests are now in and passing.
ad68cdd
Fixing Silliness
3bfdc18
Don't need that! Doesn't work in the stub anyway.
341e54d
This is an experiment
8a8d19d
Make this node 0.10 compatible
09d4dd6
Merge pull request #315 from slackhq/v3-sdk-updates-writing-tests
306142b
More tests on SlackFormatter, and a bug fix!
d3e7f53
Clean up beforeEach triggers
48de700
Adding tests for client
gtr32x 881b5a9
Filling in the remainder of the tests for client
gtr32x 2aab972
Updating package.json to reflect future reality
d93be77
added robot logger coverage
3e6ae9e
Making the tests a little more specific.
43d3c65
Tests around replying...and found a bug
179b424
Small victories
7249c89
Adding tests on receiving messages
e85b67d
One more test, commiting to set it aside.
1def6e8
Fix that broken test.
25a4b6c
Message handling tests
b5683c3
Fixing some errors, writing some tests
4f3f430
There is no bot_message anymore
8a21aa3
CHeck error event handling
e2fbdd6
Merge pull request #321 from slackhq/v3-coverage
4639968
Updating the docs
2d3160e
Minor tweaks to README
e71cf7c
Merge pull request #322 from slackhq/v3-docs
e375beb
Because Hubot adapters have very strict naming restrictions
09ba54d
Merge branch 'master' into v3-sdk-updates
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
node_modules/ | ||
.idea | ||
coverage/ | ||
npm-debug.log | ||
*.log | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# [slack-hubot] Changelog | ||
|
||
### v4.0.0 (2016-06-15) | ||
|
||
* Now uses the latest version of `node-slack-sdk` (v3.4.1 as of this writing), inheriting all the improvements therein. | ||
* Better (and automatically enabled) reconnect logic. As in, it actually reconnects automatically at all. | ||
* Now you can upload files! | ||
* Significantly improved handling of messages with attachments, which is to say, we can deliver them. | ||
* Message formatting of links, usernames and channel names is now working far better than it ever did, which is damning with faint praise, but hey. | ||
* Long messages are now left for Slack to handle, bless their hearts. | ||
* Slack usernames with `.` and `-` are now treated with the respect and dignity due to all usernames. | ||
* Messages from bots are no longer filtered out, which is both cool and potentially terrifying, but we should never have silenced the robots in the first place. | ||
* Remember how if you tried to hack on this adapter and used `npm link` to plug that into a live bot? And how that didn't work? Yeah? Well now it does. Stupid `instanceof`. | ||
* Total refactoring of the functionality, exposing a slightly different interface. So watch out for that. | ||
* You can now access the underlying Slack client directly, for when you really need low-level functionality therein. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Slack open source code of conduct | ||
|
||
|
||
## Introduction | ||
Diversity and inclusion make our community strong. We encourage participation from the most varied and diverse backgrounds possible and want to be very clear about where we stand. | ||
|
||
Our goal is to maintain a safe, helpful and friendly community for everyone, regardless of experience, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, nationality, or other defining characteristic. | ||
|
||
This code and related procedures also apply to unacceptable behavior occurring outside the scope of community activities, in all community venues (online and in-person) as well as in all one-on-one communications, and anywhere such behavior has the potential to adversely affect the safety and well-being of community members. | ||
|
||
## Expected Behavior | ||
* Be welcoming. | ||
* Be kind. | ||
* Look out for each other. | ||
|
||
## Unacceptable Behavior | ||
* Conduct or speech which might be considered sexist, racist, homophobic, transphobic, ableist or otherwise discriminatory or offensive in nature. | ||
* Unwelcome, suggestive, derogatory or inappropriate nicknames or terms. | ||
* Disrespect towards others. (Jokes, innuendo, dismissive attitudes.) | ||
* Intimidation or harassment (online or in-person). Please read the [Citizen Code of Conduct](http://citizencodeofconduct.org/) for how we interpret harassment. | ||
* Disrespect towards differences of opinion. | ||
* Inappropriate attention or contact. Be aware of how your actions affect others. If it makes someone uncomfortable, stop. | ||
* Not understanding the differences between constructive criticism and disparagement. | ||
* Sustained disruptions. | ||
* Violence, threats of violence or violent language. | ||
|
||
## Enforcement | ||
Understand that speech and actions have consequences, and unacceptable behavior will not be tolerated. | ||
|
||
If you are the subject of, or witness to any violations of this Code of Conduct, please contact us by submitting a form [here](https://docs.google.com/a/slack-corp.com/forms/d/1NVqj2S2Q49XVIOT5N3L6Tx1oihvk9CpMa_UX8T_6ESo/viewform), or email conduct@slack.com. | ||
|
||
If violations occur, organizers will take any action they deem appropriate for the infraction, up to and including expulsion. | ||
|
||
_Thanks to the [Django Code of Conduct](https://www.djangoproject.com/conduct/), [The Citizen Code of Conduct](http://citizencodeofconduct.org/), [The Rust Code of Conduct](https://www.rust-lang.org/conduct.html) and [The Ada Initiative](http://adainitiative.org/2014/02/18/howto-design-a-code-of-conduct-for-your-community/)._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Contributing at Slack | ||
|
||
![Header Image](contributing_header_slack.png) | ||
|
||
## Before Contributing | ||
|
||
Before contributing, please read our [Code of Conduct](./CODE_OF_CONDUCT.md). We take it very seriously, and expect that you will as well. | ||
|
||
## New Issues | ||
|
||
Before opening a new issue, please consider: | ||
|
||
- Reading [the documentation](./README.md) and [the changelog](./README.md) first. | ||
- Searching for any related issues and avoid creating duplicated issues. | ||
- Adding details, diagnoses, screenshots or any type of useful information in existing issues, even if they are marked as closed. The team will still review it. | ||
- Taking the time to think of a solution and [**open a pull request**](#new-pull-requests) for either improving the documentation, fixing a bug or suggesting a feature. | ||
- Finally, **[open an issue]**(https://github.com/slackhq/hubot-slack/issues/new) to report a bug, ask for help or suggest a feature. The more information you give, the better people can help you. | ||
|
||
|
||
## New Pull Requests | ||
|
||
We love pull requests and we are generally very receptive to contributions. Things to keep in mind: | ||
|
||
- [Fork the repository](https://github.com/slackhq/slack-hubot) and make sure to work on a branch up to date with origin master. | ||
- Do your thing! | ||
- Be mindful about doing atomic commits, adding documentation to your changes, not refactoring too much. | ||
- Add tests covering the new code or functionality you are adding. | ||
- Add a descriptive title and add any useful information for the reviewer. If your contribution is a user facing thing, please attach a screenshot and/or screencast (gif preferrably). | ||
- Read and agree to our [Contributor License Agreement (CLA)](https://docs.google.com/a/slack-corp.com/forms/d/1q_w8rlJG_x_xJOoSUMNl7R35rkpA7N6pUkKhfHHMD9c/viewform). _We cannot accept your PR without your agreement to our CLA_. | ||
- Create your pull request (yay!). If it is in relation to an existing issue, please mention it on the title or description. | ||
|
||
[Interested in knowing more about about pull requests at Slack?](https://slack.engineering/on-empathy-pull-requests-979e4257d158#.awxtvmb2z) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
* [ ] I've read and understood the [Contributing guidelines](./CONTRIBUTING.md) and have done my best effort to follow them. | ||
* [ ] I've read and agree to the [Code of Conduct](./CODE_OF_CONDUCT.md). | ||
* [ ] I've searched for any related issues and avoided creating a duplicate issue. | ||
|
||
#### Description | ||
> e.g. Description of the bug or feature | ||
|
||
#### Reproducible in: | ||
{project_name} version: | ||
OS version(s): | ||
Device(s): | ||
|
||
#### Steps to reproduce: | ||
|
||
1. | ||
2. | ||
3. | ||
|
||
### Expected result: | ||
> e.g. What you expected to happen | ||
|
||
### Actual result: | ||
> e.g. What actually happened | ||
|
||
### Attachments: | ||
> e.g. Logs, screenshots, screencast, sample project, funny gif, etc. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
* [ ] I've read and understood the [Contributing guidelines](./CONTRIBUTING.md) and have done my best effort to follow them. | ||
* [ ] I've read and agree to the [Code of Conduct](./CODE_OF_CONDUCT.md). | ||
* [ ] I've been mindful about doing atomic commits, adding documentation to my changes, not refactoring too much. | ||
* [ ] I've a descriptive title and added any useful information for the reviewer. Where appropriate, I've attached a screenshot and/or screencast (gif preferrably). | ||
* [ ] I've written tests to cover the new code and functionality included in this PR. | ||
* [ ] I've read, agree to, and signed the [Contributor License Agreement (CLA)](https://docs.google.com/a/slack-corp.com/forms/d/1q_w8rlJG_x_xJOoSUMNl7R35rkpA7N6pUkKhfHHMD9c/viewform). | ||
|
||
#### PR Summary | ||
> e.g. New functionality for producing whatsits. | ||
|
||
#### Related Issues | ||
> e.g. Fixes #206 and closes #230 | ||
|
||
#### Test strategy | ||
> e.g. Add tests around whatsit production. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
SlackBot = require './src/bot' | ||
|
||
exports.use = (robot) -> | ||
new SlackBot robot, token: process.env.HUBOT_SLACK_TOKEN |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 there documentation available on how to do just that ?
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.
.rtm
or.web
will return the clients..send
is just a shortcut to select the best method.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.
Thanks!