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

Separate command and text field for slack-compatible outgoing webhook #19589

Open
esamson opened this issue Aug 18, 2021 · 45 comments · May be fixed by #29922
Open

Separate command and text field for slack-compatible outgoing webhook #19589

esamson opened this issue Aug 18, 2021 · 45 comments · May be fixed by #29922

Comments

@esamson
Copy link

esamson commented Aug 18, 2021

Discussed here: https://chat.zulip.org/#narrow/stream/127-integrations/topic/gitlab.20slash.20commands/near/1247658

Current behavior puts entire message, including bot mention, in the text field of the outgoing POST.

POST coming from Slack itself puts the "slash command" in a separate command field while their text field only contains the message body after the command.

For better compatibility, if message starts with a bot mention then we should separate that out into a command field and put the rest of the message in the text field.

Perhaps we can also transform the mention (**@mybot**) to a slash command (/mybot) so it looks like it would coming from Slack.

@zulipbot
Copy link
Member

zulipbot commented Sep 3, 2021

Hello @zulip/server-integrations members, this issue was labeled with the "area: integrations" label, so you may want to check it out!

@timabbott
Copy link
Sponsor Member

@esamson can you provide an example Slack payload or a pointer to the right part of their documentation?

https://api.slack.com/legacy/custom-integrations/outgoing-webhooks#legacy-info__post-data does not suggest the presence of a command field, but that is a legacy API.

@esamson
Copy link
Author

esamson commented Sep 18, 2021

Yeah, I haven't been able to find docs but just observed this by testing against Slack itself.

@esamson
Copy link
Author

esamson commented Sep 28, 2021

Hi, @timabbott.

Here is a sample capture, pointing a Slack slash command to requestbin and sending the command: /gitlab test

https://requestbin.com/r/en843hnins6x/1ylmaovFRI8NFkkNrZA92vtruUi

token=A7Fg5BIh4gBu3C8TxCMtIEQr&team_id=T02BB2GRXGD&team_domain=espaleklek&channel_id=D02AZB5N1AB&channel_name=directmessage&user_id=U02B7AS8J30&user_name=edward.samson&command=%2Fgitlab&text=test&is_enterprise_install=false&response_url=https%3A%2F%2Fhooks.slack.com%2Fcommands%2FT02BB2GRXGD%2F2534343413430%2Fi0r5OBTVGEZE4yfXZ0PaRaq3

What's also interesting there is response_url, which is where a response is posted in the case of long tasks. But that's another matter.

@madrix01
Copy link
Collaborator

madrix01 commented Oct 2, 2021

@timabbott @eeshangarg can i work on this issue ??

@jsmwoolf
Copy link
Collaborator

@madrix01 There's a command on this page you can use to pick up the issue.

@eeshangarg
Copy link
Member

@esamson Thanks for the additional context! When you say "by testing against Slack itself", do you mean you created a "Slack app" and then pointed the endpoint URL to requestbin? Thanks for reporting!

@eeshangarg
Copy link
Member

eeshangarg commented Oct 15, 2021

@timabbott Looks like the Enabling interactivity with Slash commands has the updated format for how the slash commands are supposed to be structured.

@esamson
Copy link
Author

esamson commented Oct 16, 2021

@eeshangarg Yes, that's what I did. I took the instruction from https://docs.gitlab.com/ee/user/project/integrations/slack_slash_commands.html and pointed to requestbin instead of gitlab.

@eeshangarg
Copy link
Member

@esamson Awesome, thank you so much!

@LoganNiswander
Copy link
Collaborator

@zulipbot claim
Would love to work on this as my first open source contribution!

@zulipbot
Copy link
Member

Welcome to Zulip, @LoganNiswander! We just sent you an invite to collaborate on this repository at https://github.com/zulip/zulip/invitations. Please accept this invite in order to claim this issue and begin a fun, rewarding experience contributing to Zulip!

Here's some tips to get you off to a good start:

As you work on this issue, you'll also want to refer to the Zulip code contribution guide, as well as the rest of the developer documentation on that site.

See you on the other side (that is, the pull request side)!

@zulipbot
Copy link
Member

zulipbot commented Nov 27, 2021

Hello @LoganNiswander, you have been unassigned from this issue because you have not updated this issue or any referenced pull requests for over 14 days.

You can reclaim this issue or claim any other issue by commenting @zulipbot claim on that issue.

Thanks for your contributions, and hope to see you again soon!

@leighadennis
Copy link
Collaborator

@zulipbot claim

@zulipbot
Copy link
Member

Hello @leighadennis, it looks like you've currently claimed 1 issue in this repository. We encourage new contributors to focus their efforts on at most 1 issue at a time, so please complete your work on your other claimed issues before trying to claim this issue again.

We look forward to your valuable contributions!

@leighadennis
Copy link
Collaborator

@zulipbot claim

@zulipbot
Copy link
Member

zulipbot commented Dec 27, 2021

Hello @leighadennis, you have been unassigned from this issue because you have not updated this issue or any referenced pull requests for over 14 days.

You can reclaim this issue or claim any other issue by commenting @zulipbot claim on that issue.

Thanks for your contributions, and hope to see you again soon!

@rohithvarma3000
Copy link
Collaborator

@zulipbot claim

@zulipbot
Copy link
Member

Welcome to Zulip, @rohithvarma3000! We just sent you an invite to collaborate on this repository at https://github.com/zulip/zulip/invitations. Please accept this invite in order to claim this issue and begin a fun, rewarding experience contributing to Zulip!

Here's some tips to get you off to a good start:

As you work on this issue, you'll also want to refer to the Zulip code contribution guide, as well as the rest of the developer documentation on that site.

See you on the other side (that is, the pull request side)!

@taeukkang09
Copy link

@zulipbot claim

@zulipbot
Copy link
Member

@taeukkang09 This issue cannot be claimed, as someone else is already working on it. Please see our contributor guide for advice on finding an issue to work on. Thanks!

@zulipbot
Copy link
Member

zulipbot commented Dec 22, 2023

@ikrambil You have been unassigned from this issue because you have not made any updates for over 14 days. Please feel free to reclaim the issue if you decide to pick up again. Thanks!

@SamchenUF
Copy link
Collaborator

@zulipbot claim

@zulipbot
Copy link
Member

Welcome to Zulip, @SamchenUF! We just sent you an invite to collaborate on this repository at https://github.com/zulip/zulip/invitations. Please accept this invite in order to claim this issue and begin a fun, rewarding experience contributing to Zulip!

Here's some tips to get you off to a good start:

As you work on this issue, you'll also want to refer to the Zulip code contribution guide, as well as the rest of the developer documentation on that site.

See you on the other side (that is, the pull request side)!

@zulipbot
Copy link
Member

zulipbot commented Feb 7, 2024

@SamchenUF You have been unassigned from this issue because you have not made any updates for over 14 days. Please feel free to reclaim the issue if you decide to pick up again. Thanks!

@souvik150
Copy link
Collaborator

@zulipbot claim

@zulipbot
Copy link
Member

Welcome to Zulip, @souvik150! We just sent you an invite to collaborate on this repository at https://github.com/zulip/zulip/invitations. Please accept this invite in order to claim this issue and begin a fun, rewarding experience contributing to Zulip!

Here's some tips to get you off to a good start:

As you work on this issue, you'll also want to refer to the Zulip code contribution guide, as well as the rest of the developer documentation on that site.

See you on the other side (that is, the pull request side)!

@zulipbot
Copy link
Member

zulipbot commented Feb 26, 2024

@souvik150 You have been unassigned from this issue because you have not made any updates for over 14 days. Please feel free to reclaim the issue if you decide to pick up again. Thanks!

@salandei
Copy link
Collaborator

@zulipbot claim

@zulipbot
Copy link
Member

Welcome to Zulip, @salandei! We just sent you an invite to collaborate on this repository at https://github.com/zulip/zulip/invitations. Please accept this invite in order to claim this issue and begin a fun, rewarding experience contributing to Zulip!

Here's some tips to get you off to a good start:

As you work on this issue, you'll also want to refer to the Zulip code contribution guide, as well as the rest of the developer documentation on that site.

See you on the other side (that is, the pull request side)!

salandei added a commit to salandei/zulip that referenced this issue May 2, 2024
This separates the slack legacy text field for slack-compatible
outgoing webhook into command and text fields.
The command field contains the bot mention and the text field
contains the content of the message after the bot mention.
For better compatibility, the bot mention is transformed
into Slack's slash command. e.g @**mybot** ->  /mybot
Test case for functionality is updated and api docs
on the Slack-compatible format is updated.

Fixes zulip#19589.
@salandei
Copy link
Collaborator

salandei commented May 9, 2024

@esamson Hi, would you like to look at my open PR and review it?
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment