{"action":"created","comment":{"url":"https://api.github.com/repos/santiment/sanbase2/pulls/comments/214303063","pull_request_review_id":151330534,"id":214303063,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNDMwMzA2Mw==","diff_hunk":"@@ -0,0 +1,91 @@\n+defmodule Sanbase.Repo.Migrations.SanitizeUsernames do\n+  use Ecto.Migration\n+\n+  require Logger\n+  alias Sanbase.Auth.User\n+  alias Sanbase.Repo\n+\n+  alias SanbaseWeb.Graphql.Helpers.Utils\n+\n+  def change do\n+    Application.ensure_all_started(:tzdata)\n+\n+    work()\n+  end\n+\n+  def work() do\n+    Logger.debug(\"trim_whitespace\")\n+\n+    all_users_non_nil_username()\n+    |> Enum.reject(&(&1.username == nil))","path":"priv/repo/migrations/20180831094245_sanitize_usernames.exs","position":20,"original_position":20,"commit_id":"e4d45a204a422344ba58e97eb065e71501c9a7cb","original_commit_id":"e4d45a204a422344ba58e97eb065e71501c9a7cb","user":{"login":"valo","id":47639,"node_id":"MDQ6VXNlcjQ3NjM5","avatar_url":"https://avatars2.githubusercontent.com/u/47639?v=4","gravatar_id":"","url":"https://api.github.com/users/valo","html_url":"https://github.com/valo","followers_url":"https://api.github.com/users/valo/followers","following_url":"https://api.github.com/users/valo/following{/other_user}","gists_url":"https://api.github.com/users/valo/gists{/gist_id}","starred_url":"https://api.github.com/users/valo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/valo/subscriptions","organizations_url":"https://api.github.com/users/valo/orgs","repos_url":"https://api.github.com/users/valo/repos","events_url":"https://api.github.com/users/valo/events{/privacy}","received_events_url":"https://api.github.com/users/valo/received_events","type":"User","site_admin":false},"body":"I think this `reject` is duplicated and not necessary here","created_at":"2018-08-31T09:56:03Z","updated_at":"2018-08-31T09:56:04Z","html_url":"https://github.com/santiment/sanbase2/pull/651#discussion_r214303063","pull_request_url":"https://api.github.com/repos/santiment/sanbase2/pulls/651","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/santiment/sanbase2/pulls/comments/214303063"},"html":{"href":"https://github.com/santiment/sanbase2/pull/651#discussion_r214303063"},"pull_request":{"href":"https://api.github.com/repos/santiment/sanbase2/pulls/651"}}},"pull_request":{"url":"https://api.github.com/repos/santiment/sanbase2/pulls/651","id":212105202,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEyMTA1MjAy","html_url":"https://github.com/santiment/sanbase2/pull/651","diff_url":"https://github.com/santiment/sanbase2/pull/651.diff","patch_url":"https://github.com/santiment/sanbase2/pull/651.patch","issue_url":"https://api.github.com/repos/santiment/sanbase2/issues/651","number":651,"state":"open","locked":false,"title":"Sanitize usernames","user":{"login":"tspenov","id":122794,"node_id":"MDQ6VXNlcjEyMjc5NA==","avatar_url":"https://avatars0.githubusercontent.com/u/122794?v=4","gravatar_id":"","url":"https://api.github.com/users/tspenov","html_url":"https://github.com/tspenov","followers_url":"https://api.github.com/users/tspenov/followers","following_url":"https://api.github.com/users/tspenov/following{/other_user}","gists_url":"https://api.github.com/users/tspenov/gists{/gist_id}","starred_url":"https://api.github.com/users/tspenov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tspenov/subscriptions","organizations_url":"https://api.github.com/users/tspenov/orgs","repos_url":"https://api.github.com/users/tspenov/repos","events_url":"https://api.github.com/users/tspenov/events{/privacy}","received_events_url":"https://api.github.com/users/tspenov/received_events","type":"User","site_admin":false},"body":"#### Summary\r\ncard:  https://favro.com/organization/bdbb4f24afc48b29c74f4fa4/9ff267872fcd8b7925f1d7c7?card=San-2165\r\nSanitize usernames\r\n- [x] trim whitespace of usernames. If trimmed username is existing - update to `nil`\r\n- [x] update usernames containing non ascii chars to `nil`\r\n- [x] return proper message when username contains non-ascii","created_at":"2018-08-30T14:44:11Z","updated_at":"2018-08-31T09:56:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bf371cdab8a1c492d58c68bab88a4b5683372202","assignee":null,"assignees":[],"requested_reviewers":[{"login":"IvanIvanoff","id":6518376,"node_id":"MDQ6VXNlcjY1MTgzNzY=","avatar_url":"https://avatars3.githubusercontent.com/u/6518376?v=4","gravatar_id":"","url":"https://api.github.com/users/IvanIvanoff","html_url":"https://github.com/IvanIvanoff","followers_url":"https://api.github.com/users/IvanIvanoff/followers","following_url":"https://api.github.com/users/IvanIvanoff/following{/other_user}","gists_url":"https://api.github.com/users/IvanIvanoff/gists{/gist_id}","starred_url":"https://api.github.com/users/IvanIvanoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IvanIvanoff/subscriptions","organizations_url":"https://api.github.com/users/IvanIvanoff/orgs","repos_url":"https://api.github.com/users/IvanIvanoff/repos","events_url":"https://api.github.com/users/IvanIvanoff/events{/privacy}","received_events_url":"https://api.github.com/users/IvanIvanoff/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/santiment/sanbase2/pulls/651/commits","review_comments_url":"https://api.github.com/repos/santiment/sanbase2/pulls/651/comments","review_comment_url":"https://api.github.com/repos/santiment/sanbase2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/santiment/sanbase2/issues/651/comments","statuses_url":"https://api.github.com/repos/santiment/sanbase2/statuses/e4d45a204a422344ba58e97eb065e71501c9a7cb","head":{"label":"santiment:sanitize-usernames","ref":"sanitize-usernames","sha":"e4d45a204a422344ba58e97eb065e71501c9a7cb","user":{"login":"santiment","id":24846876,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0ODQ2ODc2","avatar_url":"https://avatars1.githubusercontent.com/u/24846876?v=4","gravatar_id":"","url":"https://api.github.com/users/santiment","html_url":"https://github.com/santiment","followers_url":"https://api.github.com/users/santiment/followers","following_url":"https://api.github.com/users/santiment/following{/other_user}","gists_url":"https://api.github.com/users/santiment/gists{/gist_id}","starred_url":"https://api.github.com/users/santiment/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/santiment/subscriptions","organizations_url":"https://api.github.com/users/santiment/orgs","repos_url":"https://api.github.com/users/santiment/repos","events_url":"https://api.github.com/users/santiment/events{/privacy}","received_events_url":"https://api.github.com/users/santiment/received_events","type":"Organization","site_admin":false},"repo":{"id":106712767,"node_id":"MDEwOlJlcG9zaXRvcnkxMDY3MTI3Njc=","name":"sanbase2","full_name":"santiment/sanbase2","owner":{"login":"santiment","id":24846876,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0ODQ2ODc2","avatar_url":"https://avatars1.githubusercontent.com/u/24846876?v=4","gravatar_id":"","url":"https://api.github.com/users/santiment","html_url":"https://github.com/santiment","followers_url":"https://api.github.com/users/santiment/followers","following_url":"https://api.github.com/users/santiment/following{/other_user}","gists_url":"https://api.github.com/users/santiment/gists{/gist_id}","starred_url":"https://api.github.com/users/santiment/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/santiment/subscriptions","organizations_url":"https://api.github.com/users/santiment/orgs","repos_url":"https://api.github.com/users/santiment/repos","events_url":"https://api.github.com/users/santiment/events{/privacy}","received_events_url":"https://api.github.com/users/santiment/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/santiment/sanbase2","description":"The source code of the Sanbase application in Santiment LLC","fork":false,"url":"https://api.github.com/repos/santiment/sanbase2","forks_url":"https://api.github.com/repos/santiment/sanbase2/forks","keys_url":"https://api.github.com/repos/santiment/sanbase2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/santiment/sanbase2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/santiment/sanbase2/teams","hooks_url":"https://api.github.com/repos/santiment/sanbase2/hooks","issue_events_url":"https://api.github.com/repos/santiment/sanbase2/issues/events{/number}","events_url":"https://api.github.com/repos/santiment/sanbase2/events","assignees_url":"https://api.github.com/repos/santiment/sanbase2/assignees{/user}","branches_url":"https://api.github.com/repos/santiment/sanbase2/branches{/branch}","tags_url":"https://api.github.com/repos/santiment/sanbase2/tags","blobs_url":"https://api.github.com/repos/santiment/sanbase2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/santiment/sanbase2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/santiment/sanbase2/git/refs{/sha}","trees_url":"https://api.github.com/repos/santiment/sanbase2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/santiment/sanbase2/statuses/{sha}","languages_url":"https://api.github.com/repos/santiment/sanbase2/languages","stargazers_url":"https://api.github.com/repos/santiment/sanbase2/stargazers","contributors_url":"https://api.github.com/repos/santiment/sanbase2/contributors","subscribers_url":"https://api.github.com/repos/santiment/sanbase2/subscribers","subscription_url":"https://api.github.com/repos/santiment/sanbase2/subscription","commits_url":"https://api.github.com/repos/santiment/sanbase2/commits{/sha}","git_commits_url":"https://api.github.com/repos/santiment/sanbase2/git/commits{/sha}","comments_url":"https://api.github.com/repos/santiment/sanbase2/comments{/number}","issue_comment_url":"https://api.github.com/repos/santiment/sanbase2/issues/comments{/number}","contents_url":"https://api.github.com/repos/santiment/sanbase2/contents/{+path}","compare_url":"https://api.github.com/repos/santiment/sanbase2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/santiment/sanbase2/merges","archive_url":"https://api.github.com/repos/santiment/sanbase2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/santiment/sanbase2/downloads","issues_url":"https://api.github.com/repos/santiment/sanbase2/issues{/number}","pulls_url":"https://api.github.com/repos/santiment/sanbase2/pulls{/number}","milestones_url":"https://api.github.com/repos/santiment/sanbase2/milestones{/number}","notifications_url":"https://api.github.com/repos/santiment/sanbase2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/santiment/sanbase2/labels{/name}","releases_url":"https://api.github.com/repos/santiment/sanbase2/releases{/id}","deployments_url":"https://api.github.com/repos/santiment/sanbase2/deployments","created_at":"2017-10-12T15:42:11Z","updated_at":"2018-08-30T12:37:37Z","pushed_at":"2018-08-31T09:47:14Z","git_url":"git://github.com/santiment/sanbase2.git","ssh_url":"git@github.com:santiment/sanbase2.git","clone_url":"https://github.com/santiment/sanbase2.git","svn_url":"https://github.com/santiment/sanbase2","homepage":"https://app.santiment.net","size":11058,"stargazers_count":31,"watchers_count":31,"language":"Elixir","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":6,"open_issues":8,"watchers":31,"default_branch":"master"}},"base":{"label":"santiment:master","ref":"master","sha":"fb6cb7f5a5864d0e370dd0e4b95eb59abc22577f","user":{"login":"santiment","id":24846876,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0ODQ2ODc2","avatar_url":"https://avatars1.githubusercontent.com/u/24846876?v=4","gravatar_id":"","url":"https://api.github.com/users/santiment","html_url":"https://github.com/santiment","followers_url":"https://api.github.com/users/santiment/followers","following_url":"https://api.github.com/users/santiment/following{/other_user}","gists_url":"https://api.github.com/users/santiment/gists{/gist_id}","starred_url":"https://api.github.com/users/santiment/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/santiment/subscriptions","organizations_url":"https://api.github.com/users/santiment/orgs","repos_url":"https://api.github.com/users/santiment/repos","events_url":"https://api.github.com/users/santiment/events{/privacy}","received_events_url":"https://api.github.com/users/santiment/received_events","type":"Organization","site_admin":false},"repo":{"id":106712767,"node_id":"MDEwOlJlcG9zaXRvcnkxMDY3MTI3Njc=","name":"sanbase2","full_name":"santiment/sanbase2","owner":{"login":"santiment","id":24846876,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0ODQ2ODc2","avatar_url":"https://avatars1.githubusercontent.com/u/24846876?v=4","gravatar_id":"","url":"https://api.github.com/users/santiment","html_url":"https://github.com/santiment","followers_url":"https://api.github.com/users/santiment/followers","following_url":"https://api.github.com/users/santiment/following{/other_user}","gists_url":"https://api.github.com/users/santiment/gists{/gist_id}","starred_url":"https://api.github.com/users/santiment/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/santiment/subscriptions","organizations_url":"https://api.github.com/users/santiment/orgs","repos_url":"https://api.github.com/users/santiment/repos","events_url":"https://api.github.com/users/santiment/events{/privacy}","received_events_url":"https://api.github.com/users/santiment/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/santiment/sanbase2","description":"The source code of the Sanbase application in Santiment LLC","fork":false,"url":"https://api.github.com/repos/santiment/sanbase2","forks_url":"https://api.github.com/repos/santiment/sanbase2/forks","keys_url":"https://api.github.com/repos/santiment/sanbase2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/santiment/sanbase2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/santiment/sanbase2/teams","hooks_url":"https://api.github.com/repos/santiment/sanbase2/hooks","issue_events_url":"https://api.github.com/repos/santiment/sanbase2/issues/events{/number}","events_url":"https://api.github.com/repos/santiment/sanbase2/events","assignees_url":"https://api.github.com/repos/santiment/sanbase2/assignees{/user}","branches_url":"https://api.github.com/repos/santiment/sanbase2/branches{/branch}","tags_url":"https://api.github.com/repos/santiment/sanbase2/tags","blobs_url":"https://api.github.com/repos/santiment/sanbase2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/santiment/sanbase2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/santiment/sanbase2/git/refs{/sha}","trees_url":"https://api.github.com/repos/santiment/sanbase2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/santiment/sanbase2/statuses/{sha}","languages_url":"https://api.github.com/repos/santiment/sanbase2/languages","stargazers_url":"https://api.github.com/repos/santiment/sanbase2/stargazers","contributors_url":"https://api.github.com/repos/santiment/sanbase2/contributors","subscribers_url":"https://api.github.com/repos/santiment/sanbase2/subscribers","subscription_url":"https://api.github.com/repos/santiment/sanbase2/subscription","commits_url":"https://api.github.com/repos/santiment/sanbase2/commits{/sha}","git_commits_url":"https://api.github.com/repos/santiment/sanbase2/git/commits{/sha}","comments_url":"https://api.github.com/repos/santiment/sanbase2/comments{/number}","issue_comment_url":"https://api.github.com/repos/santiment/sanbase2/issues/comments{/number}","contents_url":"https://api.github.com/repos/santiment/sanbase2/contents/{+path}","compare_url":"https://api.github.com/repos/santiment/sanbase2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/santiment/sanbase2/merges","archive_url":"https://api.github.com/repos/santiment/sanbase2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/santiment/sanbase2/downloads","issues_url":"https://api.github.com/repos/santiment/sanbase2/issues{/number}","pulls_url":"https://api.github.com/repos/santiment/sanbase2/pulls{/number}","milestones_url":"https://api.github.com/repos/santiment/sanbase2/milestones{/number}","notifications_url":"https://api.github.com/repos/santiment/sanbase2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/santiment/sanbase2/labels{/name}","releases_url":"https://api.github.com/repos/santiment/sanbase2/releases{/id}","deployments_url":"https://api.github.com/repos/santiment/sanbase2/deployments","created_at":"2017-10-12T15:42:11Z","updated_at":"2018-08-30T12:37:37Z","pushed_at":"2018-08-31T09:47:14Z","git_url":"git://github.com/santiment/sanbase2.git","ssh_url":"git@github.com:santiment/sanbase2.git","clone_url":"https://github.com/santiment/sanbase2.git","svn_url":"https://github.com/santiment/sanbase2","homepage":"https://app.santiment.net","size":11058,"stargazers_count":31,"watchers_count":31,"language":"Elixir","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":6,"open_issues":8,"watchers":31,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/santiment/sanbase2/pulls/651"},"html":{"href":"https://github.com/santiment/sanbase2/pull/651"},"issue":{"href":"https://api.github.com/repos/santiment/sanbase2/issues/651"},"comments":{"href":"https://api.github.com/repos/santiment/sanbase2/issues/651/comments"},"review_comments":{"href":"https://api.github.com/repos/santiment/sanbase2/pulls/651/comments"},"review_comment":{"href":"https://api.github.com/repos/santiment/sanbase2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/santiment/sanbase2/pulls/651/commits"},"statuses":{"href":"https://api.github.com/repos/santiment/sanbase2/statuses/e4d45a204a422344ba58e97eb065e71501c9a7cb"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"valo"}}