{"action":"created","comment":{"url":"https://api.github.com/repos/mattermost/mattermost-server/pulls/comments/221635870","pull_request_review_id":160330870,"id":221635870,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMTYzNTg3MA==","diff_hunk":"@@ -1662,7 +1662,13 @@ func (a *App) PermanentDeleteChannel(channel *model.Channel) *model.AppError {\n \n // This function is intended for use from the CLI. It is not robust against people joining the channel while the move\n // is in progress, and therefore should not be used from the API without first fixing this potential race condition.\n-func (a *App) MoveChannel(team *model.Team, channel *model.Channel, user *model.User) *model.AppError {\n+func (a *App) MoveChannel(team *model.Team, channel *model.Channel, user *model.User, removeDeactivatedMembers bool) *model.AppError {\n+\tif removeDeactivatedMembers {\n+\t\tif result := <-a.Srv.Store.Channel().RemoveAllDeactivatedMembers(channel.Id); result.Err != nil {","path":"app/channel.go","position":7,"original_position":7,"commit_id":"4fad37d790141f2c034209cb7265340479ffbbae","original_commit_id":"4fad37d790141f2c034209cb7265340479ffbbae","user":{"login":"jespino","id":290303,"node_id":"MDQ6VXNlcjI5MDMwMw==","avatar_url":"https://avatars0.githubusercontent.com/u/290303?v=4","gravatar_id":"","url":"https://api.github.com/users/jespino","html_url":"https://github.com/jespino","followers_url":"https://api.github.com/users/jespino/followers","following_url":"https://api.github.com/users/jespino/following{/other_user}","gists_url":"https://api.github.com/users/jespino/gists{/gist_id}","starred_url":"https://api.github.com/users/jespino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jespino/subscriptions","organizations_url":"https://api.github.com/users/jespino/orgs","repos_url":"https://api.github.com/users/jespino/repos","events_url":"https://api.github.com/users/jespino/events{/privacy}","received_events_url":"https://api.github.com/users/jespino/received_events","type":"User","site_admin":false},"body":"I think is not a big deal, but if something fail after this, It will end up with the deletion of memberships of deactivated users, but without the entire process succeeded.","created_at":"2018-10-01T14:43:50Z","updated_at":"2018-10-01T14:44:22Z","html_url":"https://github.com/mattermost/mattermost-server/pull/9515#discussion_r221635870","pull_request_url":"https://api.github.com/repos/mattermost/mattermost-server/pulls/9515","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/mattermost/mattermost-server/pulls/comments/221635870"},"html":{"href":"https://github.com/mattermost/mattermost-server/pull/9515#discussion_r221635870"},"pull_request":{"href":"https://api.github.com/repos/mattermost/mattermost-server/pulls/9515"}}},"pull_request":{"url":"https://api.github.com/repos/mattermost/mattermost-server/pulls/9515","id":219397558,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE5Mzk3NTU4","html_url":"https://github.com/mattermost/mattermost-server/pull/9515","diff_url":"https://github.com/mattermost/mattermost-server/pull/9515.diff","patch_url":"https://github.com/mattermost/mattermost-server/pull/9515.patch","issue_url":"https://api.github.com/repos/mattermost/mattermost-server/issues/9515","number":9515,"state":"open","locked":false,"title":"MM-12251: Add flag to MoveChannel to remove all deactivated users.","user":{"login":"grundleborg","id":1198059,"node_id":"MDQ6VXNlcjExOTgwNTk=","avatar_url":"https://avatars1.githubusercontent.com/u/1198059?v=4","gravatar_id":"","url":"https://api.github.com/users/grundleborg","html_url":"https://github.com/grundleborg","followers_url":"https://api.github.com/users/grundleborg/followers","following_url":"https://api.github.com/users/grundleborg/following{/other_user}","gists_url":"https://api.github.com/users/grundleborg/gists{/gist_id}","starred_url":"https://api.github.com/users/grundleborg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grundleborg/subscriptions","organizations_url":"https://api.github.com/users/grundleborg/orgs","repos_url":"https://api.github.com/users/grundleborg/repos","events_url":"https://api.github.com/users/grundleborg/events{/privacy}","received_events_url":"https://api.github.com/users/grundleborg/received_events","type":"User","site_admin":false},"body":"#### Summary\r\n\r\n Add flag to MoveChannel to remove all deactivated users. This fixes the issue where you can't move a channel to a target team if there are deactivated users in the channel who aren't in the target team. To preserve consistency, a new flag is added to the CLI command to get the fixed behaviour, rather than changing the existing behaviour.\r\n\r\n#### Ticket Link\r\nhttps://mattermost.atlassian.net/browse/MM-12251\r\n\r\n#### Checklist\r\n- [x] Added or updated unit tests (required for all new features)\r\n- [x] Includes text changes and localization file updates\r\n","created_at":"2018-10-01T14:31:12Z","updated_at":"2018-10-01T14:44:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"506012b17993a8a8caaad3edc05240135f010764","assignee":null,"assignees":[],"requested_reviewers":[{"login":"sudheerDev","id":4973621,"node_id":"MDQ6VXNlcjQ5NzM2MjE=","avatar_url":"https://avatars0.githubusercontent.com/u/4973621?v=4","gravatar_id":"","url":"https://api.github.com/users/sudheerDev","html_url":"https://github.com/sudheerDev","followers_url":"https://api.github.com/users/sudheerDev/followers","following_url":"https://api.github.com/users/sudheerDev/following{/other_user}","gists_url":"https://api.github.com/users/sudheerDev/gists{/gist_id}","starred_url":"https://api.github.com/users/sudheerDev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sudheerDev/subscriptions","organizations_url":"https://api.github.com/users/sudheerDev/orgs","repos_url":"https://api.github.com/users/sudheerDev/repos","events_url":"https://api.github.com/users/sudheerDev/events{/privacy}","received_events_url":"https://api.github.com/users/sudheerDev/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":250214574,"node_id":"MDU6TGFiZWwyNTAyMTQ1NzQ=","url":"https://api.github.com/repos/mattermost/mattermost-server/labels/2:%20Dev%20Review","name":"2: Dev Review","color":"eb6420","default":false}],"milestone":{"url":"https://api.github.com/repos/mattermost/mattermost-server/milestones/39","html_url":"https://github.com/mattermost/mattermost-server/milestone/39","labels_url":"https://api.github.com/repos/mattermost/mattermost-server/milestones/39/labels","id":3613077,"node_id":"MDk6TWlsZXN0b25lMzYxMzA3Nw==","number":39,"title":"v5.4.0","description":"","creator":{"login":"cpanato","id":4115580,"node_id":"MDQ6VXNlcjQxMTU1ODA=","avatar_url":"https://avatars2.githubusercontent.com/u/4115580?v=4","gravatar_id":"","url":"https://api.github.com/users/cpanato","html_url":"https://github.com/cpanato","followers_url":"https://api.github.com/users/cpanato/followers","following_url":"https://api.github.com/users/cpanato/following{/other_user}","gists_url":"https://api.github.com/users/cpanato/gists{/gist_id}","starred_url":"https://api.github.com/users/cpanato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpanato/subscriptions","organizations_url":"https://api.github.com/users/cpanato/orgs","repos_url":"https://api.github.com/users/cpanato/repos","events_url":"https://api.github.com/users/cpanato/events{/privacy}","received_events_url":"https://api.github.com/users/cpanato/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":38,"state":"open","created_at":"2018-08-31T13:06:51Z","updated_at":"2018-10-01T14:31:13Z","due_on":"2018-10-16T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/mattermost/mattermost-server/pulls/9515/commits","review_comments_url":"https://api.github.com/repos/mattermost/mattermost-server/pulls/9515/comments","review_comment_url":"https://api.github.com/repos/mattermost/mattermost-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mattermost/mattermost-server/issues/9515/comments","statuses_url":"https://api.github.com/repos/mattermost/mattermost-server/statuses/4fad37d790141f2c034209cb7265340479ffbbae","head":{"label":"grundleborg:MM-12251","ref":"MM-12251","sha":"4fad37d790141f2c034209cb7265340479ffbbae","user":{"login":"grundleborg","id":1198059,"node_id":"MDQ6VXNlcjExOTgwNTk=","avatar_url":"https://avatars1.githubusercontent.com/u/1198059?v=4","gravatar_id":"","url":"https://api.github.com/users/grundleborg","html_url":"https://github.com/grundleborg","followers_url":"https://api.github.com/users/grundleborg/followers","following_url":"https://api.github.com/users/grundleborg/following{/other_user}","gists_url":"https://api.github.com/users/grundleborg/gists{/gist_id}","starred_url":"https://api.github.com/users/grundleborg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grundleborg/subscriptions","organizations_url":"https://api.github.com/users/grundleborg/orgs","repos_url":"https://api.github.com/users/grundleborg/repos","events_url":"https://api.github.com/users/grundleborg/events{/privacy}","received_events_url":"https://api.github.com/users/grundleborg/received_events","type":"User","site_admin":false},"repo":{"id":66004466,"node_id":"MDEwOlJlcG9zaXRvcnk2NjAwNDQ2Ng==","name":"mattermost-server","full_name":"grundleborg/mattermost-server","private":false,"owner":{"login":"grundleborg","id":1198059,"node_id":"MDQ6VXNlcjExOTgwNTk=","avatar_url":"https://avatars1.githubusercontent.com/u/1198059?v=4","gravatar_id":"","url":"https://api.github.com/users/grundleborg","html_url":"https://github.com/grundleborg","followers_url":"https://api.github.com/users/grundleborg/followers","following_url":"https://api.github.com/users/grundleborg/following{/other_user}","gists_url":"https://api.github.com/users/grundleborg/gists{/gist_id}","starred_url":"https://api.github.com/users/grundleborg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grundleborg/subscriptions","organizations_url":"https://api.github.com/users/grundleborg/orgs","repos_url":"https://api.github.com/users/grundleborg/repos","events_url":"https://api.github.com/users/grundleborg/events{/privacy}","received_events_url":"https://api.github.com/users/grundleborg/received_events","type":"User","site_admin":false},"html_url":"https://github.com/grundleborg/mattermost-server","description":"Open source Slack-alternative in Golang and React - Mattermost","fork":true,"url":"https://api.github.com/repos/grundleborg/mattermost-server","forks_url":"https://api.github.com/repos/grundleborg/mattermost-server/forks","keys_url":"https://api.github.com/repos/grundleborg/mattermost-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grundleborg/mattermost-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grundleborg/mattermost-server/teams","hooks_url":"https://api.github.com/repos/grundleborg/mattermost-server/hooks","issue_events_url":"https://api.github.com/repos/grundleborg/mattermost-server/issues/events{/number}","events_url":"https://api.github.com/repos/grundleborg/mattermost-server/events","assignees_url":"https://api.github.com/repos/grundleborg/mattermost-server/assignees{/user}","branches_url":"https://api.github.com/repos/grundleborg/mattermost-server/branches{/branch}","tags_url":"https://api.github.com/repos/grundleborg/mattermost-server/tags","blobs_url":"https://api.github.com/repos/grundleborg/mattermost-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grundleborg/mattermost-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grundleborg/mattermost-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/grundleborg/mattermost-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grundleborg/mattermost-server/statuses/{sha}","languages_url":"https://api.github.com/repos/grundleborg/mattermost-server/languages","stargazers_url":"https://api.github.com/repos/grundleborg/mattermost-server/stargazers","contributors_url":"https://api.github.com/repos/grundleborg/mattermost-server/contributors","subscribers_url":"https://api.github.com/repos/grundleborg/mattermost-server/subscribers","subscription_url":"https://api.github.com/repos/grundleborg/mattermost-server/subscription","commits_url":"https://api.github.com/repos/grundleborg/mattermost-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/grundleborg/mattermost-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/grundleborg/mattermost-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/grundleborg/mattermost-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/grundleborg/mattermost-server/contents/{+path}","compare_url":"https://api.github.com/repos/grundleborg/mattermost-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grundleborg/mattermost-server/merges","archive_url":"https://api.github.com/repos/grundleborg/mattermost-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grundleborg/mattermost-server/downloads","issues_url":"https://api.github.com/repos/grundleborg/mattermost-server/issues{/number}","pulls_url":"https://api.github.com/repos/grundleborg/mattermost-server/pulls{/number}","milestones_url":"https://api.github.com/repos/grundleborg/mattermost-server/milestones{/number}","notifications_url":"https://api.github.com/repos/grundleborg/mattermost-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grundleborg/mattermost-server/labels{/name}","releases_url":"https://api.github.com/repos/grundleborg/mattermost-server/releases{/id}","deployments_url":"https://api.github.com/repos/grundleborg/mattermost-server/deployments","created_at":"2016-08-18T14:35:40Z","updated_at":"2018-10-01T12:03:37Z","pushed_at":"2018-10-01T14:31:21Z","git_url":"git://github.com/grundleborg/mattermost-server.git","ssh_url":"git@github.com:grundleborg/mattermost-server.git","clone_url":"https://github.com/grundleborg/mattermost-server.git","svn_url":"https://github.com/grundleborg/mattermost-server","homepage":"http://mattermost.org","size":309663,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mattermost:master","ref":"master","sha":"a0f75cadb2b0fa91f6e321b1b8b859519b2ec865","user":{"login":"mattermost","id":9828093,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk4MjgwOTM=","avatar_url":"https://avatars1.githubusercontent.com/u/9828093?v=4","gravatar_id":"","url":"https://api.github.com/users/mattermost","html_url":"https://github.com/mattermost","followers_url":"https://api.github.com/users/mattermost/followers","following_url":"https://api.github.com/users/mattermost/following{/other_user}","gists_url":"https://api.github.com/users/mattermost/gists{/gist_id}","starred_url":"https://api.github.com/users/mattermost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattermost/subscriptions","organizations_url":"https://api.github.com/users/mattermost/orgs","repos_url":"https://api.github.com/users/mattermost/repos","events_url":"https://api.github.com/users/mattermost/events{/privacy}","received_events_url":"https://api.github.com/users/mattermost/received_events","type":"Organization","site_admin":false},"repo":{"id":37448451,"node_id":"MDEwOlJlcG9zaXRvcnkzNzQ0ODQ1MQ==","name":"mattermost-server","full_name":"mattermost/mattermost-server","private":false,"owner":{"login":"mattermost","id":9828093,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk4MjgwOTM=","avatar_url":"https://avatars1.githubusercontent.com/u/9828093?v=4","gravatar_id":"","url":"https://api.github.com/users/mattermost","html_url":"https://github.com/mattermost","followers_url":"https://api.github.com/users/mattermost/followers","following_url":"https://api.github.com/users/mattermost/following{/other_user}","gists_url":"https://api.github.com/users/mattermost/gists{/gist_id}","starred_url":"https://api.github.com/users/mattermost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattermost/subscriptions","organizations_url":"https://api.github.com/users/mattermost/orgs","repos_url":"https://api.github.com/users/mattermost/repos","events_url":"https://api.github.com/users/mattermost/events{/privacy}","received_events_url":"https://api.github.com/users/mattermost/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/mattermost/mattermost-server","description":"Open source Slack-alternative in Golang and React - Mattermost","fork":false,"url":"https://api.github.com/repos/mattermost/mattermost-server","forks_url":"https://api.github.com/repos/mattermost/mattermost-server/forks","keys_url":"https://api.github.com/repos/mattermost/mattermost-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mattermost/mattermost-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mattermost/mattermost-server/teams","hooks_url":"https://api.github.com/repos/mattermost/mattermost-server/hooks","issue_events_url":"https://api.github.com/repos/mattermost/mattermost-server/issues/events{/number}","events_url":"https://api.github.com/repos/mattermost/mattermost-server/events","assignees_url":"https://api.github.com/repos/mattermost/mattermost-server/assignees{/user}","branches_url":"https://api.github.com/repos/mattermost/mattermost-server/branches{/branch}","tags_url":"https://api.github.com/repos/mattermost/mattermost-server/tags","blobs_url":"https://api.github.com/repos/mattermost/mattermost-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mattermost/mattermost-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mattermost/mattermost-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/mattermost/mattermost-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mattermost/mattermost-server/statuses/{sha}","languages_url":"https://api.github.com/repos/mattermost/mattermost-server/languages","stargazers_url":"https://api.github.com/repos/mattermost/mattermost-server/stargazers","contributors_url":"https://api.github.com/repos/mattermost/mattermost-server/contributors","subscribers_url":"https://api.github.com/repos/mattermost/mattermost-server/subscribers","subscription_url":"https://api.github.com/repos/mattermost/mattermost-server/subscription","commits_url":"https://api.github.com/repos/mattermost/mattermost-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/mattermost/mattermost-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/mattermost/mattermost-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/mattermost/mattermost-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/mattermost/mattermost-server/contents/{+path}","compare_url":"https://api.github.com/repos/mattermost/mattermost-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mattermost/mattermost-server/merges","archive_url":"https://api.github.com/repos/mattermost/mattermost-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mattermost/mattermost-server/downloads","issues_url":"https://api.github.com/repos/mattermost/mattermost-server/issues{/number}","pulls_url":"https://api.github.com/repos/mattermost/mattermost-server/pulls{/number}","milestones_url":"https://api.github.com/repos/mattermost/mattermost-server/milestones{/number}","notifications_url":"https://api.github.com/repos/mattermost/mattermost-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mattermost/mattermost-server/labels{/name}","releases_url":"https://api.github.com/repos/mattermost/mattermost-server/releases{/id}","deployments_url":"https://api.github.com/repos/mattermost/mattermost-server/deployments","created_at":"2015-06-15T06:50:02Z","updated_at":"2018-10-01T12:51:19Z","pushed_at":"2018-10-01T14:31:23Z","git_url":"git://github.com/mattermost/mattermost-server.git","ssh_url":"git@github.com:mattermost/mattermost-server.git","clone_url":"https://github.com/mattermost/mattermost-server.git","svn_url":"https://github.com/mattermost/mattermost-server","homepage":"https://mattermost.com","size":310638,"stargazers_count":13123,"watchers_count":13123,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2386,"mirror_url":null,"archived":false,"open_issues_count":177,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2386,"open_issues":177,"watchers":13123,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mattermost/mattermost-server/pulls/9515"},"html":{"href":"https://github.com/mattermost/mattermost-server/pull/9515"},"issue":{"href":"https://api.github.com/repos/mattermost/mattermost-server/issues/9515"},"comments":{"href":"https://api.github.com/repos/mattermost/mattermost-server/issues/9515/comments"},"review_comments":{"href":"https://api.github.com/repos/mattermost/mattermost-server/pulls/9515/comments"},"review_comment":{"href":"https://api.github.com/repos/mattermost/mattermost-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mattermost/mattermost-server/pulls/9515/commits"},"statuses":{"href":"https://api.github.com/repos/mattermost/mattermost-server/statuses/4fad37d790141f2c034209cb7265340479ffbbae"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"jespino"}}