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

[PR #5629/03039a56 backport][stable-6] Remove automatically adding # symbol to channel names #5641

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Dec 1, 2022

This is a backport of PR #5629 as merged into main (03039a5).

SUMMARY

For channels with IDs that starts with G4 a # symbol is being prepended causing it to fail.
Channel IDs can start with either C, G, or D but there is no documentation on the length of the ID so it isn't possible to be able to create logic to catch all the possible IDs without false positives from channel name values.
This change removes the logic to automatically prepend # to passed in channel value.

Fixes issue #2608

https://api.slack.com/docs/conversations-api#shared_channels

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

slack

ADDITIONAL INFORMATION

When trying to edit a slack message in a private channel by using the message_id argument I get an error that the channel was not found with the Channel ID G4xxxxxxx

  1. When build_payload_for_slack is called there is an if which prepends # if channel_id does not starts with a certain symbols or does not have one of the listed two character prefixes. I've stumbled upon a channel which ID starts with G4 but current implementation doesn't have this string in the list so I got #G4xxxxxx added to payload.
  2. It fails when message_id is supplied and since channel_id can not be the channel name and the ID is in the form of G4xxxxxxx which is returned by previous task run.

* Add regex to match all channel ids

* Add changelog fragment

* Allow matching of channel ids with 9-11 characters

* Fix file name

* Update changelogs/fragments/5629-add-channel-prefix-regex.yml

Co-authored-by: Felix Fontein <[email protected]>

* Remove channel auto prepend #

* Update changelog fragment

* Add prepend_hash option

* Add version_added to prepend_hash doc string

Co-authored-by: Felix Fontein <[email protected]>

* Add description of possible values for the prepend_hash option

Co-authored-by: Felix Fontein <[email protected]>

* Remove old channel assign statement

* Update changelogs/fragments/5629-add-prepend-hash-option-for-channel-id.yml

Co-authored-by: Felix Fontein <[email protected]>

* Update changelog fragment tag

Co-authored-by: Felix Fontein <[email protected]>

Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 03039a5)
@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added backport bug This issue/PR relates to a bug module module new_contributor Help guide this first time contributor notification plugins plugin (any type) labels Dec 1, 2022
@felixfontein felixfontein merged commit 406fa12 into stable-6 Dec 1, 2022
@felixfontein felixfontein deleted the patchback/backports/stable-6/03039a56c0a409b574f79f456df72950d95362c6/pr-5629 branch December 1, 2022 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug module module new_contributor Help guide this first time contributor notification plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants