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-14897: Changes to be able to add and remove groups from channels. #10794

Merged
merged 4 commits into from May 15, 2019

Conversation

mkraft
Copy link
Contributor

@mkraft mkraft commented May 6, 2019

Summary

Changes to be able to add and remove groups from channels.

Pretty similar to some of the changes from #10701 but for Channels.

Ticket Link

https://mattermost.atlassian.net/browse/MM-14897

@mkraft mkraft added the Work In Progress Not yet ready for review label May 6, 2019
@mkraft mkraft force-pushed the MM-15162 branch 3 times, most recently from bd93fb8 to 1123490 Compare May 9, 2019 13:42
@mkraft mkraft added this to the v5.12.0 milestone May 9, 2019
@mkraft mkraft changed the base branch from MM-15162 to master May 10, 2019 15:58
app/group.go Outdated Show resolved Hide resolved
model/client4.go Outdated Show resolved Hide resolved
@mkraft mkraft added 2: Dev Review Requires review by a developer and removed Work In Progress Not yet ready for review labels May 10, 2019
Copy link
Member

@jespino jespino left a comment

Choose a reason for hiding this comment

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

I have some improvements proposals, but in general looks good to me.

store/sqlstore/group_supplier.go Outdated Show resolved Hide resolved
store/sqlstore/group_supplier.go Outdated Show resolved Hide resolved
store/sqlstore/group_supplier.go Outdated Show resolved Hide resolved
@mkraft mkraft requested a review from jespino May 14, 2019 11:40
Where("ug.DeleteAt = 0 AND gt.TeamId = ? AND gt.DeleteAt = 0", teamID)
From(fmt.Sprintf("%s gs", table)).
LeftJoin("UserGroups ug ON gs.GroupId = ug.Id").
Where(fmt.Sprintf("ug.DeleteAt = 0 AND gs.%s = ? AND gs.DeleteAt = 0", idCol), syncableID)
Copy link
Member

Choose a reason for hiding this comment

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

I don't like this "query building" approach. I would prefer something more simple like building the entire query two times one for each syncable type. (probably in the query some lines later you can reuse a chunk of the query. Anyway, up to you, feel free to merge it as is, if you think is the best option.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jespino I had the same thought as you when it was being written. Perhaps it's tipping the scale towards "too clever" instead of being repetitive. The impetus for doing it this way was that it's such a long query to repeat twice. Is the risk from the repetition worth the risk from the added complexity of interpolating the string? I don't think there's a definitive answer.

@mgdelacroix mgdelacroix removed the 2: Dev Review Requires review by a developer label May 15, 2019
@mgdelacroix mgdelacroix added the 4: Reviews Complete All reviewers have approved the pull request label May 15, 2019
@mkraft mkraft merged commit 1b78f9d into master May 15, 2019
@mkraft mkraft deleted the MM-14897 branch May 15, 2019 16:03
@amyblais amyblais added Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation and removed Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation labels May 17, 2019
@lindalumitchell lindalumitchell added the Tests/Done Required release tests have been written label May 24, 2019
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 Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation Tests/Done Required release tests have been written
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants