Return-Path: X-Original-To: apmail-ambari-dev-archive@www.apache.org Delivered-To: apmail-ambari-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C794017917 for ; Mon, 27 Oct 2014 10:15:15 +0000 (UTC) Received: (qmail 80809 invoked by uid 500); 27 Oct 2014 10:15:15 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 80778 invoked by uid 500); 27 Oct 2014 10:15:15 -0000 Mailing-List: contact dev-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list dev@ambari.apache.org Received: (qmail 80758 invoked by uid 99); 27 Oct 2014 10:15:15 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Oct 2014 10:15:15 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id AD42B1D3552; Mon, 27 Oct 2014 10:15:19 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============4581678705647947391==" MIME-Version: 1.0 Subject: Re: Review Request 27194: Views: on deploy, validate view.xml From: "Tom Beerbower" To: "Nate Cole" , "Jonathan Hurley" Cc: "Ambari" , "Tom Beerbower" Date: Mon, 27 Oct 2014 10:15:19 -0000 Message-ID: <20141027101519.7143.70669@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org Auto-Submitted: auto-generated Sender: "Tom Beerbower" X-ReviewGroup: Ambari X-ReviewRequest-URL: https://reviews.apache.org/r/27194/ X-Sender: "Tom Beerbower" References: <20141027025212.7138.12913@reviews.apache.org> In-Reply-To: <20141027025212.7138.12913@reviews.apache.org> Reply-To: "Tom Beerbower" X-ReviewRequest-Repository: ambari --===============4581678705647947391== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On Oct. 27, 2014, 2:52 a.m., Jonathan Hurley wrote: > > ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java, line 535 > > > > > > Just a nit; I like to have boolean methods usually named with "is", such as isViewValidationEnabled() I agree. I thought I was following the convention for the class (i.e. boolean csrfProtectionEnabled()), but looking now I see that there really isn't a convention. Your name is better. > On Oct. 27, 2014, 2:52 a.m., Jonathan Hurley wrote: > > ambari-server/src/main/java/org/apache/ambari/server/view/ViewArchiveUtility.java, line 147 > > > > > > Should the exception here be something other than a RuntimeException? Initially, I thought that IllegalStateException seemed wrong since calling this method at this time is a legal action; it's just the data that's invalid. > > > > But then I though that maybe this should be checked so that callers can decide how they want to handle the invalid view XML. Thoughts? > > > > I think it's good for now; no need to hold up the review on it, but it feels like a checked exception might be a better fit here. Yes, I agree on this also. - Tom ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/27194/#review58583 ----------------------------------------------------------- On Oct. 27, 2014, 12:42 a.m., Tom Beerbower wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/27194/ > ----------------------------------------------------------- > > (Updated Oct. 27, 2014, 12:42 a.m.) > > > Review request for Ambari, Jonathan Hurley and Nate Cole. > > > Bugs: AMBARI-7964 > https://issues.apache.org/jira/browse/AMBARI-7964 > > > Repository: ambari > > > Description > ------- > > On view deploy: perform validation of view.xml in view package and if the view.xml does not validate, provide a specific error to the log. > Validation can be an optional operation that can be enabled/disabled in the ambari server (maybe just a prop in ambari.properties view.validation.enabled=true/false)? > > > Diffs > ----- > > ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java 535e569 > ambari-server/src/main/java/org/apache/ambari/server/view/ViewArchiveUtility.java f5f2732 > ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java c4da8b4 > ambari-server/src/test/java/org/apache/ambari/server/configuration/ConfigurationTest.java 12b5333 > ambari-server/src/test/java/org/apache/ambari/server/view/ViewArchiveUtilityTest.java PRE-CREATION > ambari-server/src/test/java/org/apache/ambari/server/view/ViewExtractorTest.java 1b71c37 > ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java 7c0cade > ambari-server/src/test/resources/test_view.xml PRE-CREATION > > Diff: https://reviews.apache.org/r/27194/diff/ > > > Testing > ------- > > Manual testing. New unit tests added. All existing pass ... > > > Results : > > Tests run: 2202, Failures: 0, Errors: 0, Skipped: 14 > > ... > > > [INFO] ------------------------------------------------------------------------ > [INFO] BUILD SUCCESS > [INFO] ------------------------------------------------------------------------ > [INFO] Total time: 36:45.663s > [INFO] Finished at: Sat Oct 25 08:06:24 EDT 2014 > [INFO] Final Memory: 41M/344M > [INFO] ------------------------------------------------------------------------ > > > Thanks, > > Tom Beerbower > > --===============4581678705647947391==--