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

Add fallback strategy to get MM team #1214

Merged
merged 2 commits into from
Aug 25, 2023

Conversation

mszostok
Copy link
Contributor

Description

Changes proposed in this pull request:

  • Add fallback strategy to get MM team

Testing

When you're running Botkube against the MM docker image mattermost/mattermost-preview it does not work as they don't have the search team endpoint implemented. So this change allows using the GetTeam as a fallback strategy.

You can test it by following those instructions: https://github.com/mattermost/mattermost-bot-sample-golang/tree/master

and later doing the same but with a helm chart:

$ helm repo add mattermost https://helm.mattermost.com
$ helm install mattermost/mattermost-team-edition \
  --set mysql.mysqlUser=sampleUser \
  --set mysql.mysqlPassword=samplePassword \

@mszostok mszostok added the enhancement New feature or request label Aug 25, 2023
@mszostok mszostok added this to the v1.4.0 milestone Aug 25, 2023
@mszostok mszostok requested review from PrasadG193 and a team as code owners August 25, 2023 14:28
@mszostok mszostok requested a review from pkosiec August 25, 2023 14:28
Copy link
Member

@pkosiec pkosiec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Disclaimer: I did just the code review.

if len(botTeams) == 0 {
return nil, fmt.Errorf("team %q not found", name)
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we handle a case when there are multiple botTeams? Maybe return an error that we found multiple (printing theirs name + displayName)?

@mszostok mszostok enabled auto-merge (squash) August 25, 2023 17:32
@mszostok mszostok merged commit 07d07be into kubeshop:main Aug 25, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants