Add Mattermost chat integration.
Review Request #9361 — Created Nov. 10, 2017 and submitted
This change integrates Mattermost with Review Board, so that when there
is activity on review requests, a message will be sent to the configured
Mattermost channel with the details, just like Slack.
All existing rbintegrations unit tests pass for SlackIntegration. Added
similar unit tests for MattermostIntegration, which also pass.Manually tested navigating to the Integrations page on the UI. The new
form for Mattermost is displayed. Mattermost logo has been added, but
icon@2x needs to be created/uploaded still.
Description | From | Last Updated |
---|---|---|
I think you may have missed adding some files - I don't see the MattermostIntegration code in here, for example. … |
mike_conley | |
We also need an icon@2x.png file. |
david | |
All the files inside .idea shouldn't be part of your commit. |
david | |
You've still got this .idea file in the change. |
david | |
We should include module docstrings at the top of each new file (something like """Forms for chat integrations""") |
david | |
I don't think it was before, but this string should be wrapped in _() |
david | |
I don't think it was before, but this string should be wrapped in _() |
david | |
Module docstring. |
david | |
Shouldn't mention slack here. |
david | |
Shouldn't mention slack. |
david | |
These could all go on the same line. |
david | |
Shouldn't mention slack here. |
david | |
Shouldn't mention slack here. |
david | |
Hmm. This is probably something that we should have an abstract method for in basechat and specialize per subclass. |
david | |
Shouldn't mention slack here. |
david | |
Shouldn't mention slack here. |
david | |
Shouldn't mention slack here. |
david | |
Logging here shouldn't mention slack. |
david | |
Shouldn't mention slack here. |
david | |
Shouldn't mention slack here. |
david | |
Shouldn't mention slack here. |
david | |
Shouldn't mention slack here. |
david | |
We can just skip this entirely because the base class for all integrations defines it. |
david | |
Module docstring. |
david | |
Too many blank lines here. |
david | |
Not too many blank lines enough here. |
david | |
Because this is a property, we can document it like a property (just a single line `"""The icons used for … |
david | |
Module docstring |
david | |
Class docstring |
david | |
Don't need this blank line. |
david | |
Should include a docstring. |
david | |
Looks like we can just get rid of this file, no? |
david | |
Maybe mention that this is oriented towards Slack, but broken out of the integration class because other services (like Mattermost) … |
david | |
This argument should be called integration instead of self |
david | |
Perhaps just "configured channels"? I think it's definitely possible that other slack clones will pop up in the future. |
david | |
E265 block comment should start with '# ' |
reviewbot | |
W391 blank line at end of file |
reviewbot | |
I think an argument needs a default value in order for it to be optional, I'm not seeing a default … |
bleblan2 | |
This import is coming from the same location as the line above, this can be updated to a single line … |
bleblan2 | |
There might be a good reason why this line was moved away from the django imports, but having the line … |
bleblan2 |
- Commit:
-
8ab1f36bb6e7b77234a7d5354833c386e50e9fb47c4e448d64044cb19afe4512bab5f1a23a799d75
Checks run (2 succeeded)
-
Most of the stuff in your new "basechat" implementation is pretty Slack specific. This works because Mattermost tries to duplicate Slack's formatting very carefully, but that won't generalize to more services. I suspect what we want is to have the basechat integration set up all the handlers and create some kind of intermediate data structures, which the individual subclasses can then format into whatever is necessary. Because Mattermost borrows a lot from Slack, we could have utility code for that in the
slack/
module that Mattermost imports. -
- Commit:
-
7c4e448d64044cb19afe4512bab5f1a23a799d758758758bd112f33dbf1e68b04c481d094fed3e49
- Diff:
-
Revision 3 (+3334 -627)
Checks run (2 succeeded)
- Summary:
-
[WIP] Add Mattermost chat integration.Add Mattermost chat integration.
- Testing Done:
-
~ All existing rbintegrations unit tests pass for Slack pass.
~ All existing rbintegrations unit tests pass for SlackIntegration. Added
+ similar unit tests for MattermostIntegration, which also pass. Manually tested navigating to the Integrations page on the UI. The new
~ form for Mattermost is displayed. Still need to add the Mattermost logo. ~ ~ form for Mattermost is displayed. Mattermost logo has been added, but ~ icon@2x needs to be created/uploaded still. - Still need to add unit tests to for the newly added
- MattermostIntegration component, as well as for BaseChatIntegration.
-
-
-
-
We should include module docstrings at the top of each new file (something like
"""Forms for chat integrations"""
) -
-
-
-
-
-
-
-
-
Hmm. This is probably something that we should have an abstract method for in basechat and specialize per subclass.
-
-
-
-
-
-
-
-
-
-
-
-
-
Because this is a property, we can document it like a property (just a single line `"""The icons used for the integration.""")
-
-
-
-
-
-
Maybe mention that this is oriented towards Slack, but broken out of the integration class because other services (like Mattermost) duplicate Slack APIs.
-
-
Perhaps just "configured channels"? I think it's definitely possible that other slack clones will pop up in the future.
- Commit:
-
8758758bd112f33dbf1e68b04c481d094fed3e49a6594f554d5c647cae123908cc8a0eba29272916
- Diff:
-
Revision 4 (+3407 -639)
- Commit:
-
a6594f554d5c647cae123908cc8a0eba2927291679c27470b387cfc0b72631153077686e48e3372a
- Diff:
-
Revision 5 (+3400 -639)
Checks run (2 succeeded)
- Commit:
-
79c27470b387cfc0b72631153077686e48e3372a95749603d0d7308afbd47ac3b0cbcd1c976a7b92
- Diff:
-
Revision 6 (+3425 -620)
- Commit:
-
95749603d0d7308afbd47ac3b0cbcd1c976a7b92975cf058f08560c1a3be9ee4b03a6f760b3a2db4
- Diff:
-
Revision 7 (+3421 -620)
Checks run (2 succeeded)
- Commit:
-
975cf058f08560c1a3be9ee4b03a6f760b3a2db49ac14f99c39e5bf23a13d6f7ab14170e2712b827
- Diff:
-
Revision 8 (+2513 -620)
Checks run (2 succeeded)
-
-
I think an argument needs a default value in order for it to be optional, I'm not seeing a default value for
pre_text
orfallback_text
in the method declaration. -
If
fallback_text
is optional, I'm guessing that means it can be empty. If it is empty, the new value offallback_text
would have an extra:
in it. Might be worth adding extra logic for checking if fallback_text is empty and removing the extra:
. -
-
This import is coming from the same location as the line above, this can be updated to a single line with
from rbintegrations.slack.integration import utility_format_link, utility_notify
. -
There might be a good reason why this line was moved away from the django imports, but having the line here doesn't follow the standard of having third party imports before local imports.
- Commit:
-
9ac14f99c39e5bf23a13d6f7ab14170e2712b82700ee2a089b40f50208530577ebc453fa5b39068a
- Diff:
-
Revision 9 (+2513 -620)
Checks run (2 succeeded)
- Commit:
-
00ee2a089b40f50208530577ebc453fa5b39068a5c9dd8801cb5dcceaec449a5431768469dff54d7
- Diff:
-
Revision 10 (+2511 -618)