From reviews-return-32469-apmail-mesos-reviews-archive=mesos.apache.org@mesos.apache.org Wed Apr 27 15:30:01 2016 Return-Path: X-Original-To: apmail-mesos-reviews-archive@minotaur.apache.org Delivered-To: apmail-mesos-reviews-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 75BC119BC5 for ; Wed, 27 Apr 2016 15:30:01 +0000 (UTC) Received: (qmail 3946 invoked by uid 500); 27 Apr 2016 15:30:01 -0000 Delivered-To: apmail-mesos-reviews-archive@mesos.apache.org Received: (qmail 3919 invoked by uid 500); 27 Apr 2016 15:30:01 -0000 Mailing-List: contact reviews-help@mesos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: reviews@mesos.apache.org Delivered-To: mailing list reviews@mesos.apache.org Received: (qmail 3892 invoked by uid 99); 27 Apr 2016 15:30:01 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Apr 2016 15:30:01 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 05FFB2B2F5A; Wed, 27 Apr 2016 15:29:56 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============3034314203169392980==" MIME-Version: 1.0 Subject: Re: Review Request 46319: Added authorization to agents' `/monitor/statistics` endpoints. From: Alexander Rukletsov To: Adam B , Jan Schlicht , Alexander Rojas Cc: Benjamin Bannier , Alexander Rukletsov , mesos Date: Wed, 27 Apr 2016 15:29:56 -0000 Message-ID: <20160427152956.26196.37908@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Alexander Rukletsov X-ReviewGroup: mesos X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/46319/ X-Sender: Alexander Rukletsov X-ReviewBoard-ShipIt: 1 References: <20160427152801.26230.76029@reviews.apache.org> In-Reply-To: <20160427152801.26230.76029@reviews.apache.org> X-ReviewBoard-Diff-For: src/tests/slave_authorization_tests.cpp Reply-To: Alexander Rukletsov X-ReviewRequest-Repository: mesos --===============3034314203169392980== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/46319/#review130770 ----------------------------------------------------------- Fix it, then Ship it! I'll fix the remamining issues and commit it for you shortly. src/slave/http.cpp (line 627) Indentation. src/slave/http.cpp (line 628) Indentation. src/slave/http.cpp (line 637) Indentation. src/tests/slave_authorization_tests.cpp (lines 182 - 183) Wrap differently to avoid jaggeddness. src/tests/slave_authorization_tests.cpp (line 197) Let's wrap `Return(true)` onto the next line for readability. It's much faster to grasp what is going on when each action is on a separate line. src/tests/slave_authorization_tests.cpp (line 199) You can omit `process::` prefix. src/tests/slave_authorization_tests.cpp (line 207) You use it once, hence it doesn't really make sense to introduce a variable. src/tests/slave_authorization_tests.cpp (line 234) Ditto. src/tests/slave_authorization_tests.cpp (line 245) Looks like the first "for" is redundant. src/tests/slave_authorization_tests.cpp (lines 253 - 255) Any reason why you don't just use `StartSlave`? It would also fit one line then. src/tests/slave_authorization_tests.cpp (line 257) Ditto. src/tests/slave_authorization_tests.cpp (line 268) "The tests are parameterized by the endpoint being queried." Add a `TODO` about also considering parameterizing the authz action, e.g. `authorization::GET_ENDPOINT_WITH_PATH` src/tests/slave_authorization_tests.cpp (lines 268 - 272) Let's pull it up closer to `SlaveEndpointTest` fixture. - Alexander Rukletsov On April 27, 2016, 3:28 p.m., Benjamin Bannier wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/46319/ > ----------------------------------------------------------- > > (Updated April 27, 2016, 3:28 p.m.) > > > Review request for mesos, Adam B, Alexander Rojas, and Jan Schlicht. > > > Bugs: MESOS-5164 > https://issues.apache.org/jira/browse/MESOS-5164 > > > Repository: mesos > > > Description > ------- > > Added authorization to agents' `/monitor/statistics` endpoints. > > > Diffs > ----- > > src/slave/http.cpp 537736d1fe42e8150bad91326299ef9a17041a8e > src/slave/slave.hpp 57b18882e30e44dcc40449b0e3be8ee970c45bc8 > src/tests/slave_authorization_tests.cpp PRE-CREATION > > Diff: https://reviews.apache.org/r/46319/diff/ > > > Testing > ------- > > make check (OS X, clang w/o optimization) > `GTEST_FILTER="*SlaveEndpointTest*:*SlaveAuthorizationTest*" ./bin/mesos-tests.sh --gtest_repeat=100 --gtest_break_on_failure` > > > Thanks, > > Benjamin Bannier > > --===============3034314203169392980==--