{"push_id":724941354,"size":12,"distinct_size":5,"ref":"refs/heads/master","head":"7f2c86e43f8d0b28ba1270d0f8a6b6ef583dc1ce","before":"cbb9c9adccfcdffe920911da6a4dd7fff93c8c91","commits":[{"sha":"a4bccbfafea9e77fc24dc3e74633d30de590274a","author":{"email":"aa743a0aaec8f7d7a1f01442503957f4d7a2d634@ostrovsky.org","name":"David Ostrovsky"},"message":"PluginAPI: Don't convert to String in RestApi.get() method\n\nRestApi helper class makes use of ActionContext that makes use of\nRestApi in Gerrit core to route Rest calls. Because ActionContext was\noptimized for invocations from JavaScript plugin hooks, it's converting\nNativeString to String.\n\nThe easiest way to see why this behaviour is needed is to investigate\nthe call graph:\n\n  ActionButton => ActionContext.call() => ActionContext.get() =>\n  RestApiCore.get() => return NativeString.asString() =>\n  alert() called from JavaSrcipt that dump string content.\n\nAn example of this approach is implemented in cookbook-plugin:\n\n1  function onSayHelloProject(c) {\n2    var f = c.textfield();\n3    var t = c.checkbox();\n4    var b = c.button('Say hello', {onclick: function(){\n5      c.call(\n6        {message: f.value, french: t.checked},\n7        function(r) {\n8          c.hide();\n9          window.alert(r);\n10         c.refresh();\n11       });\n12   }});\n\nWithout this implicit conversion the output on the line 9 in the\nexample above would not be: \"Hello dude...\" but \"[Object]\".\n\nWhile this implicit conversion is needed and correct in this use case,\nwhen calling Rest API invocations from ActionButton, it is not wanted\nand wrong when called from normal plugin screen through RestApiPlugin,\nthat makes itself use of the same implementation of ActionContext, to\nroute the RestAPI calls to RestApiCore implementation. The call graph:\n\n  PluginScreen => RestApiPlugin.get() => ActionContext.get() =>\n  RestApiCore.get() => return NativeString.asString() => type error\n\nThat's because in this use case, no implicit conversion should happen,\nas the callback expects NativeString and not String, e.g.:\n\n  private void retrieveGerritVersion(final Screen screen) {\n    new RestApi(\"config\").view(\"server\").view(\"version\")\n    .get(new AsyncCallback<NativeString>() {\n      @Override\n      public void onSuccess(NativeString r) {\n        screen.setPageTitle(\"cookbook index@\" + r.asString());\n      }\n  [...]\n\nConclusion: while correct and expected in one use case, it's wrong and\nleads to breakage in another use case. To rectify it, avoid conversion\nwhen called from RestApiPlugin, as it's never wanted:\n\n  PluginScreen => RestApiPlugin.get() => ActionContext.get2() =>\n  RestApiCore.get() => return NativeString\n\nThe same problem is fixed for the other Rest methods\n{put|post|delete}.\n\nChange-Id: Id6c042478cab797838c1808602712a48039ec062","distinct":false,"url":"https://api.github.com/repos/gerrit-review/gerrit/commits/a4bccbfafea9e77fc24dc3e74633d30de590274a"},{"sha":"34100c4ce436fb6ec8e66161759bc88a409715ab","author":{"email":"b162584c9d065018308db99337b5a9fbc8680008@sonymobile.com","name":"David Pursehouse"},"message":"Merge \"PluginAPI: Don't convert to String in RestApi.get() method\" into stable-2.11","distinct":false,"url":"https://api.github.com/repos/gerrit-review/gerrit/commits/34100c4ce436fb6ec8e66161759bc88a409715ab"},{"sha":"3a593351d6c9a1ee256c69d2d869118c6cbf880d","author":{"email":"7d688f87c5511c10aac8464f862e79ce230402ac@ericsson.com","name":"Hugo Arès"},"message":"Add ssh command to restart online indexer\n\nIn case the online indexer fails, this command allows admin to restart\nit without having to restart Gerrit.\n\nChange-Id: I73435de62c357537d173c5eafd6ad60d3b49fc73","distinct":false,"url":"https://api.github.com/repos/gerrit-review/gerrit/commits/3a593351d6c9a1ee256c69d2d869118c6cbf880d"},{"sha":"47f15bed74d1a26573d90ce5251fc646db9f3036","author":{"email":"7d688f87c5511c10aac8464f862e79ce230402ac@ericsson.com","name":"Hugo Arès"},"message":"Add ssh command to activate the latest index\n\nIn case the online indexer fails, this allows the admins to activate\nthe latest index.\n\nChange-Id: I59ebf2bce02a599b87d0f7771fc806ff64a3ba64","distinct":false,"url":"https://api.github.com/repos/gerrit-review/gerrit/commits/47f15bed74d1a26573d90ce5251fc646db9f3036"},{"sha":"751a0c40e28a84157d01219774b69abd873afa5f","author":{"email":"b162584c9d065018308db99337b5a9fbc8680008@sonymobile.com","name":"David Pursehouse"},"message":"Bind OnlineReindexer.Factory in LuceneIndexModule\n\nThe OnlineReindexer.Factory is only bound in MultiVersionModule.\n\nThis causes some of the acceptance tests to fail with the error\n\"no implementation bound\" because the SingleVersionModule is being\nused, which does not bind OnlineReindexer.Factory.\n\nBind it in LuceneIndexModule instead, so it's used in both cases.\n\nChange-Id: I6df22bb405621485e5dcba2a5d0e0a14de372f8a","distinct":false,"url":"https://api.github.com/repos/gerrit-review/gerrit/commits/751a0c40e28a84157d01219774b69abd873afa5f"},{"sha":"54871d5ab17219018271fbe900661bac1c8ca446","author":{"email":"b162584c9d065018308db99337b5a9fbc8680008@sonymobile.com","name":"David Pursehouse"},"message":"Release notes for Gerrit 2.11.2\n\nChange-Id: I36d4f06a047992421b8eac1e937945b28439872c","distinct":false,"url":"https://api.github.com/repos/gerrit-review/gerrit/commits/54871d5ab17219018271fbe900661bac1c8ca446"},{"sha":"84694cba7d71f03c16bf8f99591eaf9e0be7f210","author":{"email":"b162584c9d065018308db99337b5a9fbc8680008@sonymobile.com","name":"David Pursehouse"},"message":"Set version to 2.11.2 in dev-plugins.txt\n\nChange-Id: If4a6fed4ab665ec23c4c79e9777db446d3e5d0df","distinct":false,"url":"https://api.github.com/repos/gerrit-review/gerrit/commits/84694cba7d71f03c16bf8f99591eaf9e0be7f210"},{"sha":"03bc9996c76e578d688cc23d581337448620f7c1","author":{"email":"b162584c9d065018308db99337b5a9fbc8680008@sonymobile.com","name":"David Pursehouse"},"message":"Merge branch 'stable-2.11'\n\n* stable-2.11:\n  Set version to 2.11.2 in dev-plugins.txt\n  Release notes for Gerrit 2.11.2\n  Bind OnlineReindexer.Factory in LuceneIndexModule\n  Add ssh command to activate the latest index\n  Add ssh command to restart online indexer\n  PluginAPI: Don't convert to String in RestApi.get() method\n\nChange-Id: I907e665b20568fce8563bf9e22a7a0ffc96fc847","distinct":true,"url":"https://api.github.com/repos/gerrit-review/gerrit/commits/03bc9996c76e578d688cc23d581337448620f7c1"},{"sha":"08726a895c1466c221fc86b0fdaba45e1c880515","author":{"email":"b162584c9d065018308db99337b5a9fbc8680008@sonymobile.com","name":"David Pursehouse"},"message":"Update release documentation to update links in new homepage\n\nInstead of updating the Google Code project, we should now update\nthe links on the homepage git.\n\nChange-Id: I71343deb9aabc53f2af86d77eb7b10f0e7673105","distinct":true,"url":"https://api.github.com/repos/gerrit-review/gerrit/commits/08726a895c1466c221fc86b0fdaba45e1c880515"},{"sha":"91adc4fab9f64f33a618736cf888a6665fb3da91","author":{"email":"b162584c9d065018308db99337b5a9fbc8680008@sonymobile.com","name":"David Pursehouse"},"message":"CreateChange: trim leading/trailing whitespace on input topic\n\nChange-Id: Ib3f164b2964cba262062d9efb157a7f1fb57d3ce","distinct":true,"url":"https://api.github.com/repos/gerrit-review/gerrit/commits/91adc4fab9f64f33a618736cf888a6665fb3da91"},{"sha":"9f910122bb5871ef5bb0c359e46cf088f9a423a2","author":{"email":"b162584c9d065018308db99337b5a9fbc8680008@sonymobile.com","name":"David Pursehouse"},"message":"Allow to set topic on new change created from UI\n\nChange-Id: I8b6a8728651174294d204d876f4620725ff35d51","distinct":true,"url":"https://api.github.com/repos/gerrit-review/gerrit/commits/9f910122bb5871ef5bb0c359e46cf088f9a423a2"},{"sha":"7f2c86e43f8d0b28ba1270d0f8a6b6ef583dc1ce","author":{"email":"b162584c9d065018308db99337b5a9fbc8680008@sonymobile.com","name":"David Pursehouse"},"message":"Set topic from base change when creating follow-up change\n\nChange-Id: I7e72856ca1fb12f1777d0c2de0b00c0da7722f7f","distinct":true,"url":"https://api.github.com/repos/gerrit-review/gerrit/commits/7f2c86e43f8d0b28ba1270d0f8a6b6ef583dc1ce"}]}