Skip to content

Exclude organization members feature - #154

Merged
hanzei merged 12 commits into
mattermost:masterfrom
enoldev:org-members-excluded
Jan 8, 2020
Merged

hanzei merged 12 commits into
mattermost:masterfrom
enoldev:org-members-excluded

Conversation

@enoldev

@enoldev enoldev commented Nov 6, 2019 •

Copy link
Copy Markdown
Contributor
  • Command: we iterate through every parameter, identifying if it's a "feature" or a "flag" (for this purpose, some helper functions have been included in "utils")

  • Subscription: a new struct for flags has been created.

  • Plugin: a new method isUserOrganizationMember has been added.

  • Webhook: a new method excludeConfigOrgMember has been included. It's responsible for fetching configuration and creating the GitHub client.

I have created two different methods so isUserOrganizationMember could be reused without any links to the purpose of this task.

Thanks!

Fixes #125

@hanzei
hanzei requested review from hanzei and marianunez November 6, 2019 19:00
@hanzei hanzei added 2: Dev Review Requires review by a core committer 3: QA Review Requires review by a QA tester labels Nov 6, 2019
@hanzei
hanzei requested review from alifarooq0 and removed request for hanzei November 6, 2019 19:02
@hanzei hanzei added this to the v0.13.0 milestone Nov 6, 2019
@mattermod

Copy link
Copy Markdown
Contributor

This issue has been automatically labelled "stale" because it hasn't had recent activity.
A core team member will check in on the status of the PR to help with questions.
Thank you for your contribution!

/cc @jasonblais @hanzei

@jasonblais

Copy link
Copy Markdown
Contributor

@marianunez / @ali-farooq0 friendly reminder to help review of this PR some time this coming week :)

@marianunez marianunez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Apologies for the delay @enolal826! Overall looks good. Some minor feedback below

Comment thread server/command.go Resolved
Comment thread server/plugin.go Resolved
Comment thread server/webhook.go Resolved
Comment thread server/command.go Resolved
Co-Authored-By: Maria A Nunez <[email protected]>

@marianunez marianunez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @enolal826! 🎉

@DHaussermann

DHaussermann commented Nov 26, 2019 •

Copy link
Copy Markdown

@marianunez would you be able to provide any high-level tests steps for this? I can regression test subscriptions but I'm not sure how validate Plugin: a new method isUserOrganizationMember has been added.

Details provided by enolal826 Thank you!

@DHaussermann

Copy link
Copy Markdown

@enolal826 when I try to pass in the exclude-org-member flag my subscription does not work and I see no event deliveries. I have ensure that the cofig locks the organization so, the feature should be working.

There may be unrelated problem where there is not proper feedback when the subscription command is invalid. but, for now, can you help by providing a sample subscribe command where 1 or multiple members are excluded.
Can we also add this to the help?

@alifarooq0 alifarooq0 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great addition @enolal826 🎉! Just one minor concern around where we're parsing the SubscriptionFlags, looks great otherwise.

Comment thread server/utils_test.go Resolved
Comment thread server/utils_test.go Resolved
Comment thread server/webhook.go Resolved
Comment thread server/plugin.go Resolved
Comment thread server/subscriptions.go Resolved
@hanzei
hanzei requested a review from alifarooq0 December 2, 2019 09:31
@DHaussermann

Copy link
Copy Markdown

Hey @enolal826 thanks for updating the help to include the flag.

I'm still not seeing this work on my server. (The subscription not delivering before was because I tried to append values to the the flag which was invalid) When I use the flag I'm not seeing members being excluded.

Can you please look over these steps and let me know if you see anything else I'm doing wrong?

  1. Build GitHub from org-members-excluded branch
  2. Configure the plugin with an app and webhook on the GitHub side and enable it
  3. Lock the plugin to an organization such as "DHaussermann"
  4. Subscribe to a repo in the Org using the new flag /github subscribe DHaussermann/hello-world --exclude-org-member
  5. As the owner of the repo (or other member) create a branch or PR
    Observed The even is deliver in the subscribed channel.

@alifarooq0

Copy link
Copy Markdown

@enolal826 do you mind updating the branch to resolve conflicts as well as answer @DHaussermann's comment above? Thanks!

@DHaussermann

Copy link
Copy Markdown

@aaronrothschild I added the PM Review label to this one. Sorry, I'm not sure what the process is for updating the read-me in cases like this. Would updates be done by the contributor and approved by you?

@enoldev

enoldev commented Dec 5, 2019

Copy link
Copy Markdown
Contributor Author

I can update the README and @aaronrothschild could validate it if it's ok for him

@DHaussermann DHaussermann added the Docs/Needed Requires documentation label Dec 6, 2019
@aaronrothschild

Copy link
Copy Markdown
Contributor

I can update the README and @aaronrothschild could validate it if it's ok for him

Yes, that would be great and helpful for me @enolal826 ! Happy to review, then can remove the "Docs Needed" label when this is all set.

@marianunez

Copy link
Copy Markdown
Member

/update-branch

@marianunez

Copy link
Copy Markdown
Member

/update-branch

@hanzei

hanzei commented Dec 19, 2019

Copy link
Copy Markdown
Contributor

@enolal826 Do you want to include the doc changes in this PR or open a separate one?

@mattermod

Copy link
Copy Markdown
Contributor

This issue has been automatically labelled "stale" because it hasn't had recent activity.
A core team member will check in on the status of the PR to help with questions.
Thank you for your contribution!

/cc @jasonblais @hanzei

@jasonblais

Copy link
Copy Markdown
Contributor

Hi @enolal826! Wasn't sure if you and @aaronrothschild were planning to make the doc changes in this PR or separately. Looks like this is otherwise good to merge. Thanks for your contribution! :)

@hanzei

hanzei commented Jan 7, 2020

Copy link
Copy Markdown
Contributor

@aaronrothschild Would you be fine merging the PR as it is and doing the doc changes in a different PR?

@aaronrothschild

Copy link
Copy Markdown
Contributor

@aaronrothschild Would you be fine merging the PR as it is and doing the doc changes in a different PR?

@hanzei Yes, no problem.

@hanzei hanzei added 4: Reviews Complete All reviewers have approved the pull request and removed 1: PM Review Requires review by a product manager Lifecycle/1:stale labels Jan 8, 2020
@hanzei

hanzei commented Jan 8, 2020

Copy link
Copy Markdown
Contributor

/update-branch

@hanzei
hanzei merged commit 23f77f0 into mattermost:master Jan 8, 2020
@hanzei

hanzei commented Jan 8, 2020

Copy link
Copy Markdown
Contributor

Thanks for adding this valuable feature @enolal826 🕺

@hanzei hanzei added Docs/Done Required documentation has been written and removed Docs/Needed Requires documentation labels Mar 4, 2020
ayusht2810 pushed a commit that referenced this pull request Feb 1, 2024
#192)

* Revert "Update main.go (#154)"

This reverts commit be4a281d0cc791d10e6e5ae917b325b2f054e475.

* Revert "[MM-33506] Use embed package to include plugin manifest (#145)"

This reverts commit ca9ee3c17c6920a636a33f378e17395afd6f329f.

* Revert "Don't generate manifest.ts (#127)"

This reverts commit 18d30b50bc7ba800c9f05bfd82970781db0aea3e.

* install-go-tools target, adopt gotestsum

* bring back make apply + automatic versioning

* Update build/manifest/main.go

Co-authored-by: Michael Kochell <[email protected]>

* suppress git describe error when no tags match

* make version/release notes opt-in

* fix whitespace in Makefile

* document version management options

---------

Co-authored-by: Michael Kochell <[email protected]>
mickmister added a commit that referenced this pull request Feb 15, 2024
* Make use of github.com/mattermost/mattermost/server/public

* [MM-36] Update plugin with respect to phase 1 upgrades

* [MM-36] Update makefile command for testcases

* Sync with playbooks: install-go-tools, gotestsum, and dynamic versions (#192)

* Revert "Update main.go (#154)"

This reverts commit be4a281d0cc791d10e6e5ae917b325b2f054e475.

* Revert "[MM-33506] Use embed package to include plugin manifest (#145)"

This reverts commit ca9ee3c17c6920a636a33f378e17395afd6f329f.

* Revert "Don't generate manifest.ts (#127)"

This reverts commit 18d30b50bc7ba800c9f05bfd82970781db0aea3e.

* install-go-tools target, adopt gotestsum

* bring back make apply + automatic versioning

* Update build/manifest/main.go

Co-authored-by: Michael Kochell <[email protected]>

* suppress git describe error when no tags match

* make version/release notes opt-in

* fix whitespace in Makefile

* document version management options

---------

Co-authored-by: Michael Kochell <[email protected]>

* Fetch plugin logs from server (#193)

Co-authored-by: Jesse Hallam <[email protected]>

* [MM-36] Update plugin.json file

---------

Co-authored-by: Ben Schumacher <[email protected]>
Co-authored-by: Mattermost Build <[email protected]>
Co-authored-by: Jesse Hallam <[email protected]>
Co-authored-by: Michael Kochell <[email protected]>
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 Docs/Done Required documentation has been written

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow excluding organisation members from subscription events

8 participants