WordPress.org

Making WordPress.org

Opened 4 years ago

Closed 14 months ago

Last modified 14 months ago

#2555 closed defect (fixed)

Slack: Update Trac bot to support threads

Reported by: SergeyBiryukov Owned by: dd32
Milestone: Priority: low
Component: Slack & IRC Keywords: needs-patch
Cc:

Description

If someone shares some tickets in a Slack thread, the Trac bot posts ticket links to the main channel, out of context.

The bot should be updated to post these links to the corresponding thread:
https://api.slack.com/docs/message-threading#best_practices

Attachments (1)

meta-2555.png (188.3 KB) - added by SergeyBiryukov 4 years ago.

Download all attachments as: .zip

Change History (17)

#1 @ocean90
4 years ago

  • Keywords needs-patch added

This ticket was mentioned in Slack in #core by sergey. View the logs.


4 years ago

#3 @netweb
3 years ago

#2892 was marked as a duplicate.

This ticket was mentioned in Slack in #core-customize by pento. View the logs.


3 years ago

This ticket was mentioned in Slack in #forums by sergey. View the logs.


3 years ago

This ticket was mentioned in Slack in #core by sergey. View the logs.


3 years ago

#7 @ocean90
3 years ago

  • Priority changed from normal to low

The current bot is triggered by an outgoing webhook which doesn't provide any infos about threads. To support threads we have to write a new app using the new APIs by Slack.

This ticket was mentioned in Slack in #core-customize by jeffpaul. View the logs.


3 years ago

#9 follow-up: @jbpaul17
3 years ago

For those interested in trying to get resolution on this, where is the code for Tracbot to crack open and try to patch/issue a PR?

#10 in reply to: ↑ 9 @SergeyBiryukov
3 years ago

Replying to jbpaul17:

where is the code for Tracbot to crack open and try to patch/issue a PR?

The current code is here: https://meta.trac.wordpress.org/browser/sites/trunk/common/includes/slack/trac

#11 @pento
3 years ago

According to the docs (or, the sample data in the docs, at least), the outgoing webhook provides the thread_ts parameter.

I've just been doing some testing, and it looks like the incoming webhook API doesn't obey the thread_ts parameter. I've pinged Slack support for confirmation.

#12 @pento
3 years ago

Update from Slack: they're not going to work on it in the near future.

Soooo.... the Slack API code will need to be rewritten. :-)

#13 @RMarks
2 years ago

I took a look how this might work. From what I have read and tested in another Slack workspace I have access, the new Slack incoming webhooks require a webhook URL to be setup per channel the app should be allowed to post. Per the new docs:

You cannot override the default channel (chosen by the user who installed your app), username, or icon when you're using Incoming Webhooks to post messages. Instead, these values will always inherit from the associated Slack app configuration.

Due to this limitation, for the various use cases I can see in Slack, there would need to be a different Slack app for each different named bot that would post:

  • WordPress commit
  • WordPress Trac
  • WordPress.org Meta Trac
  • etc.

#14 @dd32
14 months ago

  • Owner set to dd32
  • Resolution set to fixed
  • Status changed from new to closed

In 9228:

Slack: Thread trac-bot ticket responses.

When a ticket is referenced within a thread, trac-bot will no longer send it to the global channel (often wtihout any context).

There's an option to reply in-thread, but also to broadcast to the wider channel, but thought that best to avoid for now.
Unfortunately the slack outgoing-webhook implementation doesn't announce whether the threaded message we're being triggered by was broadcast or not.

Fixes #2555.

#15 @dd32
14 months ago

I don't know when it happened, but I spotted that the incoming-webhook supports threading!

I've implemented this in [9228], with a caveat - The outgoing-webhook doesn't let us know if the message we're triggered by is a channel broadcast or not, so for now, we'll always only reply in-thread and not also broadcast to the channel in response to a broadcast message.

This ticket was mentioned in Slack in #meta by dd32. View the logs.


14 months ago

Note: See TracTickets for help on using tickets.