I do not know why I suggested landing the complete PR #5604.
I wanted the UI code to be landed in advance so we can notice any edges cases
on the day before the downtime. This change only includes the UI changes from
the original PR.
- update repositories fixture with new tc_root_urls for firefox-ci and community-ci
- update getRunnableJobsUrl and RunnableJobModel to access currentRepo and tc_root_url;
refactor getInspectTaskUrl and JobInfo component to have currentRepo prop
- add new rooturls to connect-src, update rooturl for seta, update docs and
remove header in make_request,
Switch Perfherder to react-router
Use top-level of app as a cache for projects, frameworks, alerts data and compare data
Cleanup files and move constants to dedicated perfherder file
Remove angular-related libraries and bump up the neutrino entry and asset limits
* Rename details panel ``selectedJob`` to ``selectedJobFull``
The job that's passed in the DetailsPanel has a bunch of extra fields
that are not in the normal downloaded list of jobs. So I wanted to
depict that ``selectedJob`` is not the same thing as what you see
in the DetailsPanel.
* Stop using Redux where not necessary
I was using Redux to assign the selectedJob in a few details
classes when I should have just passed it where it was needed.
* New addAggregateFields function
Instead of using a more heavy weight JobModel for each job,
we just persist some fields that were getting constantly calculated
over and over. This was especially true during filtering and re-rendering.
* Remove some cruft leftover from Buildbot.
This introduces Redux back into Treeherder. While redux is often considered
unnecessary for simple apps in favor of Context, Treeherder is not simple.
Using Redux here allows us to abstract out certain functionality into
libraries that can be self-contained. And it does a better job of managing
the functions needed to modify the state in these areas. This is the first
context I am converting and will likely have minimal (if any) noticeable
performance gain. But converting SelectedJob and Pusehs should end up having
a larger impact.
This is the second part to the Font Awesome conversion started in #4556.
After this PR, all that is left is the Perfherder parts, which can be
converted from the inline HTML style SVG+JS to using
`@fortawesome/react-fontawesome` as part of the React conversion.
Previously the frontend would calculate the access token expiry timestamp
in milliseconds and pass it to the `/login/` API via an `ExpiresAt` header.
The backend would then convert both the Id Token's `exp` and current time
to milliseconds, when calculating the earliest expiry. The result then
had to be converted back to seconds for use with Django's session
`.set_expiry()`.
It is instead much simpler to leave everything in seconds, since none of
the Auth0-provided inputs were in milliseconds to start with, so there is
no loss of precision, just fewer conversions required. Timestamps are also
more commonly in seconds, so use of seconds is less surprising.
After this is deployed there will initially be users who have old frontend
pages open that are still sending the expiry as milliseconds. In order to
be able to differentiate between new and old clients, the header has been
renamed to `Access-Token-Expires-At` (which also makes it clearer as to
what the expiry is for, given there is also an Id Token expiry), and a
temporary fall-back added to the backend that can be removed after a few
days has passed.
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.
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