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 6BDBA18552 for ; Thu, 4 Feb 2016 21:34:58 +0000 (UTC) Received: (qmail 77000 invoked by uid 500); 4 Feb 2016 21:34:52 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 76965 invoked by uid 500); 4 Feb 2016 21:34:52 -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 76944 invoked by uid 99); 4 Feb 2016 21:34:51 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Feb 2016 21:34:51 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 25AE329A12C; Thu, 4 Feb 2016 21:34:51 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============4208389764736921849==" MIME-Version: 1.0 Subject: Re: Review Request 43154: AMBARI-14766: Selecting ALL groups does not work under Manage Alert Notifications From: Keta Patel To: Di Li , Alexandr Antonenko , Oleg Nechiporenko , Jonathan Hurley Cc: Keta Patel , Ambari Date: Thu, 04 Feb 2016 21:34:51 -0000 Message-ID: <20160204213451.1670.3106@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Keta Patel X-ReviewGroup: Ambari X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/43154/ X-Sender: Keta Patel References: <20160204192645.1670.71320@reviews.apache.org> In-Reply-To: <20160204192645.1670.71320@reviews.apache.org> Reply-To: Keta Patel X-ReviewRequest-Repository: ambari --===============4208389764736921849== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On Feb. 4, 2016, 7:26 p.m., Jonathan Hurley wrote: > > Ship It! Thank you Jonathan! Could you help me with committing the patch please? - Keta ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/43154/#review117867 ----------------------------------------------------------- On Feb. 4, 2016, 5:49 p.m., Keta Patel wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/43154/ > ----------------------------------------------------------- > > (Updated Feb. 4, 2016, 5:49 p.m.) > > > Review request for Ambari, Alexandr Antonenko, Di Li, Jonathan Hurley, and Oleg Nechiporenko. > > > Bugs: AMBARI-14766 > https://issues.apache.org/jira/browse/AMBARI-14766 > > > Repository: ambari > > > Description > ------- > > Selecting "ALL" groups does not work under Manage Alert Notifications. > > Reproduction Steps:- > 1. Go to Alerts Tab in Ambari GUI > 2. Actions --> Manage Notifications > 3. Create New Alert Notification (Click the custom radio button for groups and select couple of options eg HDFS, PIG) > 4. Save it. > 5. Edit the newly created Alert notification by clicking on the All radio button. Everything gets selected. > 6. Save it > > Expected results: > On Saving the Alert notification, the dialog box "Manage Alert Notification" should show Groups as ALL ( or Show all the values eg HDFS, PIG, MR2). Basically all the values should be selected. > > > Diffs > ----- > > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertTargetResourceProvider.java d28987d > ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertTargetResourceProviderTest.java f80b6f7 > ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js 38e4e75 > > Diff: https://reviews.apache.org/r/43154/diff/ > > > Testing > ------- > > FIX: > ==== > The UI did not show "All" even after selecting "ALL" for Groups in the Edit Alert Target pop-up because the property "selectedAlertGroup" was not set to true even after the selection. This is fixed in the "manageAlertGroupsController" in ambari-web. > > However, this only resolved the UI issue. The alert notifications were still not sent for all services after this change. This was because there was no corresponding update made in the server code for this "ALL" Groups selection for a Target. The DB has a table for AlertTarget (alert_target) and AlertGroup (alert_group). There is a many-to-many mapping between these 2 tables, which is tracked in the combination table alert_group_target. > 1. This combination table was not getting updated for the "ALL" Groups selection. > 2. Also, the Target was not updated as global in the DB. > > The "updateAlertTargets()" in "AlertTargetResourceProvider" is updated with the fix for both these issues. > The global property in Target is set if the ALL selection is made. > And, if the Target is global, all the groups in the DB are upadted with the current Target in the alert_group_target table. > > > TESTS: > ====== > 2 test cases are added to test for Custom and All Group selections. > In case of Custom, the request to the REST API has group IDs passed and the global paramter is false. > The Target after this update must have global as false and should be mapped to only the selected groups passed in the request. > > In case of All, the request to the REST API does not have group IDs passed and the global paramter is true. > The Target after this update must contain global as true and should be mapped to all the groups in the DB. > > > Thanks, > > Keta Patel > > --===============4208389764736921849==--