{"action":"created","comment":{"url":"https://api.github.com/repos/line/centraldogma/pulls/comments/188157888","pull_request_review_id":120078039,"id":188157888,"diff_hunk":"@@ -0,0 +1,101 @@\n+/*\n+ * Copyright 2018 LINE Corporation\n+ *\n+ * LINE Corporation licenses this file to you under the Apache License,\n+ * version 2.0 (the \"License\"); you may not use this file except in compliance\n+ * with the License. You may obtain a copy of the License at:\n+ *\n+ *   https://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n+ * License for the specific language governing permissions and limitations\n+ * under the License.\n+ */\n+\n+package com.linecorp.centraldogma.server.internal.metadata;\n+\n+import static com.linecorp.centraldogma.internal.api.v1.HttpApiV1Constants.PROJECTS_PREFIX;\n+import static com.linecorp.centraldogma.internal.api.v1.HttpApiV1Constants.REPOS;\n+import static org.assertj.core.api.Assertions.assertThat;\n+\n+import java.net.InetSocketAddress;\n+import java.util.ArrayList;\n+import java.util.List;\n+import java.util.stream.Collectors;\n+\n+import org.junit.BeforeClass;\n+import org.junit.ClassRule;\n+import org.junit.Test;\n+\n+import com.fasterxml.jackson.databind.JsonNode;\n+\n+import com.linecorp.armeria.client.HttpClient;\n+import com.linecorp.armeria.client.HttpClientBuilder;\n+import com.linecorp.armeria.common.AggregatedHttpMessage;\n+import com.linecorp.armeria.common.HttpHeaderNames;\n+import com.linecorp.centraldogma.common.Change;\n+import com.linecorp.centraldogma.common.Revision;\n+import com.linecorp.centraldogma.internal.Jackson;\n+import com.linecorp.centraldogma.testing.CentralDogmaRule;\n+\n+public class ThriftBackwardCompatibilityTest {\n+\n+    @ClassRule\n+    public static final CentralDogmaRule dogma = new CentralDogmaRule();\n+\n+    private static HttpClient httpClient;\n+\n+    private static final String projectName = \"foo\";\n+\n+    @BeforeClass\n+    public static void init() {\n+        final InetSocketAddress serverAddress = dogma.dogma().activePort().get().localAddress();\n+        final String serverUri = \"http://\" + serverAddress.getHostString() + ':' + serverAddress.getPort();\n+        httpClient = new HttpClientBuilder(serverUri)\n+                .addHttpHeader(HttpHeaderNames.AUTHORIZATION, \"bearer anonymous\").build();\n+    }\n+\n+    @Test\n+    public void shouldBackwardCompatible() throws Exception {\n+        final String repo1 = \"repo1\";\n+\n+        dogma.client().createProject(projectName).join();\n+        dogma.client().createRepository(projectName, repo1).join();\n+        dogma.client().push(projectName, repo1, Revision.HEAD, \"\",\n+                            Change.ofTextUpsert(\"/sample.txt\", \"test\")).join();","path":"server/src/test/java/com/linecorp/centraldogma/server/internal/metadata/ThriftBackwardCompatibilityTest.java","position":67,"original_position":67,"commit_id":"05a96e951d392be0831e0092db63c254066a7a09","original_commit_id":"05a96e951d392be0831e0092db63c254066a7a09","user":{"login":"hyangtack","id":8417787,"avatar_url":"https://avatars1.githubusercontent.com/u/8417787?v=4","gravatar_id":"","url":"https://api.github.com/users/hyangtack","html_url":"https://github.com/hyangtack","followers_url":"https://api.github.com/users/hyangtack/followers","following_url":"https://api.github.com/users/hyangtack/following{/other_user}","gists_url":"https://api.github.com/users/hyangtack/gists{/gist_id}","starred_url":"https://api.github.com/users/hyangtack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyangtack/subscriptions","organizations_url":"https://api.github.com/users/hyangtack/orgs","repos_url":"https://api.github.com/users/hyangtack/repos","events_url":"https://api.github.com/users/hyangtack/events{/privacy}","received_events_url":"https://api.github.com/users/hyangtack/received_events","type":"User","site_admin":false},"body":"Got it. :-)","created_at":"2018-05-15T03:41:22Z","updated_at":"2018-05-15T03:41:22Z","html_url":"https://github.com/line/centraldogma/pull/218#discussion_r188157888","pull_request_url":"https://api.github.com/repos/line/centraldogma/pulls/218","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/line/centraldogma/pulls/comments/188157888"},"html":{"href":"https://github.com/line/centraldogma/pull/218#discussion_r188157888"},"pull_request":{"href":"https://api.github.com/repos/line/centraldogma/pulls/218"}},"in_reply_to_id":188154879},"pull_request":{"url":"https://api.github.com/repos/line/centraldogma/pulls/218","id":188001977,"html_url":"https://github.com/line/centraldogma/pull/218","diff_url":"https://github.com/line/centraldogma/pull/218.diff","patch_url":"https://github.com/line/centraldogma/pull/218.patch","issue_url":"https://api.github.com/repos/line/centraldogma/issues/218","number":218,"state":"open","locked":false,"title":"Update metadata when creating/removing a project/repository by Thrift…","user":{"login":"hyangtack","id":8417787,"avatar_url":"https://avatars1.githubusercontent.com/u/8417787?v=4","gravatar_id":"","url":"https://api.github.com/users/hyangtack","html_url":"https://github.com/hyangtack","followers_url":"https://api.github.com/users/hyangtack/followers","following_url":"https://api.github.com/users/hyangtack/following{/other_user}","gists_url":"https://api.github.com/users/hyangtack/gists{/gist_id}","starred_url":"https://api.github.com/users/hyangtack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyangtack/subscriptions","organizations_url":"https://api.github.com/users/hyangtack/orgs","repos_url":"https://api.github.com/users/hyangtack/repos","events_url":"https://api.github.com/users/hyangtack/events{/privacy}","received_events_url":"https://api.github.com/users/hyangtack/received_events","type":"User","site_admin":false},"body":"… API\r\n\r\nMotivation:\r\nThere's a bug in Central Dogma's Thrift-side code where permission-related metadata is not populated when a Thrift client creates a repository/project.\r\n\r\nModifications:\r\n- Update metadata for the following RPC methods:\r\n  - removeProject\r\n  - unremoveProject\r\n  - createRepository\r\n  - removeRepository\r\n  - unremoveRepository\r\n\r\nResult:\r\n- Closes #210","created_at":"2018-05-15T03:02:54Z","updated_at":"2018-05-15T03:41:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8086d385a9e5b8273c49396764f10f9195212911","assignee":null,"assignees":[],"requested_reviewers":[{"login":"minwoox","id":25103250,"avatar_url":"https://avatars2.githubusercontent.com/u/25103250?v=4","gravatar_id":"","url":"https://api.github.com/users/minwoox","html_url":"https://github.com/minwoox","followers_url":"https://api.github.com/users/minwoox/followers","following_url":"https://api.github.com/users/minwoox/following{/other_user}","gists_url":"https://api.github.com/users/minwoox/gists{/gist_id}","starred_url":"https://api.github.com/users/minwoox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minwoox/subscriptions","organizations_url":"https://api.github.com/users/minwoox/orgs","repos_url":"https://api.github.com/users/minwoox/repos","events_url":"https://api.github.com/users/minwoox/events{/privacy}","received_events_url":"https://api.github.com/users/minwoox/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":678744273,"url":"https://api.github.com/repos/line/centraldogma/labels/defect","name":"defect","color":"b60205","default":false}],"milestone":{"url":"https://api.github.com/repos/line/centraldogma/milestones/10","html_url":"https://github.com/line/centraldogma/milestone/10","labels_url":"https://api.github.com/repos/line/centraldogma/milestones/10/labels","id":3316596,"number":10,"title":"0.25.0","description":null,"creator":{"login":"trustin","id":173918,"avatar_url":"https://avatars0.githubusercontent.com/u/173918?v=4","gravatar_id":"","url":"https://api.github.com/users/trustin","html_url":"https://github.com/trustin","followers_url":"https://api.github.com/users/trustin/followers","following_url":"https://api.github.com/users/trustin/following{/other_user}","gists_url":"https://api.github.com/users/trustin/gists{/gist_id}","starred_url":"https://api.github.com/users/trustin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trustin/subscriptions","organizations_url":"https://api.github.com/users/trustin/orgs","repos_url":"https://api.github.com/users/trustin/repos","events_url":"https://api.github.com/users/trustin/events{/privacy}","received_events_url":"https://api.github.com/users/trustin/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":9,"state":"open","created_at":"2018-05-03T00:52:05Z","updated_at":"2018-05-15T03:03:36Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/line/centraldogma/pulls/218/commits","review_comments_url":"https://api.github.com/repos/line/centraldogma/pulls/218/comments","review_comment_url":"https://api.github.com/repos/line/centraldogma/pulls/comments{/number}","comments_url":"https://api.github.com/repos/line/centraldogma/issues/218/comments","statuses_url":"https://api.github.com/repos/line/centraldogma/statuses/05a96e951d392be0831e0092db63c254066a7a09","head":{"label":"hyangtack:feature/metadata_thrift","ref":"feature/metadata_thrift","sha":"05a96e951d392be0831e0092db63c254066a7a09","user":{"login":"hyangtack","id":8417787,"avatar_url":"https://avatars1.githubusercontent.com/u/8417787?v=4","gravatar_id":"","url":"https://api.github.com/users/hyangtack","html_url":"https://github.com/hyangtack","followers_url":"https://api.github.com/users/hyangtack/followers","following_url":"https://api.github.com/users/hyangtack/following{/other_user}","gists_url":"https://api.github.com/users/hyangtack/gists{/gist_id}","starred_url":"https://api.github.com/users/hyangtack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyangtack/subscriptions","organizations_url":"https://api.github.com/users/hyangtack/orgs","repos_url":"https://api.github.com/users/hyangtack/repos","events_url":"https://api.github.com/users/hyangtack/events{/privacy}","received_events_url":"https://api.github.com/users/hyangtack/received_events","type":"User","site_admin":false},"repo":{"id":105050082,"name":"centraldogma","full_name":"hyangtack/centraldogma","owner":{"login":"hyangtack","id":8417787,"avatar_url":"https://avatars1.githubusercontent.com/u/8417787?v=4","gravatar_id":"","url":"https://api.github.com/users/hyangtack","html_url":"https://github.com/hyangtack","followers_url":"https://api.github.com/users/hyangtack/followers","following_url":"https://api.github.com/users/hyangtack/following{/other_user}","gists_url":"https://api.github.com/users/hyangtack/gists{/gist_id}","starred_url":"https://api.github.com/users/hyangtack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyangtack/subscriptions","organizations_url":"https://api.github.com/users/hyangtack/orgs","repos_url":"https://api.github.com/users/hyangtack/repos","events_url":"https://api.github.com/users/hyangtack/events{/privacy}","received_events_url":"https://api.github.com/users/hyangtack/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hyangtack/centraldogma","description":"Highly-available version-controlled service configuration repository based on Git, ZooKeeper and HTTP/2","fork":true,"url":"https://api.github.com/repos/hyangtack/centraldogma","forks_url":"https://api.github.com/repos/hyangtack/centraldogma/forks","keys_url":"https://api.github.com/repos/hyangtack/centraldogma/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hyangtack/centraldogma/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hyangtack/centraldogma/teams","hooks_url":"https://api.github.com/repos/hyangtack/centraldogma/hooks","issue_events_url":"https://api.github.com/repos/hyangtack/centraldogma/issues/events{/number}","events_url":"https://api.github.com/repos/hyangtack/centraldogma/events","assignees_url":"https://api.github.com/repos/hyangtack/centraldogma/assignees{/user}","branches_url":"https://api.github.com/repos/hyangtack/centraldogma/branches{/branch}","tags_url":"https://api.github.com/repos/hyangtack/centraldogma/tags","blobs_url":"https://api.github.com/repos/hyangtack/centraldogma/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hyangtack/centraldogma/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hyangtack/centraldogma/git/refs{/sha}","trees_url":"https://api.github.com/repos/hyangtack/centraldogma/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hyangtack/centraldogma/statuses/{sha}","languages_url":"https://api.github.com/repos/hyangtack/centraldogma/languages","stargazers_url":"https://api.github.com/repos/hyangtack/centraldogma/stargazers","contributors_url":"https://api.github.com/repos/hyangtack/centraldogma/contributors","subscribers_url":"https://api.github.com/repos/hyangtack/centraldogma/subscribers","subscription_url":"https://api.github.com/repos/hyangtack/centraldogma/subscription","commits_url":"https://api.github.com/repos/hyangtack/centraldogma/commits{/sha}","git_commits_url":"https://api.github.com/repos/hyangtack/centraldogma/git/commits{/sha}","comments_url":"https://api.github.com/repos/hyangtack/centraldogma/comments{/number}","issue_comment_url":"https://api.github.com/repos/hyangtack/centraldogma/issues/comments{/number}","contents_url":"https://api.github.com/repos/hyangtack/centraldogma/contents/{+path}","compare_url":"https://api.github.com/repos/hyangtack/centraldogma/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hyangtack/centraldogma/merges","archive_url":"https://api.github.com/repos/hyangtack/centraldogma/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hyangtack/centraldogma/downloads","issues_url":"https://api.github.com/repos/hyangtack/centraldogma/issues{/number}","pulls_url":"https://api.github.com/repos/hyangtack/centraldogma/pulls{/number}","milestones_url":"https://api.github.com/repos/hyangtack/centraldogma/milestones{/number}","notifications_url":"https://api.github.com/repos/hyangtack/centraldogma/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hyangtack/centraldogma/labels{/name}","releases_url":"https://api.github.com/repos/hyangtack/centraldogma/releases{/id}","deployments_url":"https://api.github.com/repos/hyangtack/centraldogma/deployments","created_at":"2017-09-27T17:47:27Z","updated_at":"2017-09-27T17:47:30Z","pushed_at":"2018-05-15T03:02:28Z","git_url":"git://github.com/hyangtack/centraldogma.git","ssh_url":"git@github.com:hyangtack/centraldogma.git","clone_url":"https://github.com/hyangtack/centraldogma.git","svn_url":"https://github.com/hyangtack/centraldogma","homepage":"https://line.github.io/centraldogma/","size":18477,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"line:master","ref":"master","sha":"f0a07537df2db4e57cd276b78b84416771ea68db","user":{"login":"line","id":13128444,"avatar_url":"https://avatars2.githubusercontent.com/u/13128444?v=4","gravatar_id":"","url":"https://api.github.com/users/line","html_url":"https://github.com/line","followers_url":"https://api.github.com/users/line/followers","following_url":"https://api.github.com/users/line/following{/other_user}","gists_url":"https://api.github.com/users/line/gists{/gist_id}","starred_url":"https://api.github.com/users/line/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/line/subscriptions","organizations_url":"https://api.github.com/users/line/orgs","repos_url":"https://api.github.com/users/line/repos","events_url":"https://api.github.com/users/line/events{/privacy}","received_events_url":"https://api.github.com/users/line/received_events","type":"Organization","site_admin":false},"repo":{"id":101732174,"name":"centraldogma","full_name":"line/centraldogma","owner":{"login":"line","id":13128444,"avatar_url":"https://avatars2.githubusercontent.com/u/13128444?v=4","gravatar_id":"","url":"https://api.github.com/users/line","html_url":"https://github.com/line","followers_url":"https://api.github.com/users/line/followers","following_url":"https://api.github.com/users/line/following{/other_user}","gists_url":"https://api.github.com/users/line/gists{/gist_id}","starred_url":"https://api.github.com/users/line/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/line/subscriptions","organizations_url":"https://api.github.com/users/line/orgs","repos_url":"https://api.github.com/users/line/repos","events_url":"https://api.github.com/users/line/events{/privacy}","received_events_url":"https://api.github.com/users/line/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/line/centraldogma","description":"Highly-available version-controlled service configuration repository based on Git, ZooKeeper and HTTP/2","fork":false,"url":"https://api.github.com/repos/line/centraldogma","forks_url":"https://api.github.com/repos/line/centraldogma/forks","keys_url":"https://api.github.com/repos/line/centraldogma/keys{/key_id}","collaborators_url":"https://api.github.com/repos/line/centraldogma/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/line/centraldogma/teams","hooks_url":"https://api.github.com/repos/line/centraldogma/hooks","issue_events_url":"https://api.github.com/repos/line/centraldogma/issues/events{/number}","events_url":"https://api.github.com/repos/line/centraldogma/events","assignees_url":"https://api.github.com/repos/line/centraldogma/assignees{/user}","branches_url":"https://api.github.com/repos/line/centraldogma/branches{/branch}","tags_url":"https://api.github.com/repos/line/centraldogma/tags","blobs_url":"https://api.github.com/repos/line/centraldogma/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/line/centraldogma/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/line/centraldogma/git/refs{/sha}","trees_url":"https://api.github.com/repos/line/centraldogma/git/trees{/sha}","statuses_url":"https://api.github.com/repos/line/centraldogma/statuses/{sha}","languages_url":"https://api.github.com/repos/line/centraldogma/languages","stargazers_url":"https://api.github.com/repos/line/centraldogma/stargazers","contributors_url":"https://api.github.com/repos/line/centraldogma/contributors","subscribers_url":"https://api.github.com/repos/line/centraldogma/subscribers","subscription_url":"https://api.github.com/repos/line/centraldogma/subscription","commits_url":"https://api.github.com/repos/line/centraldogma/commits{/sha}","git_commits_url":"https://api.github.com/repos/line/centraldogma/git/commits{/sha}","comments_url":"https://api.github.com/repos/line/centraldogma/comments{/number}","issue_comment_url":"https://api.github.com/repos/line/centraldogma/issues/comments{/number}","contents_url":"https://api.github.com/repos/line/centraldogma/contents/{+path}","compare_url":"https://api.github.com/repos/line/centraldogma/compare/{base}...{head}","merges_url":"https://api.github.com/repos/line/centraldogma/merges","archive_url":"https://api.github.com/repos/line/centraldogma/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/line/centraldogma/downloads","issues_url":"https://api.github.com/repos/line/centraldogma/issues{/number}","pulls_url":"https://api.github.com/repos/line/centraldogma/pulls{/number}","milestones_url":"https://api.github.com/repos/line/centraldogma/milestones{/number}","notifications_url":"https://api.github.com/repos/line/centraldogma/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/line/centraldogma/labels{/name}","releases_url":"https://api.github.com/repos/line/centraldogma/releases{/id}","deployments_url":"https://api.github.com/repos/line/centraldogma/deployments","created_at":"2017-08-29T07:23:31Z","updated_at":"2018-05-15T03:24:47Z","pushed_at":"2018-05-15T03:02:55Z","git_url":"git://github.com/line/centraldogma.git","ssh_url":"git@github.com:line/centraldogma.git","clone_url":"https://github.com/line/centraldogma.git","svn_url":"https://github.com/line/centraldogma","homepage":"https://line.github.io/centraldogma/","size":22263,"stargazers_count":159,"watchers_count":159,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":40,"mirror_url":null,"archived":false,"open_issues_count":59,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":40,"open_issues":59,"watchers":159,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/line/centraldogma/pulls/218"},"html":{"href":"https://github.com/line/centraldogma/pull/218"},"issue":{"href":"https://api.github.com/repos/line/centraldogma/issues/218"},"comments":{"href":"https://api.github.com/repos/line/centraldogma/issues/218/comments"},"review_comments":{"href":"https://api.github.com/repos/line/centraldogma/pulls/218/comments"},"review_comment":{"href":"https://api.github.com/repos/line/centraldogma/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/line/centraldogma/pulls/218/commits"},"statuses":{"href":"https://api.github.com/repos/line/centraldogma/statuses/05a96e951d392be0831e0092db63c254066a7a09"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"hyangtack"}}