Skip to content

[Mattermost] Lax requiring recipients and set raw recipients on cfg init #29889

Merged
kimlisa merged 2 commits intomasterfrom
lisa/define-toml-fields
Aug 3, 2023
Merged

[Mattermost] Lax requiring recipients and set raw recipients on cfg init #29889
kimlisa merged 2 commits intomasterfrom
lisa/define-toml-fields

Conversation

@kimlisa
Copy link
Copy Markdown
Contributor

@kimlisa kimlisa commented Aug 2, 2023

While testing the standalone mattermost plugin from: gravitational/teleport-plugins#876, ran into an error where raw recipients (from config) were not getting notified b/c the raw recipients were not being set on config init which this PR fixes and tests.

I also defined toml fields. It wasn't necessary but figured it wouldn't hurt to if the go struct field name changes for whatever reason

Also laxes requiring team/channel, this was the original implementation (something I failed to understand when refactoring). It's okay for these fields to be left blank, because the mattermost plugin also sends notifications to the suggested reviewers defined in the access request (as long as it can be matched with mattermost users email).

If there are no team/channel, email, or suggested reviewers defined then the plugin logs this:

WARN   No channel to post request_id:7a440f0a-df3b-4bed-95f6-a632e5afa19a request_op:put request_state:PENDING common/app.go:258

if there is a suggested reviewer that doesn't exist in mattermost, the plugin logs this:

WARN   Failed to notify a suggested reviewer: "random-user-1" does not look like a valid email request_id:48eb57d0-8164-42cf-81bc-d341d6174664 request_op:put request_state:PENDING common/app.go:406

@kimlisa kimlisa changed the title [Mattermost] Set raw recipients map and define toml fields [Mattermost] Lax requiring recipients and set raw recipients on cfg init Aug 2, 2023
@kimlisa kimlisa requested review from flyinghermit and removed request for probakowski August 2, 2023 18:02
Comment thread integrations/access/mattermost/config.go
@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from justinas August 3, 2023 15:35
@kimlisa kimlisa added this pull request to the merge queue Aug 3, 2023
Merged via the queue into master with commit dd9378b Aug 3, 2023
@kimlisa kimlisa deleted the lisa/define-toml-fields branch August 3, 2023 21:05
@public-teleport-github-review-bot
Copy link
Copy Markdown

@kimlisa See the table below for backport results.

Branch Result
branch/v13 Create PR

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants