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

1536 Коммитов

Автор SHA1 Сообщение Дата
Cameron Dawson 5e8377a3ff
Bug 1364045 - Introduce Jest unit tests (#4369) 2018-12-13 08:24:52 -08:00
Simon Sapin dbfc2afcbf Fix import of force-pushes from github (#4284)
When `git push -f` is used, the "base" commit of the github push event
is whatever was previously in that branch.
That commit is likely not part of the history of the new branch,
so using the "List commits" API will not allow to find it
as a starting point.
Instead, if the API did not force pagination, we’d get the entire
repository history!

Using the "Compare two commits" API instead lets GitHub’s server
figure out which commits reachable from the new branch
that were not before, which is exactly the set of commits we need
to be "part of a push".
2018-11-16 12:36:05 -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
Cameron Dawson a9c2dedf0a
Bug 1506424 - Fix logic to unselect job by clicking open areas (#4269) 2018-11-14 08:27:46 -08:00
ionutgoldan 9168eba8e8 Bug 1431085 - Increase max length of PerformanceSignature.extra_options (#4238) 2018-11-14 09:22:11 +00:00
Ed Morley 70e15b8334 Bug 1505758 - Fix/enable ESLint 'prefer-arrow-callback'
https://eslint.org/docs/rules/prefer-arrow-callback
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 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 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
Florin Strugariu 9b01377881 Bug 1470473 - Add more Perfherder Selenium tests (#4195) 2018-10-31 19:44:31 +00:00
Sarah Clements f1aab1596b
Bug 1495429 - change IFV table sorting (#4178)
Remove API pagination and serve all results to client so table
sorting is completely client-side.
2018-10-29 12:18:37 -07:00
Ed Morley 597bb4146e
Bug 1502306 - Make it easier to run Selenium tests (#4194)
* Enables the display of skipped test/expected fail reasons, in
  the pytest summary.
* Skips the Selenium tests with a clear reason message, unless the
  built UI is found (preventing the annoying/confusing test timeouts).
* Removes the disabling of the `pytest-html` and `pytest-metadata`
  plugins, since they are required when passing the `--html` option
  to generate an HTML report.
* Updates the docs to mention `yarn build` and `--html`.
2018-10-29 17:07:38 +00:00
Ed Morley 974c9c2c5f
Bug 1502288 - Update flake8, pycodestyle and pyflakes (#4192)
* Switches from the `ignore` setting to the new `extend_ignore`, which
  doesn't overwrite the default ignore list, meaning we no longer have
  to duplicate it ourselves.
* Remove the rarely used `[pycodestyle]` config section, since it's
  only used when using tools like autopep8, which should really learn
  to use the `[flake8]` section themselves.
* Enables the previously ignored F403 and F405 rules, adding `# noqa`
  entries to instances that we do not wish to fix.
* Adjust max line length down to 100, since we already disable the
  `E501: line too long` rule, making the length mostly redundant
  other than in IDEs, where it's probably good to show a warning if
  exceeding 100 characters.
* Fixes:
```
treeherder/intermittents_commenter/commenter.py:202:10:
  W605 invalid escape sequence '\['
treeherder/intermittents_commenter/commenter.py:202:24:
  W605 invalid escape sequence '\]'
treeherder/webapp/graphql/schema.py:7:1:
  F403 'from treeherder.model.models import *' used; unable to detect undefined names
```

Closes #4177.
Refs #3425.
Refs #3565.
2018-10-29 09:44:34 +00:00
Cameron Dawson 3c07a53692
Bug 1450041 - Convert angular events to CustomEvent (#4166)
* Convert event selectNextTab
* Convert event saveClassification
* Convert event jobsClassified
* Convert event deleteClassification
* Convert event openLogviewer
* Convert event autoclassifyIgnore
2018-10-19 17:13:01 -07:00
Cameron Dawson 49368ca7ff
Bug 1450024 - Convert Notifications to ReactJS (#4132) 2018-10-12 17:16:20 -07:00
Cameron Dawson 01c3c73703
Bug 1450041 - Convert job dup and count to properties (#4119) 2018-10-10 08:39:00 -07:00
Cameron Dawson 68f6001822
Bug 1450040 - Replace ThResultSetStore with Pushes context (#4102)
* Switch from using job.result_set_id to job.push_id
* Switch to using template strings for aggregateIds
* Fix notification where selected job not in push range
* Fix push status notifications(watching) to use safe React lifecycle method
* Fix some lodash _ imports to specific file imports
* Remove last usage of globalFilterChanged event
* Rename usage internal to PushJobs from "platforms" to "filteredPlatforms"

This takes what ThResultSetStore used to do and moves it to a React Context
called "Pushes.jsx" and into the "Push.jsx" component to manage
its own jobs.
2018-10-09 11:50:43 -07:00
renovate[bot] bb39a9dbd1 Update dependency fetch-mock to v7 (#4065) 2018-10-02 09:39:34 -07:00
Cameron Dawson 1b0eb3bbe8
Bug 1494667 - Fix selecting job within count on page load (#4081) 2018-10-02 08:31:28 -07:00
Ed Morley 445766d958
Bug 1443251 - Remove support for buildbot job ingestion (#4087)
The buildapi celerybeat tasks were disabled previously in #4007, so
these tasks are unused.
2018-10-02 11:07:27 +01:00
Ed Morley ecf4c4e33a
Bug 1349182 - Remove support for submitting jobs via the REST API (#4075)
Now that autophone and AWFY have migrated to Taskcluster, there are
no more submitters of jobs to the REST API (confirmed via New Relic
Insights). As such, this deprecated data ingestion method can now be
removed, along with support for API Hawk auth, API POST throttling
and `treeherder-client` job submission capability.

After this lands we'll need to manually drop the `credentials` table.
2018-09-28 02:17:48 +01:00
Ed Morley ffaa2e4b2a
Bug 1443251 - Remove runnable jobs support for buildbot (#4071)
Runnable jobs for buildbot were calculated via a celerybeat task
(that was disabled in #4007) and the results stored in the
`runnable_jobs` table. This can all be removed now that buildbot is
EOL, since the remaining support for Taskcluster runnable jobs does
not use that celery task/Django model.
2018-09-27 19:15:47 +01:00
Cameron Dawson 8644c1160f Fix warning in JobGroup tests (#4070) 2018-09-26 19:07:57 +01: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 eae4fa006f
Bug 1492462 - Remove retrigger/cancel APIs and pulse publisher (#4042)
Since as of #3980 (bug 1470622) the frontend no longer calls the
`/retrigger/` `/cancel/` or `/cancel_all/` Treeherder APIs.

Whilst looking at the pulse related fixtures, I spotted that the
`mock_message_broker` fixture was already unused.
2018-09-21 17:39:03 +01:00
Sarah Clements 149d01ac1c
Bug 1491133 - Optimize intermittents commenter (#4031)
Refactor get_bug_stats and alt_bug_stats and optimize queries.
Create helper to batch fetch_bug_details queries. Update test.
2018-09-17 19:52:12 -07:00
Cameron Dawson d19f0a791c
Bug 1490967 - Fix filtering with uppercase email address (#4032) 2018-09-14 13:08:52 -07:00
Cameron Dawson edbc680937 Bug 1488869 - Convert all usages of angular location window.location 2018-09-06 14:18:37 -07:00
George Hickman 63226ddc3c Replace BugJobMap.objects.create() with BugJobMap.create()
Whenever we create a BugJobMap with a User we want to update its Job's
best FailureClassification's Bug number with the one the BugJobMap was
created with.  This keeps the autoclassify data (FailureClassification)
in sync with BugJobMap.

However, doing this via an overridden `.save()` effectively hides the
functionality from anyone reading through the code.  Since the
`.update_autoclassification_bug()` method is only called from that one
place this moves all the functionality into the classmethod `.create()`.
This makes it explicit that creating a BugJobMap involves more than a
simple DB row creation.
2018-09-06 16:41:48 +01:00
Cameron Dawson 0d535214c8 Tidy up job-view folder 2018-09-06 08:25:35 -07:00
pyup.io bot 2647b998aa Update pytest to 3.8.0 (#3989)
* Update pytest from 3.7.4 to 3.8.0

* Fix django.core.urlresolvers deprecation warnings

The new version of pytest now correctly catches warnings that occur
within tests/fixtures, which has unearthed new Deprecation warnings
that need fixing to prevent test failures.

Prevents:
```
RemovedInDjango20Warning: Importing from django.core.urlresolvers is
deprecated in favor of django.urls.
```
2018-09-06 15:37:17 +01:00
Cameron Dawson 5406ebb45c
Bug 1450033 - Convert Job Filtering component to ReactJS (#3971) 2018-09-04 12:25:42 -07:00
ionutgoldan a0c1b607de Bug 1468172 - Introduce nudge functionality for perf alerts (#3671) 2018-08-28 22:27:15 +01:00
George Hickman 703c1dde62 Abstract pulse message reading into a configurable function
Since testing Django management commands involves running them and
checking the log output this provides us with a way to test message
reading functionality while also reducing those scripts down to a simple
configuration.
2018-08-28 14:01:49 +01:00
George Hickman 6faff4fcc9 Allow creation of Pulse Exchanges and return bound Exchange objects 2018-08-28 14:01:49 +01:00
George Hickman 3e92d05eef Make it explicit we're mirroring the Pulse connection for tests 2018-08-28 14:01:49 +01:00
Cameron Dawson 3af1db6b2c Bug 1485090 - Convert ResultSet Model to ReactJS 2018-08-27 09:01:14 -07:00
George Hickman 4825058830 Bug 1483231 - Remove the PULSE_EXCHANGE_NAMESPACE configuration option 2018-08-24 14:46:31 +01:00
George Hickman 27cb0bc4d7
Move Pulse Publishing to Pulse Service (#3919)
The PulsePublisher class was built for extensibility, providing lots of hooks
for customisation.  However we only had one subclass in use since its
introduction: TreeherderPublisher.  This reduces the concrete class into a
single function which publishes the given message.  In doing so all
configurability has been removed, since it was unused.
2018-08-24 14:09:14 +01:00
George Hickman d6a1efa4f7 Make construction of the Pulse connection lazy
Wrapping in Django's `lazy` makes the call to build_connection lazy but
means we need to call the function when we use it.
2018-08-24 13:29:42 +01:00
Cameron Dawson a1dc384a9b Bug 1482536 - Convert Repository Model to ReactJS 2018-08-21 10:53:45 -07:00
George Hickman 9d29a26309 Replace uses of some_queryset.all()[0] with some_queryset.first() 2018-08-14 09:25:24 +01:00
Cameron Dawson e7f026d499
React work cleanup (#3892)
* Remove vestigial pinboard service file
* Test cleanup: hanging commas, arrow functions, quotes, etc.
* Fix async job tests.  Using .then meant they sometimes didn't 
  return before the test run completedand would throw a warning 
  AND not execute the test ``expect``.
* Fix resultset tests fetching
  Some models changed to use ``fetch`` so we needed to use 
 ``fetchMock`` instead of ``$httpBackend`` for setting expected results.
* Fix warnings in bugfiler tests: We needed to pass some dummy objects 
  for PropTypes that are required.
* Fix warnings in JobGroup tests: We needed to pass some dummy objects 
  for PropTypes that are required here, too.
2018-08-08 17:00:51 -07:00
George Hickman 079956945f Bug 1281821 - use PULSE_URI instead of PULSE_URL for publishing to Pulse 2018-08-08 09:42:07 +01:00
George Hickman 6e7b1efac3 Bug 1281821 - Rename PULSE_URI -> PULSE_URL to match other config vars 2018-08-07 09:51:40 +01:00
Cameron Dawson ed2e800d90
Bug 1465987 - Convert the BugFiler to ReactJS (#3878) 2018-08-06 10:54:00 -07:00
Ed Morley 1b52b07728
Bug 1445325 - Stop mirroring classifications to OrangeFactor (#3677)
Now that consumers of OrangeFactor have been switched to the new
intermittent failures view UI/API, we can stop submitting failure
classifications to OrangeFactor's Elasticsearch instance.
2018-08-03 00:16:35 +02:00
Sarah Clements 6b8cdf6bab Bug 1453760 - Bug commenter: Skip bugs when metadata not retrievable (#3856)
Since certain bug metadata is not retrievable (even with an API key)
and returns a 401 Authorization Required (eg security bugs). 

The whiteboard is also now only updated if it has changed.
2018-08-01 19:35:32 +02:00
Ed Morley e0a9fe9bbf Bug 1113235 - Move custom ETL exceptions to their own module
This helps avoid circular import errors in the next commit (via the
`treeherder/workers/task.py` import of `MissingPushException`.
2018-07-31 20:06:40 +02:00