[MM-420] Add feature to support multiple orgs in plugin settings - #773
Conversation
hanzei
left a comment
There was a problem hiding this comment.
Looking forward to using this feature on Community!
| } | ||
| } | ||
|
|
||
| func TestGetOrganizations(t *testing.T) { |
| if len(org) != 0 { | ||
| orgField = fmt.Sprintf("org:%v", org) | ||
| for _, org := range orgs { | ||
| if len(org) != 0 { |
There was a problem hiding this comment.
Yes, if a user enters orgA,orgB, as values in the system console, the last value after splitting the string will be an empty string.
There was a problem hiding this comment.
Should we guard for that case in getOrganizations?
There was a problem hiding this comment.
Should we guard for that case in getOrganizations?
@hanzei Can you please elaborate more on this comment? We have already added the guard to the getOrganizations function. Do you mean to remove it from here and apply the condition separately, wherever it is required?
There was a problem hiding this comment.
The slice returned from getOrganizations can never contain an empty string, right? Do we need the additional check here?
There was a problem hiding this comment.
@hanzei There was an additional check present in the lhs_request.go file, which I have removed now. Now, we only have this check present in the getOrganizations function.
…pdate function definition and minor reveiw fixes
|
@hanzei fixed the review comments. Please re-review. |
| if len(org) != 0 { | ||
| orgField = fmt.Sprintf("org:%v", org) | ||
| for _, org := range orgs { | ||
| if len(org) != 0 { |
There was a problem hiding this comment.
Should we guard for that case in getOrganizations?
|
@hanzei Fixed the review comments. Please re-review |
| if len(org) != 0 { | ||
| orgField = fmt.Sprintf("org:%v", org) | ||
| for _, org := range orgs { | ||
| if len(org) != 0 { |
There was a problem hiding this comment.
The slice returned from getOrganizations can never contain an empty string, right? Do we need the additional check here?
mickmister
left a comment
There was a problem hiding this comment.
Awesome work on this! 🚀 I have a few suggestions and questions to make sure we don't miss anything here. Nice work!
AayushChaudhary0001
left a comment
There was a problem hiding this comment.
This PR has been tested for the following scenario:
- Support for multiple orgs
- Data updated for multiple orgs in LHS
- Notification for all the orgs for which subscription is created
The PR was wroking fine for all the above scenarios, LGTM. Approved.
|
@AayushChaudhary0001 Did you also test the case of not having an org configured? |
|
@mickmister Yes, I have tested it with empty field as well for the org support, works fine even if no org is added. |
|
@AayushChaudhary0001 Got it, thank you 👍 |
|
@ayusht2810 There are some conflicts to resolve here |
|
@Kshitij-Katiyar @raghavaggarwal2308 I'm curious where this is at currently? On the community server we're currently unable to efficiently collaborate on the |
|
@mickmister Fixed the conflicts and updated the code with the suggestions. Please have a look. |
|
@mickmister Fixed the suggestions, please have a look. |
|
@ayusht2810 I found a issue while testing this PR: Steps to reproduce:
Actual - Multiple orgs data is not getting updated in LHS |
|
@AayushChaudhary0001 The above issue is fixed now. Please re-test. |
arush-vashishtha
left a comment
There was a problem hiding this comment.
This PR has been tested for the following scenarios:
- Support for multiple orgs
- Data updated for multiple orgs in LHS
- Notification for all the orgs for which subscription is created
The PR was working fine for all the above mentioned conditions, LGTM. Approved
Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
Summary
Ticket Link
Fixes #552
What to test?
Checklist
make testRan test cases and ensured they are passingmake check-styleRan style check and ensured both webapp and server pass the checks