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-44185] Add conditions for subscription validation #858

Merged
merged 22 commits into from
May 2, 2023

Conversation

mickmister
Copy link
Contributor

Summary

This PR adds more checks to the validateSubscription function, as well as adding more test cases.

Ticket Link

Fixes https://mattermost.atlassian.net/browse/MM-44185

@mickmister mickmister added 2: Dev Review Requires review by a core committer 3: QA Review Requires review by a QA tester labels May 17, 2022
@mickmister
Copy link
Contributor Author

Not sure why CI is failing:

cd webapp && /usr/local/bin/npm install
make: *** [Makefile:68: webapp/.npminstall] Terminated

Too long with no output (exceeded 10m0s): context deadline exceeded

@mickmister mickmister changed the title Add more conditions for subscription validation Add conditions for subscription validation May 18, 2022
@mickmister
Copy link
Contributor Author

Fixed CI with most recent commit

@levb levb removed the 2: Dev Review Requires review by a core committer label May 20, 2022
@mickmister
Copy link
Contributor Author

@DHaussermann Gentle ping on review for this

@DHaussermann
Copy link

/update-branch

@codecov-commenter
Copy link

codecov-commenter commented Jun 17, 2022

Codecov Report

Patch coverage: 61.29% and project coverage change: +0.23 🎉

Comparison is base (0ba44b3) 30.91% compared to head (9239901) 31.15%.

❗ Current head 9239901 differs from pull request most recent head a84d6af. Consider uploading reports for the commit a84d6af to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #858      +/-   ##
==========================================
+ Coverage   30.91%   31.15%   +0.23%     
==========================================
  Files          50       50              
  Lines        7332     7405      +73     
==========================================
+ Hits         2267     2307      +40     
- Misses       4884     4907      +23     
- Partials      181      191      +10     
Impacted Files Coverage Δ
server/issue.go 30.41% <ø> (ø)
server/plugin.go 11.65% <ø> (ø)
server/user.go 26.70% <0.00%> (-0.43%) ⬇️
server/subscribe.go 65.26% <64.77%> (-0.92%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@DHaussermann
Copy link

@mickmister - Not sure if I'm seeing a deployment issue or if something else is happening here. I don't see a new filter as expected for Comment Visibility so I am unable to do any functional testing for this.

I have the matching commit deployed. Any thoughts here? Maybe I've misunderstood something here?

@mickmister
Copy link
Contributor Author

@DHaussermann and I have discussed offline the scope of this PR, which does not include changes to comment visibility

@mickmister mickmister requested review from DHaussermann and removed request for DHaussermann August 31, 2022 05:44
@jupenur
Copy link
Member

jupenur commented Sep 22, 2022

@mickmister following up on our brief chat yesterday, what's missing to get this merged? Just the QA review? cc @DHaussermann

@mickmister
Copy link
Contributor Author

@jupenur Yes QA review is the next step here

@DHaussermann
Copy link

/update-branch

@hanzei hanzei added Awaiting Submitter Action Blocked on the author and removed 2: Dev Review Requires review by a core committer Awaiting Submitter Action Blocked on the author labels Feb 15, 2023
@hanzei hanzei added this to the v3.3.0 milestone Feb 21, 2023
@hanzei hanzei removed the request for review from asatkinson February 22, 2023 07:00
@hanzei hanzei changed the title Add conditions for subscription validation [MM-44185] Add conditions for subscription validation Feb 22, 2023
@DHaussermann
Copy link

I have done a round of testing and this is looking good.

  • Tested that security level filter is no longer opt-in on upgrade
  • Tested that the "kill switch" works as expected to continue subscription delivery
  • Regression tested security level filter is working
  • Labeling is system console has been improved for clarity
  • Subscription creation screen now has user feed back that there is now security level filter set when this is the case

When I tried to repeat this testing on server (testing above was on cloud) I get an error saving the subscription

image

@mickmister couple questions...

  • Is there any chance this change is agnostic to Jira Server Vs Jira Cloud? to me this seems like a risk.
  • The error above seems unrelated to the PR but can you confirm if it's happening on our side or on the Jira side?

@DHaussermann
Copy link

I tested this again and it is working as expected in this branch provided @mickmister here https://github.com/mattermost/mattermost-plugin-jira/tree/validate-subscription_debug.

@DHaussermann
Copy link

@m1lt0n or @asatkinson we should discuss the impact of this change and if clients need to be warned about it.
This PR really should have some type of Business Analysts approval.

Testing this has caused me to wonder how common the case is where people use projects in Jira with no issue security scheme applied. In such a case, users won't quickly be able to go edit their subscription to get it working again once they upgrade the plugin. Some effort is required in Jira as well to associate the project with a security scheme.

In short...
Issue where a scheme is applied and the security level is set to none works fine and no changes are needed to the subscription. But our solution here kind of assumes all projects have issue security schemes applied.
For any project where there is no issue security scheme in use there will be no way of delivering subscriptions unless the "kill switch" to make it work the old way is turned on to not require security level.

@m1lt0n
Copy link

m1lt0n commented Mar 9, 2023

@asatkinson Since this is a business decision, what do you propose to be the recommended course of action with this? cc: @DHaussermann

Let's bring this up in either our grooming or planning or async in our chat.

@asatkinson
Copy link

@DHaussermann I've been looking through this and I don't think I fully understand why this is so problematic.
It seems like they just want a switch so that if this filter is set then we restrict subscription notification to those posts below a certain security level - as defined in this JIRA help doc

Can we do a quick call so you can walk me through this? I don't have access to this UI.

@asatkinson
Copy link

If the issue is that it applies this and prevents all other subscriptions from working, then yes, this is a big problem and we should find another way to do this.

@mickmister
Copy link
Contributor Author

@DHaussermann Gentle ping to give this PR another look. I've resolved issues in CI

@mickmister mickmister requested a review from trilopin March 17, 2023 22:18
@hanzei
Copy link
Collaborator

hanzei commented Mar 30, 2023

@mickmister Heads up that there is a conflict to resolve

@DHaussermann
Copy link

/update-branch

@DHaussermann
Copy link

After discussing with @mickmister again the last concern I had is not applicable here.

I have checked again and tested on both Cloud and Server. If the issue is part of a project where there is no security level to assign because no level is in use by the project, the subscription will deliver the event even though the subscription has no applicable security level to evaluate.

Copy link

@DHaussermann DHaussermann left a comment

Choose a reason for hiding this comment

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

Tested and passed

  • On upgrade, subscription with security level continues to work
  • On upgrade, you can add a security level to a subscription to make it start delivering again
  • On Upgrade there is valid feedback that Exclude operator can no longer be used for security level when user open edit view to see why it's not working.
    image
  • "Kill switch" works to revert to old logic
  • Updating a subscription to add security level works
  • Targeting a project where there is no applicable security level works as expected without the filter as none is applicable

LGTM!

Thanks @mickmister for the effort on this.

@DHaussermann DHaussermann added 4: Reviews Complete All reviewers have approved the pull request and removed 3: QA Review Requires review by a QA tester labels May 2, 2023
@mickmister mickmister merged commit 5f5e084 into master May 2, 2023
@mickmister mickmister deleted the validate-subscription branch May 2, 2023 22:37
@mickmister mickmister mentioned this pull request Sep 14, 2023
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.