Граф коммитов

61 Коммитов

Автор SHA1 Сообщение Дата
Cameron Dawson 889f23a68c Bug 1611334 - Add notification to Test-View to use Push Health 2020-01-24 09:15:45 -08:00
Cameron Dawson 3ba10ee22d
Bug 1600626 - Add progress status to Push Health (#5755) 2019-12-16 13:36:58 -08:00
Cameron Dawson 256c244439 Disable per file: eslint jsx-a11y/no-static-element-interactions 2019-10-01 11:53:47 -07:00
Cameron Dawson b774521fb8 Disable per file: eslint jsx-a11y/no-noninteractive-element-interactions 2019-10-01 11:53:47 -07:00
Armen Zambrano G 31990b982d Few linting exceptions 2019-08-21 21:00:59 -04:00
Armen Zambrano G 9bf2dc7d91 Fix linting issues 2019-08-06 13:15:33 -04:00
dependabot-preview[bot] dc3ef95a5b Bump graphene from 2.1.6 to 2.1.7 (#5162)
* Bump graphene from 2.1.6 to 2.1.7

Bumps [graphene](https://github.com/graphql-python/graphene) from 2.1.6 to 2.1.7.
- [Release notes](https://github.com/graphql-python/graphene/releases)
- [Commits](https://github.com/graphql-python/graphene/compare/v2.1.6...v2.1.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* updates
2019-07-24 12:54:07 -07:00
Sarah Clements 19666a9d54 lint fixes 2019-06-21 17:22:13 -07:00
Cameron Dawson e5fb5d61af
Fix titles for FontAwesomeIcon (#4838) 2019-04-09 10:24:47 -07:00
Cameron Dawson 0c7be612de Bug 1531243 - Fix ESLint jsx--a11y/label-has-associated-control 2019-03-06 10:32:26 -08:00
Cameron Dawson 7619710074 Bug 1513581 - Fix ESLint react/no-access-state-in-setstate 2019-02-27 09:40:35 -08:00
Ed Morley f0abef42c0
Bug 1506805 - Upgrade to modern Font Awesome (Part 1) (#4556)
* Convert Perfherder to Font Awesome v5
* Convert legacy react-fontawesome to the new version
* Convert logviewer to react-fontawesome
2019-02-05 08:44:49 +00:00
Cameron Dawson c32f673bfc
Switch front-end to use /push/ endpoint (#4514) 2019-01-29 09:33:22 -08:00
Cameron Dawson 7a48bbc575
Bug 1493833 - Fix ESLint errors with import/no-cycle (#4451) 2019-01-14 08:30:51 -08:00
Ed Morley 3c02823ea8 Switch to new style react-hot-loader import usage
See:
https://github.com/gaearon/react-hot-loader#getting-started
gaearon/react-hot-loader#1122
2019-01-02 13:48:48 +00:00
Cameron Dawson 2885a9a1e3
Bug 1480166 - Use class fields to avoid bind() calls in the rest (#4370) 2018-12-13 10:31:30 -08:00
Ed Morley 65b7f4ab45
Bug 1507172 - Use Prettier for formatting JS/JSX (#4276)
Since it's more reliable (and strict) at code formatting than ESLint.
We use it via an ESLint plugin, and so disable the style-related AirBnB
preset rules, leaving the AirBnB guide to handle only correctness and
best practices rules.

It's highly encouraged to use an IDE integration or Git commit hook
to run Prettier (or `yarn lint --fix`) automatically. See:
* https://prettier.io/docs/en/editors.html
* https://prettier.io/docs/en/precommit.html

We may consider enabling a git commit hook out of the box (using eg
Husky) in the future, however they have previously been known to
interfere with partial-staging workflows, so would need to test the
fixes they have made for them thoroughly first.

In future PRs we may also want to start formatting JSON/CSS/Markdown
using Prettier too.
2018-11-16 08:28:34 +00:00
Ed Morley 4db0cfa973
Bug 1507406 - ESLint: Enforce more strict import style (#4279)
Imports must now be grouped like so (with newlines between each):

```
// "external" modules
import _ from 'lodash';
import chalk from 'chalk';

// modules from a "parent" directory
import foo from '../foo';
import qux from '../../foo/qux';

// "sibling" modules from the same or a sibling's directory
import bar from './bar';
import baz from './bar/baz';
```

The `import/order` rule has auto-fix support, so any errors can be
resolved using `yarn lint --fix`.

See:
https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md
2018-11-16 08:07:49 +00:00
Ed Morley 69501e0de8 Bug 1505758 - Enable ESLint 'react/no-multi-comp'
https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md
2018-11-08 16:27:37 +00:00
Ed Morley ec87836e3b Bug 1505758 - Fix/enable ESLint 'prefer-destructuring'
https://eslint.org/docs/rules/prefer-destructuring
2018-11-08 16:27:37 +00:00
Ed Morley 107b67bd69 Bug 1505758 - Fix/enable ESLint 'object-shorthand'
https://eslint.org/docs/rules/object-shorthand
2018-11-08 16:27:37 +00:00
Ed Morley dd0165c0e0 Bug 1505758 - Fix/enable ESLint 'no-restricted-globals'
https://eslint.org/docs/rules/no-restricted-globals
2018-11-08 16:27:37 +00:00
Ed Morley 714e8260c5 Bug 1505758 - Fix/enable ESLint 'no-nested-ternary'
https://eslint.org/docs/rules/no-nested-ternary
2018-11-08 16:27:37 +00:00
Ed Morley 7af125f626 Bug 1505758 - Fix/enable ESLint 'prefer-template'
https://eslint.org/docs/rules/prefer-template
2018-11-08 16:27:37 +00:00
Ed Morley 565ae4c13e
Bug 1364894 - Upgrade from Neutrino 4 to 9 (#4216)
Neutrino controls our frontend linting, transpilation, source-maps,
testing, dev-server and optimisation of production builds.

Highlights of the upgrade are:

* Major version updates to the individual tools within (such as webpack,
  Babel and ESLint), significantly improving performance, fixing
  transpilation/minification correctness bugs, adding support for newer
  ECMAScript features, and increasing linter coverage.
* Hot reloading in the dev server now works for all entry-points and not
  just the jobs view, shortening the feedback cycle.
* Reduced bundle size due to webpack 4's tree shaking, scope hoisting,
  automatic shared/vendor code chunk splitting (no need for the manually
  maintained 'vendor' list).
* CSS is now extracted out of JS, which improves performance, reduces
  bundle size and prevents the initial white flash of un-styled content.
* Support for dynamic imports/code splitting (needed for bug 1502192).
* Support for Jest via a new Jest preset (unblocks bug 1364045).
* Support for public class field declarations (unblocks bug 1480166).
* Improved source-maps (increases the quality of production exception
  trace-backs and fixes several debugger breakpoint bugs).
* Reduced amount of custom configuration required for our fairly complex
  frontend needs, reducing maintenance burden and allowing for easier
  future Neutrino upgrades.

In addition this PR:

* Fixes the WhiteNoise `immutable_file_test()` regex, so that it now
  correctly enables browser caching of images, fonts and source maps.
* Enables webpack-dev-server's overlay feature, which displays any
  compilation errors in the browser, saving having to switch back
  to the console (this can be enabled for warnings too if desired).
* Enables webpack-dev-server's automatic browser-opening feature,
  which saves having to manually navigate to `localhost:5000` after
  running `yarn start`.
* Switches Karma tests to run Firefox in headless mode, reducing the
  workflow disruption when running `yarn test`.
* Uses the new webpack `performance` option to enable maximum asset
  file size thresholds, to help prevent bundle-size regressions.
* Rewrites the `package.json` script commands so that they now work
  correctly on Windows, even when setting environment variables.

Performance comparison:

* Local `yarn build`:
  - Cached: 2m34s -> 23s
  - Uncached: 2m34s -> 58s
* Local `yarn start`:
  - Cached: 34.5s -> 13.6s
  - Uncached: 34.5s -> 31.3s
* Local `yarn test`
  - Cached: 61.5s -> 19.8s
  - Uncached: 61.5s -> 22.0s
* Local `yarn lint`
  - Cached: 3.8s -> 1.8s
  - Uncached: 13.7s -> 13.4s
* Travis end-to-end time:
  9 minutes -> 6 minutes
* Heroku deploy end-to-end time:
  14 minutes -> 9 minutes
2018-11-02 18:48:28 +00:00
Cameron Dawson ad7e0a7da4 Bug 1451171 - Transition away from unsafe lifecycle functions 2018-10-25 14:50:42 -07:00
Cameron Dawson 1ffcd036c9
Bug 1493881 - Fix test-view bug links (#4080) 2018-10-01 09:11:43 -07:00
Ed Morley 05a421c0e2
Bug 1364894 - Fix ESLint issues found by Neutrino 9 (#4056)
This pre-emptively fixes the issues found by the newer ESLint and
ESLint plugins that come with Neutrino 9 - in order to reduce the
size of the Neutrino 9 PR.
2018-09-24 17:59:14 +01:00
Cameron Dawson 46568ce088 Move the constants.js file to /helpers 2018-09-21 13:09:46 -07:00
Ed Morley 94100a23f0 Bug 1468658 - Remove redundant eslint-disable-line
Since the rule is disabled entirely in `lint.js` for now.
2018-06-13 22:43:15 -07:00
Ed Morley 3e31201ae8 Bug 1468658 - Fix/enable eslint 'comma-dangle'
https://eslint.org/docs/rules/comma-dangle

Changes performed by `--fix`.
2018-06-13 22:43:15 -07:00
Ed Morley fe4f377d31 Bug 1468658 - Fix/enable eslint 'quotes'
https://eslint.org/docs/rules/quotes

Changes performed by `--fix`.
2018-06-13 22:43:15 -07:00
Cameron Dawson eddbc1c8a7
Bug 1450039 - Convert Models for accessing API data to Classes (#3568) 2018-05-25 10:32:21 -07:00
Ed Morley 55654a1195
Bug 1363722 - Allow login to work in all development workflows (#3534)
Previously it was not possible to test features that required an
authenticated user when:
* using `yarn start` with Vagrant (bug 1363722), which meant slower
  watch builds
* pointing the UI at the prod/stage API (bug 1317752), which was
  extremely limiting

Now login works in all environments, since the frontend no longer uses a
URL prefix, but instead webpack-dev-server proxies non-webpack URLs to
the chosen `BACKEND_DOMAIN` - avoiding cross-domain issues. Cookies are
rewritten to remove any `secure` directive (which is set on production),
so that they can still be read from HTTP localhost. The `Referer` has to
also be changed to stop Django's CSRF checks from rejecting request.

The slower "build into `dist` and watch" mode is therefore no longer
necessary, so `yarn start:local` instead invokes webpack-dev-server just
like `yarn start` - and the `local-watch.js` workaround has been
removed.

Support for the "publish to GitHub with hardcoded `SERVICE_DOMAIN`"
workflow has been dropped, since it was already rarely used and there is
no way to make it support login.

The API domain environment variable was renamed to `BACKEND_DOMAIN` to
avoid potential confusion given it no longer behaves the same as
`SERVICE_DOMAIN` used to.

NB: For full stack Vagrant workflows users must now connect to port
*5000* on localhost, not 8000.
2018-05-10 17:58:04 +01:00
Cameron Dawson c7b050942d
Bug 1443129 - Add prop types to all JSX components (#3379)
* enable react/prop-types eslint rule
While enabling this, I set all the PropTypes as ``isRequired`` then ran the app
and wherever I hit issues where the value was undefined, then I removed ``isRequired``.

* Enable react/require-default-props eslint rule
In some cases "null" was the best default.  I think this is OK.  But having empty arrays
for others meant less checking in the actual code, so bonus!  :)
2018-04-04 10:23:48 -07:00
Cameron Dawson 0b5fec254a
Bug 1449240 - Convert Angular values.js to import-able constants (#3378)
After looking at these, I think I want to go back to using "th" prefix and "ph" prefix.
It is a nice way to see right off the bat that these are constants that are established
by our code and not some external library.  So converting ``platformMap`` back to
``thPlatformMap``.  It also makes for less code/blame churn as we move to imported
constants.

* Move thOptionOrder to constants.js
* Move thFailureResults to constants.js
* Move thRepoGroupOrder to constants.js
* Move thFavIcons to constants.js
* Move phCompareDefaultOriginalRepo to constants.js
* Move phCompareDefaultNewRepo to constants.js
* Move thDefaultRepo to constants.js
* Move thTitleSuffixLimit to constants.js
* Move phTimeRanges to constants.js
* Move thDateFormat to constants.js
* Move phDefaultTimeRangeValue to constants.js
* Move phTimeRangeValues to constants.js
* Move phBlockers to constants.js
* Move phDefaultFramework to constants.js
* Move phAlertSummaryStatusMap to constants.js
* Move phAlertSummaryIssueTrackersMap to constants.js
* Move phAlertStatusMap to constants.js
* Move thJobNavSelectors to constants.js
* Move thPerformanceBranches to constants.js
* Move phDashboardValues to dashboard.js
* Move phCompareBaseLineDefaultTimeRange to constants.js
* Move thPinboardCountError to constants.js
* Remove now-unused values.js
* Move thResultStatusFilters to constants.js
* Move thEvents to constants.js
* Move thAggregateIds to a aggregateIdHelper.js
* Move thReftestStatus to jobHelper.js
* Remove now-unused provider.js
2018-04-04 10:01:17 -07:00
Cameron Dawson cca48d14df
Bug 1444134 - Consolidate references to SERVICE_DOMAIN (#3319)
* Don't use SERVICE_DOMAIN for references to the front-end code
* Change getRootUrl to getApiUrl to better represent what it is for
* Convert other usages of SERVICE_DOMAIN to getApiUrl
* Convert usages of SERVICE_DOMAIN to getProjectUrl
* Convert uses of SERVICE_DOMAIN to getServiceUrl
* Convert tests to use ``urlHelper``
2018-03-08 15:48:31 -08:00
Cameron Dawson b221b8ca1e Bug 1437818 - Enable ESLint rule react/no-array-index-key 2018-03-08 14:14:43 -08:00
Ed Morley b152fc04f8 Bug 1443698 - Fix/enable eslint 'no-use-before-define'
https://eslint.org/docs/rules/no-use-before-define

Three files have been excluded from this rule entirely, since they
would require significant changes that might as well wait until they
are rewritten in React. It's likely these files may also need to be
excluded from future `var` to `let`/`const` conversions as a result.

From the AirBnb style guide GitHub issue comments:
> Some enjoy using hoisting to define helper methods at the bottom of
> the file. This guide discourages relying on hoisting; instead
> suggesting importing the helpers from another file when possible.
2018-03-07 19:26:18 +00:00
Ed Morley c26056dc23 Bug 1443698 - Fix/enable eslint 'prefer-const'
https://eslint.org/docs/rules/prefer-const

Changes performed by `--fix`.
2018-03-07 19:26:18 +00:00
Ed Morley 5f9abbf340 Bug 1443698 - Fix/enable eslint 'no-multi-assign'
https://eslint.org/docs/rules/no-multi-assign
2018-03-07 19:26:18 +00:00
Ed Morley 1053a8d5ee Bug 1442485 - Fix/enable eslint 'object-property-newline'
https://eslint.org/docs/rules/object-property-newline

Not a React-specific rule, but the react-codemod rulesets were
constantly trying to alter it when making changes in other files,
so would rather fix it now.
2018-03-02 21:28:44 +00:00
Ed Morley e1e8199785 Bug 1442485 - Fix/enable eslint 'react/jsx-max-props-per-line'
https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-max-props-per-line.md

Changes made via eslint's `--fix` feature.
2018-03-02 21:28:44 +00:00
Ed Morley 3964dac1b6 Bug 1442485 - Fix/enable eslint 'react/jsx-first-prop-new-line'
https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-first-prop-new-line.md

Changes made via eslint's `--fix` feature.
2018-03-02 21:28:44 +00:00
Ed Morley f268d9e721 Bug 1442485 - Fix/enable eslint 'react/jsx-indent{,-props}'
https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent.md
https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent-props.md

Changes made via eslint's `--fix` feature. I also included fixes to
the JS content within JSX files (by enabling the generic `indent`
rule locally when running `--fix`), to reduce the churn that will be
seen in these files when we fix JS indentation for the whole codebase.
2018-03-02 21:28:44 +00:00
Ed Morley d0fd089073 Bug 1442485 - Fix/enable eslint 'react/prefer-stateless-function'
https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-stateless-function.md
2018-03-02 21:28:44 +00:00
Ed Morley bd870cf8ce
Bug 1441493 - Use rel="noopener" for all target != null links (#3275)
This helps prevent:
https://www.owasp.org/index.php/Reverse_Tabnabbing

We're not also using `noreferrer`, since most browsers now support
`noopener` (https://caniuse.com/#search=noopener) and the link targets
are all Mozilla properties where the referrer may be useful.

The auth.js `window.open()` has not been changed, since the login
callback makes use of `window.opener`.
2018-02-27 19:17:42 +00:00
Ed Morley 3327985173 Bug 1432840 - Fix/enable eslint 'array-bracket-spacing'
https://eslint.org/docs/rules/array-bracket-spacing
2018-01-25 19:15:57 +00:00
Ed Morley 820c6cf47c Bug 1432840 - Fix/enable eslint 'no-extra-semi'
https://eslint.org/docs/rules/no-extra-semi
2018-01-25 19:15:57 +00:00
Ed Morley 2bd61a8da5 Bug 1432840 - Fix/enable eslint 'import/first'
https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/first.md
2018-01-25 19:15:57 +00:00