Can the Slack integration be configured to omit or truncate the Description?

7 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Ben ST

ungelesen,
22.10.2019, 11:03:3022.10.19
an Review Board Community
Hi

I am experimenting with the Slack integration (RB 3.0.15). Currently all of the RB Description body is sent to Slack. Is there a way to limit the post just to the Summary?

For confidentiality/security reasons our system admins don't want code posted into Slack channels, at least not by an automated system. So I can't use the Slack integration as it is. Or if there was a way to limit the Description to a max length like 250 chars, that would be good enough.

Thanks.

Christian Hammond

ungelesen,
23.10.2019, 01:58:5623.10.19
an revie...@googlegroups.com
Hi Ben,

We don't have any way of doing this built-in, I'm afraid. I want to understand this in more detail.

So the main concern is that you're looking to limit what information Slack receives, and the main source of this information in your case would be in the description, correct? Are there any concerns about the summary or any fields (branch, repository, etc.) being sent as well? If a review request has an attached screenshot, it will be shown as well, so would that also need to be filtered out?

One approach, which admittedly is more involved but gives you more control over what gets sent, is to write your own extension that registers a subclass of our own SlackIntegration (https://github.com/reviewboard/rbintegrations/blob/master/rbintegrations/slack/integration.py#L155).

That subclass would override notify(), altering some of the fields and stripping away the description, screenshots, or whatever else you need to remove, and then call the parent with the new method.

Your Extension subclass would be simple, just something like:


    from reviewboard.extensions.base import Extension
    from reviewboard.extensions.hooks import IntegrationHook

    class MySlackExtension(Extension):
        def initialize(self):
            IntegrationHook(self, MySlackIntegration)


Christian

--
Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups "Review Board Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/reviewboard/511c5ed2-6d32-471a-b7de-38d22479abca%40googlegroups.com.


--
Christian Hammond
President/CEO of Beanbag
Makers of Review Board
Die Nachricht wurde gelöscht

Ben ST

ungelesen,
23.10.2019, 07:13:3123.10.19
an Review Board Community
Hi Christian -- thanks for the detailed reply. So to explain the request in more detail:

We have no concern about the Summary field, nor the repo name or branch. It's really only the Description field we care about because it contains potentially unbounded amounts of text, and maybe sensitive source code that we wouldn't necessarily want unexpected Slack users seeing. Slack channel membership is not as tightly controlled as Git repo access is for developers -- it's pretty easy to invite someone to a Slack channel, so the person posting doesn't always know the exact readership.

Interesting that you mentioned screenshots -- I tested a review with a screenshot and that didn't show up in Slack in fact, so I assumed it was deliberate. I think if possible we would want to skip attachments in principle. It's less clear cut than the Description and probably wouldn't be a killer as long as they were just URLs, though if they displayed as full images in Slack it would bulk out the notification a lot. We'd prefer the Slack notification to be a basic "something changed" type of thing and people who care can follow the link back to the review.

Apart from code confidentiality issues, our Slack admins are very nervous about any automated process making posts without some kind of size sanity checks. I think if the Description field had a maximum length (we'd probably choose 100 or 200 chars) that would be a big help to get it approved.

Thanks for the subclassing suggestion. I might take a look at that.

-- Ben

Christian Hammond

ungelesen,
23.10.2019, 15:41:2023.10.19
an revie...@googlegroups.com
We attempt to post the first image file attachment we find that's compatible with Slack (standard PNG/JPEG/etc.), so it should show up. However, this does depend on the ability for Slack to reach your server, so for internal servers it's likely never going to show the screenshot. Same with pasting URLs to review request in Slack -- we provide metadata that Slack would use to "unfurl" the link and provide more detailed information, but it only works if Slack can access the review request.

The custom extension and subclassing approach is going to be your best option right now. I'm not ready to make specialized settings right now that alters the information we send to Slack, because I think different groups would have different requirements here, and we'd need to understand those requests better before designing and supporting anything.

Christian

-- Ben.
To unsubscribe from this group and stop receiving emails from it, send an email to revie...@googlegroups.com.


--
Christian Hammond
President/CEO of Beanbag
Makers of Review Board

--
Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups "Review Board Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard...@googlegroups.com.
Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten