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

Mm 432 - Handle "unconfigured" state of plugin gracefully #460

Merged
merged 7 commits into from
Aug 12, 2021

Conversation

sibasankarnayak
Copy link
Contributor

handled unconfigured state and allowed user to start the plugin with useful message if not configured

ticket here
#432

@mattermod
Copy link
Contributor

Hello @sibasankar-demansol,

Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.

@hanzei hanzei linked an issue Jul 16, 2021 that may be closed by this pull request
Copy link
Contributor

@hanzei hanzei left a comment

Choose a reason for hiding this comment

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

The code looks good, but maybe the UX can be a bit better. One suggestion below.

server/plugin/command.go Outdated Show resolved Hide resolved
@hanzei hanzei added the 2: Dev Review Requires review by a core committer label Jul 16, 2021
@hanzei hanzei requested a review from mickmister July 16, 2021 20:20
@hanzei hanzei added this to the v2.1.0 milestone Jul 16, 2021
Copy link
Member

@mickmister mickmister left a comment

Choose a reason for hiding this comment

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

Thanks @sibasankar-demansol, functionality looks good 👍

I have a few suggestions for improvement

server/plugin/command.go Outdated Show resolved Hide resolved
server/plugin/command.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Jul 22, 2021

Codecov Report

Merging #460 (8db8a3a) into master (bc8056e) will increase coverage by 0.24%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #460      +/-   ##
==========================================
+ Coverage   19.66%   19.90%   +0.24%     
==========================================
  Files          11       11              
  Lines        2741     3004     +263     
==========================================
+ Hits          539      598      +59     
- Misses       2162     2366     +204     
  Partials       40       40              
Impacted Files Coverage Δ
server/plugin/command.go 9.90% <0.00%> (-0.26%) ⬇️
server/plugin/plugin.go 4.76% <ø> (-0.07%) ⬇️
server/plugin/utils.go 61.53% <0.00%> (-0.40%) ⬇️
server/plugin/template.go 95.10% <0.00%> (-0.20%) ⬇️
server/plugin/webhook.go 0.00% <0.00%> (ø)
server/plugin/manifest.go 100.00% <0.00%> (ø)
server/plugin/api.go 8.56% <0.00%> (+0.64%) ⬆️
server/plugin/subscriptions.go 10.71% <0.00%> (+0.92%) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bc8056e...8db8a3a. Read the comment docs.

@maisnamrajusingh
Copy link
Contributor

@hanzei can you take a look at this ?

Copy link
Member

@mickmister mickmister left a comment

Choose a reason for hiding this comment

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

Great work @sibasankar-demansol 👍 I have some non-blocking suggestions to improve some text

var text string
switch {
case err != nil:
text = "Unable to fetch user details."
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
text = "Unable to fetch user details."
text = "Error checking user's permissions"
p.API.LogWarn(text, "err", err.Error())

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

server/plugin/command.go Outdated Show resolved Hide resolved
Copy link
Contributor

@hanzei hanzei left a comment

Choose a reason for hiding this comment

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

Nice work 👍 One nit pick

server/plugin/command.go Outdated Show resolved Hide resolved
@hanzei hanzei added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core committer labels Aug 11, 2021
@hanzei
Copy link
Contributor

hanzei commented Aug 11, 2021

@sibasankar-demansol Let me know if you want to address my comment above. Otherwise I will just merge the PR.

@sibasankarnayak
Copy link
Contributor Author

@sibasankar-demansol Let me know if you want to address my comment above. Otherwise I will just merge the PR.

@hanzei have made the changes as asked , you can merge it now

@hanzei hanzei merged commit e326669 into mattermost:master Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle "unconfigured" state of plugin gracefully
6 participants