From reviews-return-76045-apmail-mesos-reviews-archive=mesos.apache.org@mesos.apache.org Thu Apr 12 09:31:54 2018 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 E7D7218078 for ; Thu, 12 Apr 2018 09:31:54 +0000 (UTC) Received: (qmail 98228 invoked by uid 500); 12 Apr 2018 09:31:54 -0000 Delivered-To: apmail-mesos-reviews-archive@mesos.apache.org Received: (qmail 98187 invoked by uid 500); 12 Apr 2018 09:31:54 -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 98165 invoked by uid 99); 12 Apr 2018 09:31:53 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Apr 2018 09:31:53 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 3A8D41A1125; Thu, 12 Apr 2018 09:31:53 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.19 X-Spam-Level: * X-Spam-Status: No, score=1.19 tagged_above=-999 required=6.31 tests=[HEADER_FROM_DIFFERENT_DOMAINS=0.25, HTML_MESSAGE=2, KAM_LAZY_DOMAIN_SECURITY=1, KAM_LOTSOFHASH=0.25, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id tKj4HiB4rrH8; Thu, 12 Apr 2018 09:31:51 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 51A965F478; Thu, 12 Apr 2018 09:31:50 +0000 (UTC) Received: from reviews.apache.org (unknown [10.41.0.12]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 9E92CE00A3; Thu, 12 Apr 2018 09:31:49 +0000 (UTC) Received: from reviews-vm2.apache.org (localhost [IPv6:::1]) by reviews.apache.org (ASF Mail Server at reviews-vm2.apache.org) with ESMTP id 709B0C40389; Thu, 12 Apr 2018 09:31:49 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============1251769791620599930==" MIME-Version: 1.0 Subject: Re: Review Request 66554: Updated Web UI controllers to have one file per controller. From: Armand Grillet To: Benjamin Mahler , Till Toenshoff Cc: Mesos Reviewbot , Mesos Reviewbot Windows , Armand Grillet , mesos Date: Thu, 12 Apr 2018 09:31:49 -0000 Message-ID: <20180412093149.348.35407@reviews-vm2.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Armand Grillet X-ReviewGroup: mesos X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/66554/ X-Sender: Armand Grillet References: <20180411224230.12092.30216@reviews-vm2.apache.org> In-Reply-To: <20180411224230.12092.30216@reviews-vm2.apache.org> X-ReviewBoard-Diff-For: src/webui/app/controllers.js X-ReviewBoard-Diff-For: src/webui/app/home/home-controller.js X-ReviewBoard-Diff-For: src/webui/app/home.html X-ReviewBoard-Diff-For: src/webui/app/offers/offers-controller.js X-ReviewBoard-Diff-For: src/webui/app/frameworks/frameworks-controller.js X-ReviewBoard-Diff-For: src/webui/app/home/home.html X-ReviewBoard-Diff-For: src/webui/app/agents/agent-browse-controller.js X-ReviewBoard-Diff-For: src/webui/app/app.services.js X-ReviewBoard-Diff-For: src/webui/app/maintenance/maintenance-controller.js X-ReviewBoard-Diff-For: src/webui/app/shared/utils.js X-ReviewBoard-Diff-For: src/webui/app/agents/agents-controller.js X-ReviewBoard-Diff-For: src/webui/app/agents/agent-executor-controller.js X-ReviewBoard-Diff-For: src/webui/app/app.js X-ReviewBoard-Diff-For: src/webui/app/app.routes.js X-ReviewBoard-Diff-For: src/webui/app/agents/agent-task-and-executor-rerouter-controller.js X-ReviewBoard-Diff-For: src/webui/app/shared/main-controller.js X-ReviewBoard-Diff-For: src/webui/app/agents/agent-controller.js X-ReviewBoard-Diff-For: src/webui/app/services.js X-ReviewBoard-Diff-For: src/webui/app/roles/roles-controller.js X-ReviewBoard-Diff-For: src/webui/app/agents/agent-framework-controller.js X-ReviewBoard-Diff-For: src/webui/app/frameworks/framework-controller.js Reply-To: Armand Grillet X-ReviewRequest-Repository: mesos --===============1251769791620599930== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On April 11, 2018, 10:42 p.m., Benjamin Mahler wrote: > > src/webui/app/agents/agent-browse-controller.js > > Lines 35 (patched) > > > > > > I noticed these .js files just assume the right js files are already "imported" and there is a globals table in the linter? Is this how it's normally done or do files explicitly import other files? It struck me as tedious that we would have to keep a globals table up-to-date for the linter. In JavaScript, the scope of a variable is its current execution context, i.e. either the enclosing function or global. ESLint offers two options to handle global variables as shown in https://eslint.org/docs/user-guide/configuring#specifying-globals. The issue with the first option, using `/* global var1, var2 */`, is that we need to add that comment in each file using `var1` or `var2`. My wish would have been to add e.g. `/* global updateMetrics, updateState */` in `utils.js` but this is not possible from what I have seen during my tests. The second solution, used in this review request, is a burden but does not oblige us to specify globals in multiple files. A third solution would be to disable the `no-undef` rule but, from my experience, having those error messages can be useful. - Armand ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/66554/#review200941 ----------------------------------------------------------- On April 11, 2018, 3:23 p.m., Armand Grillet wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/66554/ > ----------------------------------------------------------- > > (Updated April 11, 2018, 3:23 p.m.) > > > Review request for mesos, Benjamin Mahler and Till Toenshoff. > > > Bugs: MESOS-8503 > https://issues.apache.org/jira/browse/MESOS-8503 > > > Repository: mesos > > > Description > ------- > > Removes `controllers.js` and adds one file per controller. The shared > functions are now in a file called `utils.js` and the linter has been > updated to know about it. This gives more freedom to add or update > each controller while making the structure of the UI more visible. > > > Diffs > ----- > > src/Makefile.am 9f4b6d369a23af337e2384e52e3e41f4017df38a > src/webui/app/agents/agent-browse-controller.js PRE-CREATION > src/webui/app/agents/agent-controller.js PRE-CREATION > src/webui/app/agents/agent-executor-controller.js PRE-CREATION > src/webui/app/agents/agent-framework-controller.js PRE-CREATION > src/webui/app/agents/agent-task-and-executor-rerouter-controller.js PRE-CREATION > src/webui/app/agents/agents-controller.js PRE-CREATION > src/webui/app/app.js 7de0899c2071c5127881fb725d0dd0246b10f849 > src/webui/app/controllers.js 66a4f2955a88fa44c3e5c717e9ce6b680050cc34 > src/webui/app/frameworks/framework-controller.js PRE-CREATION > src/webui/app/frameworks/frameworks-controller.js PRE-CREATION > src/webui/app/home.html > src/webui/app/home/home-controller.js PRE-CREATION > src/webui/app/maintenance/maintenance-controller.js PRE-CREATION > src/webui/app/offers/offers-controller.js PRE-CREATION > src/webui/app/roles/roles-controller.js PRE-CREATION > src/webui/app/services.js > src/webui/app/shared/main-controller.js PRE-CREATION > src/webui/app/shared/utils.js PRE-CREATION > src/webui/index.html 149d765429dc2211875783129da6c6b101f38ecf > support/.eslintrc.js cd23ddebd2b40f795fa297e6decacada356a01f8 > > > Diff: https://reviews.apache.org/r/66554/diff/1/ > > > Testing > ------- > > ``` > GTEST_FILTER="" make check -j4 > ``` > And tested manually. > > > Thanks, > > Armand Grillet > > --===============1251769791620599930==--