зеркало из https://github.com/mozilla/treeherder.git
Update dependency prettier to v2 (#6323)
* Update dependency prettier to v2 * Automatic prettier fixes Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Armen Zambrano G <armenzg@mozilla.com>
This commit is contained in:
Родитель
840637ca9d
Коммит
d6ba99312c
|
@ -84,11 +84,11 @@ module.exports = {
|
|||
referer: `${BACKEND}/webpack-dev-server`,
|
||||
},
|
||||
target: BACKEND,
|
||||
onProxyRes: proxyRes => {
|
||||
onProxyRes: (proxyRes) => {
|
||||
// Strip the cookie `secure` attribute, otherwise production's cookies
|
||||
// will be rejected by the browser when using non-HTTPS localhost:
|
||||
// https://github.com/nodejitsu/node-http-proxy/pull/1166
|
||||
const removeSecure = str => str.replace(/; secure/i, '');
|
||||
const removeSecure = (str) => str.replace(/; secure/i, '');
|
||||
const cookieHeader = proxyRes.headers['set-cookie'];
|
||||
if (cookieHeader) {
|
||||
proxyRes.headers['set-cookie'] = Array.isArray(cookieHeader)
|
||||
|
@ -143,7 +143,7 @@ module.exports = {
|
|||
'^hawk$': 'hawk/dist/browser.js',
|
||||
},
|
||||
}),
|
||||
neutrino => {
|
||||
(neutrino) => {
|
||||
neutrino.config
|
||||
.plugin('provide')
|
||||
.use(require.resolve('webpack/lib/ProvidePlugin'), [
|
||||
|
|
|
@ -8,7 +8,7 @@ repos:
|
|||
hooks:
|
||||
- id: shellcheck
|
||||
- repo: https://github.com/prettier/prettier
|
||||
rev: 1.19.1
|
||||
rev: 2.0.5
|
||||
hooks:
|
||||
- id: prettier
|
||||
- repo: https://github.com/igorshubovych/markdownlint-cli
|
||||
|
|
|
@ -82,7 +82,7 @@
|
|||
"fetch-mock": "9.3.1",
|
||||
"jest": "24.9.0",
|
||||
"node-fetch": "2.6.0",
|
||||
"prettier": "1.19.1",
|
||||
"prettier": "2.0.5",
|
||||
"webpack-dev-server": "3.9.0"
|
||||
},
|
||||
"scripts": {
|
||||
|
|
|
@ -245,7 +245,7 @@ describe('Filtering', () => {
|
|||
});
|
||||
|
||||
describe('by result status', () => {
|
||||
const clickFilterChicklet = color => {
|
||||
const clickFilterChicklet = (color) => {
|
||||
fireEvent.click(document.querySelector(`.btn-${color}-filter-chicklet`));
|
||||
};
|
||||
|
||||
|
|
|
@ -212,9 +212,9 @@ describe('PushList', () => {
|
|||
const { getByTestId, getAllByTestId } = render(
|
||||
testPushList(store, new FilterModel()),
|
||||
);
|
||||
const nextNUrl = count =>
|
||||
const nextNUrl = (count) =>
|
||||
getProjectUrl(`/push/?full=true&count=${count + 1}&push_timestamp__lte=`);
|
||||
const clickNext = count =>
|
||||
const clickNext = (count) =>
|
||||
fireEvent.click(getByTestId(`get-next-${count}`));
|
||||
|
||||
fetchMock.get(`begin:${nextNUrl(10)}`, {
|
||||
|
|
|
@ -76,7 +76,7 @@ describe('BugFiler', () => {
|
|||
fetchMock.reset();
|
||||
});
|
||||
|
||||
const getBugFilerForSummary = summary => {
|
||||
const getBugFilerForSummary = (summary) => {
|
||||
const suggestion = {
|
||||
summary,
|
||||
search_terms: [
|
||||
|
|
|
@ -80,7 +80,7 @@ describe('DetailsPanel', () => {
|
|||
replaceLocation({});
|
||||
});
|
||||
|
||||
const testDetailsPanel = store => (
|
||||
const testDetailsPanel = (store) => (
|
||||
<div id="global-container" className="height-minus-navbars">
|
||||
<Provider store={store}>
|
||||
<KeyboardShortcuts
|
||||
|
|
|
@ -17,8 +17,8 @@ describe('JobGroup component', () => {
|
|||
const pushGroupState = 'collapsed';
|
||||
|
||||
beforeAll(() => {
|
||||
mappedGroupFixture.jobs.forEach(job => addAggregateFields(job));
|
||||
mappedGroupDupsFixture.jobs.forEach(job => addAggregateFields(job));
|
||||
mappedGroupFixture.jobs.forEach((job) => addAggregateFields(job));
|
||||
mappedGroupDupsFixture.jobs.forEach((job) => addAggregateFields(job));
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
|
@ -43,12 +43,7 @@ describe('JobGroup component', () => {
|
|||
/>,
|
||||
);
|
||||
|
||||
expect(
|
||||
jobGroup
|
||||
.find('.job-group-count')
|
||||
.first()
|
||||
.text(),
|
||||
).toEqual('2');
|
||||
expect(jobGroup.find('.job-group-count').first().text()).toEqual('2');
|
||||
});
|
||||
|
||||
test('should show a job and count of 2 when expanded, then re-collapsed', () => {
|
||||
|
@ -67,12 +62,7 @@ describe('JobGroup component', () => {
|
|||
jobGroup.setState({ expanded: true });
|
||||
jobGroup.setState({ expanded: false });
|
||||
|
||||
expect(
|
||||
jobGroup
|
||||
.find('.job-group-count')
|
||||
.first()
|
||||
.text(),
|
||||
).toEqual('2');
|
||||
expect(jobGroup.find('.job-group-count').first().text()).toEqual('2');
|
||||
});
|
||||
|
||||
test('should show jobs, not counts when expanded', () => {
|
||||
|
|
|
@ -35,9 +35,9 @@ const testPush = {
|
|||
};
|
||||
|
||||
beforeAll(() => {
|
||||
platforms.forEach(platform =>
|
||||
platform.groups.forEach(group =>
|
||||
group.jobs.forEach(job => addAggregateFields(job)),
|
||||
platforms.forEach((platform) =>
|
||||
platform.groups.forEach((group) =>
|
||||
group.jobs.forEach((job) => addAggregateFields(job)),
|
||||
),
|
||||
);
|
||||
});
|
||||
|
@ -47,7 +47,7 @@ afterEach(() => {
|
|||
setUrlParam('selectedTaskRun', null);
|
||||
});
|
||||
|
||||
const testPushJobs = filterModel => (
|
||||
const testPushJobs = (filterModel) => (
|
||||
<Provider store={store}>
|
||||
<PushJobs
|
||||
push={testPush}
|
||||
|
|
|
@ -101,7 +101,7 @@ describe('SelectedJob Redux store', () => {
|
|||
|
||||
const reduced = await reducer(
|
||||
{ selectedJob: { initialState } },
|
||||
setSelectedJobFromQueryString(msg => notifications.push(msg), jobMap),
|
||||
setSelectedJobFromQueryString((msg) => notifications.push(msg), jobMap),
|
||||
);
|
||||
|
||||
expect(reduced.selectedJob).toBeUndefined();
|
||||
|
@ -119,7 +119,7 @@ describe('SelectedJob Redux store', () => {
|
|||
|
||||
const reduced = await reducer(
|
||||
{ selectedJob: { initialState } },
|
||||
setSelectedJobFromQueryString(msg => notifications.push(msg), jobMap),
|
||||
setSelectedJobFromQueryString((msg) => notifications.push(msg), jobMap),
|
||||
);
|
||||
|
||||
expect(reduced.selectedJob).toBeUndefined();
|
||||
|
|
|
@ -78,7 +78,7 @@ describe('JobModel', () => {
|
|||
// Must clear the cache, because we save each time we
|
||||
// call the API for a decision task id.
|
||||
Object.keys(decisionTaskIdCache).forEach(
|
||||
prop => delete decisionTaskIdCache[prop],
|
||||
(prop) => delete decisionTaskIdCache[prop],
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
@ -213,7 +213,7 @@ describe('alert filtering ignores repository and/or options', () => {
|
|||
[repos[0].name],
|
||||
[testAlertSummaries[0].alerts[0].series_signature.options[0]],
|
||||
];
|
||||
testCases.forEach(testCase => {
|
||||
testCases.forEach((testCase) => {
|
||||
it(testCase.toString(), async () => {
|
||||
const { getByPlaceholderText, getByText } = alertsView();
|
||||
const alertsFilterInput = await waitForElement(() =>
|
||||
|
|
|
@ -214,7 +214,7 @@ test('table header & rows all have hash-based ids', async () => {
|
|||
'id',
|
||||
expect.stringMatching(regexComptableHeaderId),
|
||||
);
|
||||
compareTableRows.forEach(row => {
|
||||
compareTableRows.forEach((row) => {
|
||||
expect(row).toHaveAttribute(
|
||||
'id',
|
||||
expect.stringMatching(regexComptableRowId),
|
||||
|
@ -224,7 +224,7 @@ test('table header & rows all have hash-based ids', async () => {
|
|||
// each hash suffix is unique
|
||||
const tableSections = [compareTable, ...compareTableRows];
|
||||
const allHashSuffixes = tableSections.map(
|
||||
section => /table-\w+-(\d+)/g.exec(section.id)[1],
|
||||
(section) => /table-\w+-(\d+)/g.exec(section.id)[1],
|
||||
);
|
||||
const uniqueHashSuffixes = [...new Set(allHashSuffixes)];
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ const renderReactNode = (getRevisions, updateState, parentState) => (
|
|||
revisionState="newRevision"
|
||||
selectedRevision={parentState.selectedRevision}
|
||||
selectedRepo="testProject"
|
||||
updateState={data => {
|
||||
updateState={(data) => {
|
||||
parentSetState(data, parentState);
|
||||
}}
|
||||
projectState="projectState"
|
||||
|
|
|
@ -22,7 +22,7 @@ afterEach(() => {
|
|||
describe('CommitHistory', () => {
|
||||
const revision = 'b6affc2813062a8e5a227a3ecf679e13c0c7a853';
|
||||
const currentRepo = new RepositoryModel(repositories[1]);
|
||||
const testCommitHistory = history => (
|
||||
const testCommitHistory = (history) => (
|
||||
<CommitHistory
|
||||
history={history}
|
||||
revision={revision}
|
||||
|
|
|
@ -11,7 +11,7 @@ const failBuild = pushHealth.metrics.builds.details[0];
|
|||
const passJob = pushHealth.metrics.tests.details.knownIssues[0].passJobs[0];
|
||||
|
||||
describe('Job', () => {
|
||||
const testJob = job => (
|
||||
const testJob = (job) => (
|
||||
<Job
|
||||
job={job}
|
||||
repo={repoName}
|
||||
|
|
|
@ -35,7 +35,7 @@ afterEach(() => {
|
|||
});
|
||||
|
||||
describe('TestFailure', () => {
|
||||
const testTestFailure = failure => (
|
||||
const testTestFailure = (failure) => (
|
||||
<TestFailure
|
||||
failure={failure}
|
||||
repo="autoland"
|
||||
|
|
|
@ -96,7 +96,7 @@ afterEach(() => {
|
|||
});
|
||||
|
||||
describe('UnsupportedJob', () => {
|
||||
const testTestFailure = job => (
|
||||
const testTestFailure = (job) => (
|
||||
<UnsupportedJob
|
||||
job={job}
|
||||
jobName={job.job_type_name}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export const escapeId = id => id.replace(/(:|\[|\]|\?|,|\.|\s+)/g, '-');
|
||||
export const escapeId = (id) => id.replace(/(:|\[|\]|\?|,|\.|\s+)/g, '-');
|
||||
|
||||
export const getPlatformRowId = (
|
||||
repoName,
|
||||
|
|
|
@ -11,7 +11,7 @@ export const webAuth = new WebAuth({
|
|||
scope: 'openid profile email',
|
||||
});
|
||||
|
||||
export const userSessionFromAuthResult = authResult => {
|
||||
export const userSessionFromAuthResult = (authResult) => {
|
||||
// Example authResult:
|
||||
// {
|
||||
// "accessToken": "<TOKEN>",
|
||||
|
@ -79,7 +79,7 @@ export const renew = () =>
|
|||
});
|
||||
|
||||
// Wrapper around webAuth's parseHash
|
||||
export const parseHash = options =>
|
||||
export const parseHash = (options) =>
|
||||
new Promise((resolve, reject) => {
|
||||
webAuth.parseHash(options, (error, authResult) => {
|
||||
if (error) {
|
||||
|
|
|
@ -45,7 +45,7 @@ export const getPercentComplete = function getPercentComplete(counts) {
|
|||
};
|
||||
|
||||
export const formatArtifacts = function formatArtifacts(data, artifactParams) {
|
||||
return data.map(item => {
|
||||
return data.map((item) => {
|
||||
const value = item.name.replace(/.*\//, '');
|
||||
artifactParams.artifactPath = item.name;
|
||||
// for backwards compatibility with JobDetail API
|
||||
|
|
|
@ -71,7 +71,7 @@ export const allFilterParams = [
|
|||
|
||||
// compare 2 arrays, but ignore order
|
||||
export const arraysEqual = function arraysEqual(arr1, arr2) {
|
||||
return arr1.length === arr2.length && arr1.every(v => arr2.includes(v));
|
||||
return arr1.length === arr2.length && arr1.every((v) => arr2.includes(v));
|
||||
};
|
||||
|
||||
export const matchesDefaults = function matchesDefaults(field, values) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { inflate } from 'pako';
|
||||
|
||||
export const unGzip = async binData => {
|
||||
export const unGzip = async (binData) => {
|
||||
const decompressed = await inflate(binData, { to: 'string' });
|
||||
return JSON.parse(decompressed);
|
||||
};
|
||||
|
|
|
@ -73,9 +73,9 @@ export const processResponse = (response, state, errorMessages) => {
|
|||
return { [state]: data };
|
||||
};
|
||||
|
||||
export const processErrors = responses => {
|
||||
export const processErrors = (responses) => {
|
||||
const errorMessages = [];
|
||||
responses.forEach(response => {
|
||||
responses.forEach((response) => {
|
||||
if (response.failureStatus) {
|
||||
errorMessages.push(response.data);
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ export const isReftest = function isReftest(job) {
|
|||
job_type_symbol: jSymbol,
|
||||
} = job;
|
||||
return (
|
||||
[gName, jName].some(name => name.toLowerCase().includes('reftest')) ||
|
||||
[gName, jName].some((name) => name.toLowerCase().includes('reftest')) ||
|
||||
jSymbol.includes('wrench') ||
|
||||
jName.includes('test-verify')
|
||||
);
|
||||
|
@ -51,7 +51,7 @@ export const isReftest = function isReftest(job) {
|
|||
|
||||
export const isPerfTest = function isPerfTest(job) {
|
||||
return [job.job_group_name, job.job_type_name].some(
|
||||
name =>
|
||||
(name) =>
|
||||
name.toLowerCase().includes('talos') ||
|
||||
name.toLowerCase().includes('raptor'),
|
||||
);
|
||||
|
@ -72,7 +72,7 @@ export const isTestIsolatable = function isTestIsolatable(job) {
|
|||
return false;
|
||||
}
|
||||
return [job.job_group_name, job.job_type_name].some(
|
||||
name =>
|
||||
(name) =>
|
||||
!name.toLowerCase().includes('source-test') &&
|
||||
(name.toLowerCase().includes('crashtest') ||
|
||||
name.toLowerCase().includes('mochitest') ||
|
||||
|
@ -93,7 +93,7 @@ export const isUnclassifiedFailure = function isUnclassifiedFailure(job) {
|
|||
// Fetch the React instance of an object from a DOM element.
|
||||
// Credit for this approach goes to SO: https://stackoverflow.com/a/48335220/333614
|
||||
export const findInstance = function findInstance(el) {
|
||||
const key = Object.keys(el).find(key =>
|
||||
const key = Object.keys(el).find((key) =>
|
||||
key.startsWith('__reactInternalInstance$'),
|
||||
);
|
||||
if (key) {
|
||||
|
@ -199,7 +199,7 @@ export const addAggregateFields = function addAggregateFields(job) {
|
|||
jobTypeName,
|
||||
`${symbolInfo}(${jobTypeSymbol})`,
|
||||
]
|
||||
.filter(item => typeof item !== 'undefined')
|
||||
.filter((item) => typeof item !== 'undefined')
|
||||
.join(' ');
|
||||
|
||||
if (!('duration' in job)) {
|
||||
|
@ -226,7 +226,7 @@ export const getJobSearchStrHref = function getJobSearchStrHref(jobSearchStr) {
|
|||
return `${uiJobsUrlBase}?${params.toString()}`;
|
||||
};
|
||||
|
||||
export const getTaskRunStr = job => `${job.task_id}-${job.retry_id}`;
|
||||
export const getTaskRunStr = (job) => `${job.task_id}-${job.retry_id}`;
|
||||
|
||||
export const getTaskRun = function getTaskRun(taskRunStr) {
|
||||
if (!taskRunStr) {
|
||||
|
|
|
@ -3,7 +3,7 @@ export const MAX_TRANSIENT_AGE = 4000;
|
|||
/*
|
||||
* Clear any expired transient notifications
|
||||
*/
|
||||
export const clearExpiredTransientNotifications = notifications => {
|
||||
export const clearExpiredTransientNotifications = (notifications) => {
|
||||
const cleanedNotifications = notifications.reduce((acc, note) => {
|
||||
return note.sticky || Date.now() - note.created < MAX_TRANSIENT_AGE
|
||||
? [...acc, note]
|
||||
|
|
|
@ -22,4 +22,4 @@ export const extendProperties = function extendProperties(dest, src) {
|
|||
};
|
||||
|
||||
export const didObjectsChange = (firstObj, secondObj, fields) =>
|
||||
fields.some(field => firstObj[field] !== secondObj[field]);
|
||||
fields.some((field) => firstObj[field] !== secondObj[field]);
|
||||
|
|
|
@ -4,7 +4,7 @@ export const parseAuthor = function parseAuthor(author) {
|
|||
const userTokens = author.split(/[<>]+/);
|
||||
const name = userTokens[0]
|
||||
.trim()
|
||||
.replace(/\w\S*/g, txt => txt.charAt(0).toUpperCase() + txt.substr(1));
|
||||
.replace(/\w\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substr(1));
|
||||
const email = userTokens.length > 1 ? userTokens[1] : '';
|
||||
return { name, email };
|
||||
};
|
||||
|
|
|
@ -67,7 +67,7 @@ const taskcluster = (() => {
|
|||
trailing: false,
|
||||
});
|
||||
|
||||
const getCredentials = rootUrl => {
|
||||
const getCredentials = (rootUrl) => {
|
||||
const userCredentials = JSON.parse(localStorage.getItem('userCredentials'));
|
||||
_rootUrl = checkRootUrl(rootUrl);
|
||||
|
||||
|
@ -118,12 +118,12 @@ const taskcluster = (() => {
|
|||
})();
|
||||
|
||||
export const getAction = (actionArray, actionName) => {
|
||||
const action = actionArray.find(result => result.name === actionName);
|
||||
const action = actionArray.find((result) => result.name === actionName);
|
||||
|
||||
if (!action) {
|
||||
throw Error(
|
||||
`'${actionName}' action is not available for this task. Available: ${actionArray
|
||||
.map(act => act.name)
|
||||
.map((act) => act.name)
|
||||
.join(', ')}`,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ export const getRunnableJobsURL = function getRunnableJobsURL(
|
|||
return url;
|
||||
};
|
||||
|
||||
export const getArtifactsUrl = params => {
|
||||
export const getArtifactsUrl = (params) => {
|
||||
const { taskId, run, rootUrl, artifactPath } = params;
|
||||
|
||||
const tcUrl = tcLibUrls.withRootUrl(rootUrl);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* eslint-disable no-bitwise */
|
||||
|
||||
export const hashFunction = someString => {
|
||||
export const hashFunction = (someString) => {
|
||||
// Borrowed from https://github.com/darkskyapp/string-hash
|
||||
let hash = 5381;
|
||||
let i = someString.length;
|
||||
|
|
|
@ -22,7 +22,7 @@ class App extends React.Component {
|
|||
};
|
||||
}
|
||||
|
||||
updateAppState = state => {
|
||||
updateAppState = (state) => {
|
||||
this.setState(state);
|
||||
};
|
||||
|
||||
|
@ -40,15 +40,15 @@ class App extends React.Component {
|
|||
<Route
|
||||
exact
|
||||
path="/main"
|
||||
render={props => (
|
||||
render={(props) => (
|
||||
<MainView
|
||||
{...props}
|
||||
mainGraphData={graphData}
|
||||
mainTableData={tableData}
|
||||
updateAppState={this.updateAppState}
|
||||
user={user}
|
||||
setUser={user => this.setState({ user })}
|
||||
notify={message =>
|
||||
setUser={(user) => this.setState({ user })}
|
||||
notify={(message) =>
|
||||
this.setState({ errorMessages: [message] })
|
||||
}
|
||||
/>
|
||||
|
@ -56,7 +56,7 @@ class App extends React.Component {
|
|||
/>
|
||||
<Route
|
||||
path="/main?startday=:startday&endday=:endday&tree=:tree"
|
||||
render={props => (
|
||||
render={(props) => (
|
||||
<MainView
|
||||
{...props}
|
||||
mainGraphData={graphData}
|
||||
|
|
|
@ -22,7 +22,7 @@ import Layout from './Layout';
|
|||
import withView from './View';
|
||||
import DateOptions from './DateOptions';
|
||||
|
||||
const BugDetailsView = props => {
|
||||
const BugDetailsView = (props) => {
|
||||
const {
|
||||
graphData,
|
||||
tableData,
|
||||
|
@ -50,7 +50,7 @@ const BugDetailsView = props => {
|
|||
{
|
||||
Header: 'Revision',
|
||||
accessor: 'revision',
|
||||
Cell: _props => (
|
||||
Cell: (_props) => (
|
||||
<a
|
||||
href={getJobsUrl({
|
||||
repo: _props.original.tree,
|
||||
|
@ -89,7 +89,7 @@ const BugDetailsView = props => {
|
|||
{
|
||||
Header: 'Log',
|
||||
accessor: 'job_id',
|
||||
Cell: _props => {
|
||||
Cell: (_props) => {
|
||||
const { value, original } = _props;
|
||||
return (
|
||||
<SimpleTooltip
|
||||
|
|
|
@ -18,10 +18,10 @@ export default class DateOptions extends React.Component {
|
|||
}
|
||||
|
||||
toggle = () => {
|
||||
this.setState(prevState => ({ dropdownOpen: !prevState.dropdownOpen }));
|
||||
this.setState((prevState) => ({ dropdownOpen: !prevState.dropdownOpen }));
|
||||
};
|
||||
|
||||
updateDateRange = dateRange => {
|
||||
updateDateRange = (dateRange) => {
|
||||
this.setState({ dateRange });
|
||||
if (dateRange === 'custom range') {
|
||||
return;
|
||||
|
@ -35,11 +35,7 @@ export default class DateOptions extends React.Component {
|
|||
// bug history is max 4 months
|
||||
from = 120;
|
||||
}
|
||||
const startday = ISODate(
|
||||
moment()
|
||||
.utc()
|
||||
.subtract(from, 'days'),
|
||||
);
|
||||
const startday = ISODate(moment().utc().subtract(from, 'days'));
|
||||
const endday = ISODate(moment().utc());
|
||||
this.props.updateState({ startday, endday });
|
||||
};
|
||||
|
|
|
@ -34,7 +34,7 @@ export default class DateRangePicker extends React.Component {
|
|||
this.to.getDayPicker().showMonth(startDate);
|
||||
};
|
||||
|
||||
fromChange = startDate => {
|
||||
fromChange = (startDate) => {
|
||||
this.setState({ startDate }, () => {
|
||||
if (!this.state.endDate) {
|
||||
this.focusTo();
|
||||
|
@ -42,7 +42,7 @@ export default class DateRangePicker extends React.Component {
|
|||
});
|
||||
};
|
||||
|
||||
toChange = endDate => {
|
||||
toChange = (endDate) => {
|
||||
this.setState({ endDate }, this.showFromMonth);
|
||||
};
|
||||
|
||||
|
@ -56,7 +56,7 @@ export default class DateRangePicker extends React.Component {
|
|||
this.props.updateState({ startday, endday });
|
||||
};
|
||||
|
||||
onFocusChange = calendarFocused => {
|
||||
onFocusChange = (calendarFocused) => {
|
||||
this.setState(() => ({ calendarFocused }));
|
||||
};
|
||||
|
||||
|
@ -78,7 +78,7 @@ export default class DateRangePicker extends React.Component {
|
|||
showClearDates
|
||||
numberOfMonths={2}
|
||||
initialVisibleMonth={() => moment().subtract(1, 'month')}
|
||||
isOutsideRange={day => moment().diff(day) < 0}
|
||||
isOutsideRange={(day) => moment().diff(day) < 0}
|
||||
/>
|
||||
<Button color="secondary" className="ml-3" onClick={this.updateData}>
|
||||
update
|
||||
|
|
|
@ -27,7 +27,7 @@ const Graph = ({ graphData, title, legendData }) => (
|
|||
/>
|
||||
)}
|
||||
{graphData.length > 0 &&
|
||||
graphData.map(item => (
|
||||
graphData.map((item) => (
|
||||
<VictoryLine
|
||||
key={item}
|
||||
data={item.data}
|
||||
|
|
|
@ -15,11 +15,11 @@ export default class GraphsContainer extends React.Component {
|
|||
}
|
||||
|
||||
toggleGraph = () => {
|
||||
this.setState(prevState => ({ showGraphTwo: !prevState.showGraphTwo }));
|
||||
this.setState((prevState) => ({ showGraphTwo: !prevState.showGraphTwo }));
|
||||
};
|
||||
|
||||
toggleAltViewGraph = () => {
|
||||
this.setState(prevState => ({
|
||||
this.setState((prevState) => ({
|
||||
showAlternateView: !prevState.showAlternateView,
|
||||
}));
|
||||
};
|
||||
|
|
|
@ -10,7 +10,7 @@ import LoadingSpinner from '../shared/LoadingSpinner';
|
|||
import Navigation from './Navigation';
|
||||
import GraphsContainer from './GraphsContainer';
|
||||
|
||||
const Layout = props => {
|
||||
const Layout = (props) => {
|
||||
const {
|
||||
graphData,
|
||||
tableData,
|
||||
|
|
|
@ -17,7 +17,7 @@ import withView from './View';
|
|||
import Layout from './Layout';
|
||||
import DateRangePicker from './DateRangePicker';
|
||||
|
||||
const MainView = props => {
|
||||
const MainView = (props) => {
|
||||
const {
|
||||
graphData,
|
||||
tableData,
|
||||
|
@ -46,7 +46,7 @@ const MainView = props => {
|
|||
className: 'bug-column text-left',
|
||||
maxWidth: 150,
|
||||
width: 115,
|
||||
Cell: _props => (
|
||||
Cell: (_props) => (
|
||||
<BugColumn
|
||||
data={_props.original}
|
||||
tree={tree}
|
||||
|
@ -204,11 +204,7 @@ MainView.defaultProps = {
|
|||
|
||||
const defaultState = {
|
||||
tree: 'trunk',
|
||||
startday: ISODate(
|
||||
moment()
|
||||
.utc()
|
||||
.subtract(7, 'days'),
|
||||
),
|
||||
startday: ISODate(moment().utc().subtract(7, 'days')),
|
||||
endday: ISODate(moment().utc()),
|
||||
endpoint: bugsEndpoint,
|
||||
route: '/main',
|
||||
|
|
|
@ -22,7 +22,7 @@ export default class Navigation extends React.Component {
|
|||
}
|
||||
|
||||
toggle = () => {
|
||||
this.setState(prevState => ({ isOpen: !prevState.isOpen }));
|
||||
this.setState((prevState) => ({ isOpen: !prevState.isOpen }));
|
||||
};
|
||||
|
||||
render() {
|
||||
|
@ -41,7 +41,7 @@ export default class Navigation extends React.Component {
|
|||
</DropdownToggle>
|
||||
<DropdownMenuItems
|
||||
options={treeOptions}
|
||||
updateData={tree => updateState({ tree })}
|
||||
updateData={(tree) => updateState({ tree })}
|
||||
selectedItem={tree}
|
||||
/>
|
||||
</UncontrolledDropdown>
|
||||
|
|
|
@ -13,7 +13,7 @@ import { getData } from '../helpers/http';
|
|||
|
||||
import { validateQueryParams, mergeData, formatBugs } from './helpers';
|
||||
|
||||
const withView = defaultState => WrappedComponent => {
|
||||
const withView = (defaultState) => (WrappedComponent) => {
|
||||
class View extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
@ -77,14 +77,14 @@ const withView = defaultState => WrappedComponent => {
|
|||
}
|
||||
};
|
||||
|
||||
getBugDetails = async url => {
|
||||
getBugDetails = async (url) => {
|
||||
const { data, failureStatus } = await getData(url);
|
||||
if (!failureStatus && data.bugs.length === 1) {
|
||||
this.setState({ summary: data.bugs[0].summary });
|
||||
}
|
||||
};
|
||||
|
||||
getTableData = async url => {
|
||||
getTableData = async (url) => {
|
||||
this.setState({ tableFailureStatus: null, isFetchingTable: true });
|
||||
const { data, failureStatus } = await getData(url);
|
||||
let mergedData = null;
|
||||
|
@ -102,7 +102,7 @@ const withView = defaultState => WrappedComponent => {
|
|||
});
|
||||
};
|
||||
|
||||
getGraphData = async url => {
|
||||
getGraphData = async (url) => {
|
||||
this.setState({ graphFailureStatus: null, isFetchingGraphs: true });
|
||||
const { data, failureStatus } = await getData(url);
|
||||
this.setState({
|
||||
|
@ -112,7 +112,7 @@ const withView = defaultState => WrappedComponent => {
|
|||
});
|
||||
};
|
||||
|
||||
batchBugRequests = async bugIds => {
|
||||
batchBugRequests = async (bugIds) => {
|
||||
const urlParams = {
|
||||
include_fields: 'id,product,component,status,summary,whiteboard',
|
||||
};
|
||||
|
@ -138,7 +138,7 @@ const withView = defaultState => WrappedComponent => {
|
|||
return bugsList;
|
||||
};
|
||||
|
||||
updateState = updatedObj => {
|
||||
updateState = (updatedObj) => {
|
||||
this.setState(updatedObj, () => {
|
||||
const { startday, endday, tree, bug } = this.state;
|
||||
const params = { startday, endday, tree };
|
||||
|
|
|
@ -89,13 +89,13 @@ class App extends React.Component {
|
|||
componentDidMount() {
|
||||
const { repoName } = this.state;
|
||||
|
||||
RepositoryModel.getList().then(repos => {
|
||||
const newRepo = repos.find(repo => repo.name === repoName);
|
||||
RepositoryModel.getList().then((repos) => {
|
||||
const newRepo = repos.find((repo) => repo.name === repoName);
|
||||
|
||||
this.setState({ currentRepo: newRepo, repos });
|
||||
});
|
||||
|
||||
ClassificationTypeModel.getList().then(classificationTypes => {
|
||||
ClassificationTypeModel.getList().then((classificationTypes) => {
|
||||
this.setState({
|
||||
classificationTypes,
|
||||
classificationMap: ClassificationTypeModel.getMap(classificationTypes),
|
||||
|
@ -108,10 +108,10 @@ class App extends React.Component {
|
|||
window.addEventListener(thEvents.filtersUpdated, this.handleFiltersUpdated);
|
||||
|
||||
// Get the current Treeherder revision and poll to notify on updates.
|
||||
this.fetchDeployedRevision().then(revision => {
|
||||
this.fetchDeployedRevision().then((revision) => {
|
||||
this.setState({ serverRev: revision });
|
||||
this.updateInterval = setInterval(() => {
|
||||
this.fetchDeployedRevision().then(revision => {
|
||||
this.fetchDeployedRevision().then((revision) => {
|
||||
const {
|
||||
serverChangedTimestamp,
|
||||
serverRev,
|
||||
|
@ -174,7 +174,7 @@ class App extends React.Component {
|
|||
};
|
||||
}
|
||||
|
||||
handleStorageEvent = e => {
|
||||
handleStorageEvent = (e) => {
|
||||
if (e.key === PUSH_HEALTH_VISIBILITY) {
|
||||
this.setState({
|
||||
pushHealthVisibility: localStorage.getItem(PUSH_HEALTH_VISIBILITY),
|
||||
|
@ -182,16 +182,16 @@ class App extends React.Component {
|
|||
}
|
||||
};
|
||||
|
||||
setPushHealthVisibility = visibility => {
|
||||
setPushHealthVisibility = (visibility) => {
|
||||
localStorage.setItem(PUSH_HEALTH_VISIBILITY, visibility);
|
||||
this.setState({ pushHealthVisibility: visibility });
|
||||
};
|
||||
|
||||
setUser = user => {
|
||||
setUser = (user) => {
|
||||
this.setState({ user });
|
||||
};
|
||||
|
||||
setCurrentRepoTreeStatus = status => {
|
||||
setCurrentRepoTreeStatus = (status) => {
|
||||
const link = document.head.querySelector('link[rel="shortcut icon"]');
|
||||
|
||||
if (link) {
|
||||
|
@ -199,30 +199,30 @@ class App extends React.Component {
|
|||
}
|
||||
};
|
||||
|
||||
getAllShownJobs = pushId => {
|
||||
getAllShownJobs = (pushId) => {
|
||||
const {
|
||||
pushes: { jobMap },
|
||||
} = store.getState();
|
||||
const jobList = Object.values(jobMap);
|
||||
|
||||
return pushId
|
||||
? jobList.filter(job => job.push_id === pushId && job.visible)
|
||||
: jobList.filter(job => job.visible);
|
||||
? jobList.filter((job) => job.push_id === pushId && job.visible)
|
||||
: jobList.filter((job) => job.visible);
|
||||
};
|
||||
|
||||
toggleFieldFilterVisible = () => {
|
||||
this.setState(prevState => ({
|
||||
this.setState((prevState) => ({
|
||||
isFieldFilterVisible: !prevState.isFieldFilterVisible,
|
||||
}));
|
||||
};
|
||||
|
||||
updateDimensions = () => {
|
||||
this.setState(prevState =>
|
||||
this.setState((prevState) =>
|
||||
App.getSplitterDimensions(prevState.hasSelectedJob),
|
||||
);
|
||||
};
|
||||
|
||||
handleUrlChanges = ev => {
|
||||
handleUrlChanges = (ev) => {
|
||||
const { repos } = this.state;
|
||||
const { newURL, oldURL } = ev;
|
||||
const urlParams = getAllUrlParams();
|
||||
|
@ -233,7 +233,7 @@ class App extends React.Component {
|
|||
urlParams.has('selectedJob') || urlParams.has('selectedTaskRun'),
|
||||
groupCountsExpanded: urlParams.get('group_state') === 'expanded',
|
||||
duplicateJobsVisible: urlParams.get('duplicate_jobs') === 'visible',
|
||||
currentRepo: repos.find(repo => repo.name === newRepo),
|
||||
currentRepo: repos.find((repo) => repo.name === newRepo),
|
||||
};
|
||||
const oldState = pick(this.state, Object.keys(newState));
|
||||
|
||||
|
@ -251,7 +251,7 @@ class App extends React.Component {
|
|||
};
|
||||
|
||||
// If ``show`` is a boolean, then set to that value. If it's not, then toggle
|
||||
showOnScreenShortcuts = show => {
|
||||
showOnScreenShortcuts = (show) => {
|
||||
const { showShortCuts } = this.state;
|
||||
const newValue = typeof show === 'boolean' ? show : !showShortCuts;
|
||||
|
||||
|
@ -259,7 +259,7 @@ class App extends React.Component {
|
|||
};
|
||||
|
||||
fetchDeployedRevision() {
|
||||
return fetch(deployedRevisionUrl).then(resp => resp.text());
|
||||
return fetch(deployedRevisionUrl).then((resp) => resp.text());
|
||||
}
|
||||
|
||||
updateButtonClick() {
|
||||
|
@ -341,7 +341,7 @@ class App extends React.Component {
|
|||
<SplitPane
|
||||
split="horizontal"
|
||||
size={`${pushListPct}%`}
|
||||
onChange={size => this.handleSplitChange(size)}
|
||||
onChange={(size) => this.handleSplitChange(size)}
|
||||
>
|
||||
<div className="d-flex flex-column w-100">
|
||||
{(isFieldFilterVisible || !!filterBarFilters.length) && (
|
||||
|
|
|
@ -51,7 +51,7 @@ class CustomJobActions extends React.PureComponent {
|
|||
const { pushId, job, notify, decisionTaskMap, currentRepo } = this.props;
|
||||
const { id: decisionTaskId } = decisionTaskMap[pushId];
|
||||
|
||||
TaskclusterModel.load(decisionTaskId, job, currentRepo).then(results => {
|
||||
TaskclusterModel.load(decisionTaskId, job, currentRepo).then((results) => {
|
||||
const {
|
||||
originalTask,
|
||||
originalTaskId,
|
||||
|
@ -86,7 +86,7 @@ class CustomJobActions extends React.PureComponent {
|
|||
this.setState({ decisionTaskId });
|
||||
}
|
||||
|
||||
onChangeAction = actionName => {
|
||||
onChangeAction = (actionName) => {
|
||||
const { actions } = this.state;
|
||||
const selectedAction = actions[actionName];
|
||||
|
||||
|
@ -100,7 +100,7 @@ class CustomJobActions extends React.PureComponent {
|
|||
this.setState({ payload });
|
||||
}
|
||||
|
||||
updateSelectedAction = action => {
|
||||
updateSelectedAction = (action) => {
|
||||
const { ajv } = this.state;
|
||||
|
||||
if (action.schema) {
|
||||
|
@ -154,7 +154,7 @@ class CustomJobActions extends React.PureComponent {
|
|||
staticActionVariables,
|
||||
currentRepo,
|
||||
}).then(
|
||||
taskId => {
|
||||
(taskId) => {
|
||||
this.setState({ triggering: false });
|
||||
let message = 'Custom action request sent successfully:';
|
||||
let url = tcLibUrls.ui(
|
||||
|
@ -177,7 +177,7 @@ class CustomJobActions extends React.PureComponent {
|
|||
notify(message, 'success', { linkText: 'Open in Taskcluster', url });
|
||||
this.close();
|
||||
},
|
||||
e => {
|
||||
(e) => {
|
||||
notify(formatTaskclusterError(e), 'danger', { sticky: true });
|
||||
this.setState({ triggering: false });
|
||||
this.close();
|
||||
|
@ -253,7 +253,9 @@ class CustomJobActions extends React.PureComponent {
|
|||
value={payload}
|
||||
className="form-control pre"
|
||||
rows="10"
|
||||
onChange={evt => this.onChangePayload(evt.target.value)}
|
||||
onChange={(evt) =>
|
||||
this.onChangePayload(evt.target.value)
|
||||
}
|
||||
spellCheck="false"
|
||||
/>
|
||||
</div>
|
||||
|
|
|
@ -208,27 +208,27 @@ class KeyboardShortcuts extends React.Component {
|
|||
render() {
|
||||
const { filterModel, showOnScreenShortcuts } = this.props;
|
||||
const handlers = {
|
||||
addRelatedBug: ev => this.doKey(ev, this.addRelatedBug),
|
||||
pinEditComment: ev => this.doKey(ev, this.pinEditComment),
|
||||
quickFilter: ev => this.doKey(ev, this.quickFilter),
|
||||
clearFilter: ev => this.doKey(ev, this.clearFilter),
|
||||
toggleInProgress: ev => this.doKey(ev, filterModel.toggleInProgress),
|
||||
nextUnclassified: ev =>
|
||||
addRelatedBug: (ev) => this.doKey(ev, this.addRelatedBug),
|
||||
pinEditComment: (ev) => this.doKey(ev, this.pinEditComment),
|
||||
quickFilter: (ev) => this.doKey(ev, this.quickFilter),
|
||||
clearFilter: (ev) => this.doKey(ev, this.clearFilter),
|
||||
toggleInProgress: (ev) => this.doKey(ev, filterModel.toggleInProgress),
|
||||
nextUnclassified: (ev) =>
|
||||
this.doKey(ev, () => this.changeSelectedJob('next', true)),
|
||||
previousUnclassified: ev =>
|
||||
previousUnclassified: (ev) =>
|
||||
this.doKey(ev, () => this.changeSelectedJob('previous', true)),
|
||||
openLogviewer: ev => this.doKey(ev, this.openLogviewer),
|
||||
jobRetrigger: ev => this.doKey(ev, this.jobRetrigger),
|
||||
selectNextTab: ev => this.doKey(ev, this.selectNextTab),
|
||||
toggleUnclassifiedFailures: ev =>
|
||||
openLogviewer: (ev) => this.doKey(ev, this.openLogviewer),
|
||||
jobRetrigger: (ev) => this.doKey(ev, this.jobRetrigger),
|
||||
selectNextTab: (ev) => this.doKey(ev, this.selectNextTab),
|
||||
toggleUnclassifiedFailures: (ev) =>
|
||||
this.doKey(ev, filterModel.toggleUnclassifiedFailures),
|
||||
clearPinboard: ev => this.doKey(ev, this.clearPinboard),
|
||||
previousJob: ev =>
|
||||
clearPinboard: (ev) => this.doKey(ev, this.clearPinboard),
|
||||
previousJob: (ev) =>
|
||||
this.doKey(ev, () => this.changeSelectedJob('previous', false)),
|
||||
nextJob: ev =>
|
||||
nextJob: (ev) =>
|
||||
this.doKey(ev, () => this.changeSelectedJob('next', false)),
|
||||
pinJob: ev => this.doKey(ev, this.pinJob),
|
||||
toggleOnScreenShortcuts: ev => this.doKey(ev, showOnScreenShortcuts),
|
||||
pinJob: (ev) => this.doKey(ev, this.pinJob),
|
||||
toggleOnScreenShortcuts: (ev) => this.doKey(ev, showOnScreenShortcuts),
|
||||
/* these should happen regardless of being in an input field */
|
||||
clearScreen: this.clearScreen,
|
||||
saveClassification: this.saveClassification,
|
||||
|
|
|
@ -6,7 +6,7 @@ import NotificationList from '../shared/NotificationList';
|
|||
|
||||
import { clearNotification } from './redux/stores/notifications';
|
||||
|
||||
const Notifications = props => {
|
||||
const Notifications = (props) => {
|
||||
const { notifications, clearNotification } = props;
|
||||
|
||||
return (
|
||||
|
|
|
@ -40,7 +40,7 @@ const omittedLeads = [
|
|||
/*
|
||||
* Find the first thing in the summary line that looks like a filename.
|
||||
*/
|
||||
const findFilename = summary => {
|
||||
const findFilename = (summary) => {
|
||||
// Take left side of any reftest comparisons, as the right side is the reference file
|
||||
// eslint-disable-next-line prefer-destructuring
|
||||
summary = summary.split('==')[0];
|
||||
|
@ -59,7 +59,7 @@ const findFilename = summary => {
|
|||
* Remove extraneous junk from the start of the summary line
|
||||
* and try to find the failing test name from what's left
|
||||
*/
|
||||
const parseSummary = suggestion => {
|
||||
const parseSummary = (suggestion) => {
|
||||
let summary = suggestion.search;
|
||||
const searchTerms = suggestion.search_terms;
|
||||
// Strip out some extra stuff at the start of some failure paths
|
||||
|
@ -84,7 +84,7 @@ const parseSummary = suggestion => {
|
|||
// for the full string match, so don't omit it in this case.
|
||||
// If it's not needed, go ahead and omit it.
|
||||
if (searchTerms.length && summaryParts.length > 1) {
|
||||
omittedLeads.forEach(lead => {
|
||||
omittedLeads.forEach((lead) => {
|
||||
if (!searchTerms[0].includes(lead) && summaryParts[0].includes(lead)) {
|
||||
summaryParts.shift();
|
||||
}
|
||||
|
@ -115,17 +115,17 @@ export class BugFilerClass extends React.Component {
|
|||
jobGroupName,
|
||||
} = props;
|
||||
|
||||
const allFailures = suggestions.map(sugg =>
|
||||
const allFailures = suggestions.map((sugg) =>
|
||||
sugg.search
|
||||
.split(' | ')
|
||||
.filter(part => !omittedLeads.includes(part))
|
||||
.map(item =>
|
||||
.filter((part) => !omittedLeads.includes(part))
|
||||
.map((item) =>
|
||||
item === 'REFTEST TEST-UNEXPECTED-PASS'
|
||||
? 'TEST-UNEXPECTED-PASS'
|
||||
: item,
|
||||
),
|
||||
);
|
||||
const thisFailure = allFailures.map(f => f.join(' | ')).join('\n');
|
||||
const thisFailure = allFailures.map((f) => f.join(' | ')).join('\n');
|
||||
|
||||
const parsedSummary = parseSummary(suggestion);
|
||||
let summaryString = parsedSummary[0].join(' | ');
|
||||
|
@ -145,7 +145,7 @@ export class BugFilerClass extends React.Component {
|
|||
/assertion fail/i, // JavaScript
|
||||
/assertion count \d+ is \w+ than expected \d+ assertion/, // layout
|
||||
/AssertionError/, // Marionette
|
||||
].some(regexp => regexp.test(summaryString));
|
||||
].some((regexp) => regexp.test(summaryString));
|
||||
if (isAssertion) {
|
||||
keywords.push('assertion');
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ export class BugFilerClass extends React.Component {
|
|||
if (searchTerms.length === 0) {
|
||||
return 'Selected failure does not contain any searchable terms.';
|
||||
}
|
||||
if (searchTerms.every(term => !summary.includes(term))) {
|
||||
if (searchTerms.every((term) => !summary.includes(term))) {
|
||||
return "Summary does not include the full text of any of the selected failure's search terms:";
|
||||
}
|
||||
return '';
|
||||
|
@ -218,7 +218,7 @@ export class BugFilerClass extends React.Component {
|
|||
/**
|
||||
* 'enter' from the product search input should initiate the search
|
||||
*/
|
||||
productSearchEnter = ev => {
|
||||
productSearchEnter = (ev) => {
|
||||
const { keyCode, target } = ev;
|
||||
|
||||
this.setState({ productSearch: target.value }, () => {
|
||||
|
@ -246,12 +246,12 @@ export class BugFilerClass extends React.Component {
|
|||
);
|
||||
const data = await resp.json();
|
||||
const products = data.products.filter(
|
||||
item => !!item.product && !!item.component,
|
||||
(item) => !!item.product && !!item.component,
|
||||
);
|
||||
suggestedProductsSet = new Set([
|
||||
...suggestedProductsSet,
|
||||
...products.map(
|
||||
prod =>
|
||||
(prod) =>
|
||||
prod.product + (prod.component ? ` :: ${prod.component}` : ''),
|
||||
),
|
||||
]);
|
||||
|
@ -283,8 +283,8 @@ export class BugFilerClass extends React.Component {
|
|||
// Search mercurial's moz.build metadata to find products/components
|
||||
fetch(
|
||||
`${hgBaseUrl}mozilla-central/json-mozbuildinfo?p=${failurePath}`,
|
||||
).then(resp =>
|
||||
resp.json().then(firstRequest => {
|
||||
).then((resp) =>
|
||||
resp.json().then((firstRequest) => {
|
||||
if (firstRequest.error) {
|
||||
notify(
|
||||
'Unable to infer product/component via metadata. Please manually search for a product.',
|
||||
|
@ -309,7 +309,7 @@ export class BugFilerClass extends React.Component {
|
|||
const dxrlink = `${dxrBaseUrl}mozilla-central/search?q=file:${possibleFilename}&redirect=false&limit=5`;
|
||||
// Bug 1358328 - We need to override headers here until DXR returns JSON with the default Accept header
|
||||
fetch(dxrlink, { headers: { Accept: 'application/json' } }).then(
|
||||
secondRequest => {
|
||||
(secondRequest) => {
|
||||
const { results } = secondRequest.data;
|
||||
let resultsCount = results.length;
|
||||
// If the search returns too many results, this probably isn't a good search term, so bail
|
||||
|
@ -319,10 +319,10 @@ export class BugFilerClass extends React.Component {
|
|||
this.getSpecialProducts(failurePath),
|
||||
]);
|
||||
}
|
||||
results.forEach(result => {
|
||||
results.forEach((result) => {
|
||||
fetch(
|
||||
`${hgBaseUrl}mozilla-central/json-mozbuildinfo?p=${result.path}`,
|
||||
).then(thirdRequest => {
|
||||
).then((thirdRequest) => {
|
||||
if (
|
||||
thirdRequest.data.aggregate &&
|
||||
thirdRequest.data.aggregate.recommended_bug_component
|
||||
|
@ -413,7 +413,7 @@ export class BugFilerClass extends React.Component {
|
|||
// **Parsed log:** http://...
|
||||
// **Full log:** http://....
|
||||
const logLinks = [...checkedLogLinks]
|
||||
.map(e => {
|
||||
.map((e) => {
|
||||
const [name, url] = e;
|
||||
return `**${name}:** ${url}`;
|
||||
})
|
||||
|
@ -454,7 +454,8 @@ export class BugFilerClass extends React.Component {
|
|||
];
|
||||
if (
|
||||
noPriorityProdComp.some(
|
||||
object => object.product === product && object.component === component,
|
||||
(object) =>
|
||||
object.product === product && object.component === component,
|
||||
)
|
||||
) {
|
||||
priority = '--';
|
||||
|
@ -472,7 +473,7 @@ export class BugFilerClass extends React.Component {
|
|||
const productObject = productData.products[0];
|
||||
// Find the newest version for the product that is_active
|
||||
const version = productObject.versions
|
||||
.filter(prodVer => prodVer.is_active)
|
||||
.filter((prodVer) => prodVer.is_active)
|
||||
.slice(-1)[0];
|
||||
const payload = {
|
||||
product,
|
||||
|
@ -528,7 +529,7 @@ export class BugFilerClass extends React.Component {
|
|||
notify(failureString, 'danger', { sticky: true });
|
||||
};
|
||||
|
||||
toggleTooltip = key => {
|
||||
toggleTooltip = (key) => {
|
||||
const { tooltipOpen } = this.state;
|
||||
this.setState({
|
||||
tooltipOpen: { ...tooltipOpen, [key]: !tooltipOpen[key] },
|
||||
|
@ -574,7 +575,7 @@ export class BugFilerClass extends React.Component {
|
|||
name="modalProductFinderSearch"
|
||||
id="modalProductFinderSearch"
|
||||
onKeyDown={this.productSearchEnter}
|
||||
onChange={evt =>
|
||||
onChange={(evt) =>
|
||||
this.setState({ productSearch: evt.target.value })
|
||||
}
|
||||
type="text"
|
||||
|
@ -610,7 +611,7 @@ export class BugFilerClass extends React.Component {
|
|||
</div>
|
||||
)}
|
||||
<FormGroup tag="fieldset" className="mt-1">
|
||||
{suggestedProducts.map(product => (
|
||||
{suggestedProducts.map((product) => (
|
||||
<div
|
||||
className="ml-4"
|
||||
key={`modalProductSuggestion${product}`}
|
||||
|
@ -620,7 +621,7 @@ export class BugFilerClass extends React.Component {
|
|||
type="radio"
|
||||
value={product}
|
||||
checked={product === selectedProduct}
|
||||
onChange={evt =>
|
||||
onChange={(evt) =>
|
||||
this.setState({ selectedProduct: evt.target.value })
|
||||
}
|
||||
name="productGroup"
|
||||
|
@ -651,7 +652,7 @@ export class BugFilerClass extends React.Component {
|
|||
This can cause poor bug suggestions to be generated
|
||||
</Tooltip>
|
||||
</div>
|
||||
{searchTerms.map(term => (
|
||||
{searchTerms.map((term) => (
|
||||
<div className="text-monospace pl-3" key={term}>
|
||||
{term}
|
||||
</div>
|
||||
|
@ -664,7 +665,9 @@ export class BugFilerClass extends React.Component {
|
|||
type="text"
|
||||
placeholder="Intermittent..."
|
||||
pattern=".{0,255}"
|
||||
onChange={evt => this.setState({ summary: evt.target.value })}
|
||||
onChange={(evt) =>
|
||||
this.setState({ summary: evt.target.value })
|
||||
}
|
||||
value={summary}
|
||||
/>
|
||||
<Tooltip
|
||||
|
@ -708,7 +711,7 @@ export class BugFilerClass extends React.Component {
|
|||
type="textarea"
|
||||
value={thisFailure}
|
||||
readOnly
|
||||
onChange={evt =>
|
||||
onChange={(evt) =>
|
||||
this.setState({ thisFailure: evt.target.value })
|
||||
}
|
||||
/>
|
||||
|
@ -771,7 +774,9 @@ export class BugFilerClass extends React.Component {
|
|||
<div className="d-flex flex-column">
|
||||
<Label for="summary-input">Comment:</Label>
|
||||
<Input
|
||||
onChange={evt => this.setState({ comment: evt.target.value })}
|
||||
onChange={(evt) =>
|
||||
this.setState({ comment: evt.target.value })
|
||||
}
|
||||
type="textarea"
|
||||
id="summary-input"
|
||||
className="flex-grow-1"
|
||||
|
@ -796,7 +801,7 @@ export class BugFilerClass extends React.Component {
|
|||
id="regressedBy"
|
||||
type="text"
|
||||
className="ml-1"
|
||||
onChange={evt =>
|
||||
onChange={(evt) =>
|
||||
this.setState({ regressedBy: evt.target.value })
|
||||
}
|
||||
placeholder="Regressed by"
|
||||
|
@ -813,7 +818,7 @@ export class BugFilerClass extends React.Component {
|
|||
id="seeAlso"
|
||||
className="ml-1"
|
||||
type="text"
|
||||
onChange={evt =>
|
||||
onChange={(evt) =>
|
||||
this.setState({ seeAlso: evt.target.value })
|
||||
}
|
||||
placeholder="See also"
|
||||
|
@ -834,7 +839,7 @@ export class BugFilerClass extends React.Component {
|
|||
<Input
|
||||
type="textarea"
|
||||
id="signature-input"
|
||||
onChange={evt =>
|
||||
onChange={(evt) =>
|
||||
this.setState({ crashSignatures: evt.target.value })
|
||||
}
|
||||
maxLength="2048"
|
||||
|
|
|
@ -109,8 +109,8 @@ class DetailsPanel extends React.Component {
|
|||
if (!selectedJob) {
|
||||
return;
|
||||
}
|
||||
BugSuggestionsModel.get(selectedJob.id).then(suggestions => {
|
||||
suggestions.forEach(suggestion => {
|
||||
BugSuggestionsModel.get(selectedJob.id).then((suggestions) => {
|
||||
suggestions.forEach((suggestion) => {
|
||||
suggestion.bugs.too_many_open_recent =
|
||||
suggestion.bugs.open_recent.length > thBugSuggestionLimit;
|
||||
suggestion.bugs.too_many_all_others =
|
||||
|
@ -130,10 +130,10 @@ class DetailsPanel extends React.Component {
|
|||
// the log (we can do this asynchronously, it should normally be
|
||||
// fast)
|
||||
if (!suggestions.length) {
|
||||
TextLogStepModel.get(selectedJob.id).then(textLogSteps => {
|
||||
TextLogStepModel.get(selectedJob.id).then((textLogSteps) => {
|
||||
const errors = textLogSteps
|
||||
.filter(step => step.result !== 'success')
|
||||
.map(step => ({
|
||||
.filter((step) => step.result !== 'success')
|
||||
.map((step) => ({
|
||||
name: step.name,
|
||||
result: step.result,
|
||||
logViewerUrl: getLogViewerUrl(
|
||||
|
@ -160,10 +160,10 @@ class DetailsPanel extends React.Component {
|
|||
this.setState({ classifications, bugs });
|
||||
};
|
||||
|
||||
findPush = pushId => {
|
||||
findPush = (pushId) => {
|
||||
const { pushList } = this.props;
|
||||
|
||||
return pushList.find(push => pushId === push.id);
|
||||
return pushList.find((push) => pushId === push.id);
|
||||
};
|
||||
|
||||
selectJob = () => {
|
||||
|
@ -255,7 +255,7 @@ class DetailsPanel extends React.Component {
|
|||
// the third result comes from the jobLogUrl promise
|
||||
// exclude the json log URLs
|
||||
const jobLogUrls = jobLogUrlResult.filter(
|
||||
log => !log.name.endsWith('_json'),
|
||||
(log) => !log.name.endsWith('_json'),
|
||||
);
|
||||
|
||||
let logParseStatus = 'unavailable';
|
||||
|
@ -280,10 +280,10 @@ class DetailsPanel extends React.Component {
|
|||
|
||||
if (performanceData.length) {
|
||||
const signatureIds = [
|
||||
...new Set(performanceData.map(perf => perf.signature_id)),
|
||||
...new Set(performanceData.map((perf) => perf.signature_id)),
|
||||
];
|
||||
const seriesListList = await Promise.all(
|
||||
chunk(signatureIds, 20).map(signatureIdChunk =>
|
||||
chunk(signatureIds, 20).map((signatureIdChunk) =>
|
||||
PerfSeriesModel.getSeriesList(currentRepo.name, {
|
||||
id: signatureIdChunk,
|
||||
}),
|
||||
|
@ -291,16 +291,16 @@ class DetailsPanel extends React.Component {
|
|||
);
|
||||
|
||||
const seriesList = seriesListList
|
||||
.map(item => item.data)
|
||||
.map((item) => item.data)
|
||||
.reduce((a, b) => [...a, ...b], []);
|
||||
|
||||
perfJobDetail = performanceData
|
||||
.map(d => ({
|
||||
series: seriesList.find(s => d.signature_id === s.id),
|
||||
.map((d) => ({
|
||||
series: seriesList.find((s) => d.signature_id === s.id),
|
||||
...d,
|
||||
}))
|
||||
.filter(d => !d.series.parentSignature)
|
||||
.map(d => ({
|
||||
.filter((d) => !d.series.parentSignature)
|
||||
.map((d) => ({
|
||||
url: `/perf.html#/graphs?series=${[
|
||||
currentRepo.name,
|
||||
d.signature_id,
|
||||
|
|
|
@ -88,8 +88,8 @@ class PinBoard extends React.Component {
|
|||
}
|
||||
if (errorFree) {
|
||||
const jobs = Object.values(pinnedJobs);
|
||||
const classifyPromises = jobs.map(job => this.saveClassification(job));
|
||||
const bugPromises = jobs.map(job => this.saveBugs(job));
|
||||
const classifyPromises = jobs.map((job) => this.saveClassification(job));
|
||||
const bugPromises = jobs.map((job) => this.saveBugs(job));
|
||||
Promise.all([...classifyPromises, ...bugPromises]).then(() => {
|
||||
window.dispatchEvent(new CustomEvent(thEvents.classificationChanged));
|
||||
recalculateUnclassifiedCounts();
|
||||
|
@ -122,7 +122,7 @@ class PinBoard extends React.Component {
|
|||
});
|
||||
};
|
||||
|
||||
saveClassification = async pinnedJob => {
|
||||
saveClassification = async (pinnedJob) => {
|
||||
const { recalculateUnclassifiedCounts, notify, jobMap } = this.props;
|
||||
const classification = this.createNewClassification();
|
||||
// Ensure the version of the job we have is the one that is displayed in
|
||||
|
@ -154,17 +154,17 @@ class PinBoard extends React.Component {
|
|||
}
|
||||
};
|
||||
|
||||
saveBugs = job => {
|
||||
saveBugs = (job) => {
|
||||
const { pinnedJobBugs, notify } = this.props;
|
||||
|
||||
Object.values(pinnedJobBugs).forEach(bug => {
|
||||
Object.values(pinnedJobBugs).forEach((bug) => {
|
||||
const bjm = new BugJobMapModel({
|
||||
bug_id: bug.id,
|
||||
job_id: job.id,
|
||||
type: 'annotation',
|
||||
});
|
||||
|
||||
bjm.create().catch(response => {
|
||||
bjm.create().catch((response) => {
|
||||
const message = `Error saving bug association for ${job.platform} ${job.job_type_name}`;
|
||||
notify(formatModelError(response, message), 'danger');
|
||||
});
|
||||
|
@ -174,7 +174,7 @@ class PinBoard extends React.Component {
|
|||
// If the pasted data is (or looks like) a 12 or 40 char SHA,
|
||||
// or if the pasted data is an hg.m.o url, automatically select
|
||||
// the 'fixed by commit' classification type
|
||||
pasteSHA = evt => {
|
||||
pasteSHA = (evt) => {
|
||||
const pastedData = evt.clipboardData.getData('text');
|
||||
|
||||
if (isSHAorCommit(pastedData)) {
|
||||
|
@ -196,7 +196,7 @@ class PinBoard extends React.Component {
|
|||
|
||||
canCancelAllPinnedJobs = () => {
|
||||
const cancellableJobs = Object.values(this.props.pinnedJobs).filter(
|
||||
job => job.state === 'pending' || job.state === 'running',
|
||||
(job) => job.state === 'pending' || job.state === 'running',
|
||||
);
|
||||
|
||||
return this.props.isLoggedIn && cancellableJobs.length > 0;
|
||||
|
@ -254,7 +254,7 @@ class PinBoard extends React.Component {
|
|||
};
|
||||
|
||||
// Dynamic btn/anchor title for classification save
|
||||
saveUITitle = category => {
|
||||
saveUITitle = (category) => {
|
||||
let title = '';
|
||||
|
||||
if (!this.props.isLoggedIn) {
|
||||
|
@ -280,7 +280,7 @@ class PinBoard extends React.Component {
|
|||
} else {
|
||||
// Cut off trailing '/ ' if one exists, capitalize first letter
|
||||
title = title.replace(/\/ $/, '');
|
||||
title = title.replace(/^./, l => l.toUpperCase());
|
||||
title = title.replace(/^./, (l) => l.toUpperCase());
|
||||
}
|
||||
return title;
|
||||
};
|
||||
|
@ -289,20 +289,20 @@ class PinBoard extends React.Component {
|
|||
|
||||
hasPinnedJobBugs = () => !!Object.keys(this.props.pinnedJobBugs).length;
|
||||
|
||||
handleRelatedBugDocumentClick = event => {
|
||||
handleRelatedBugDocumentClick = (event) => {
|
||||
if (!event.target.classList.contains('add-related-bugs-input')) {
|
||||
this.saveEnteredBugNumber();
|
||||
document.removeEventListener('click', this.handleRelatedBugDocumentClick);
|
||||
}
|
||||
};
|
||||
|
||||
handleRelatedBugEscape = event => {
|
||||
handleRelatedBugEscape = (event) => {
|
||||
if (event.key === 'Escape') {
|
||||
this.toggleEnterBugNumber(false);
|
||||
}
|
||||
};
|
||||
|
||||
toggleEnterBugNumber = tf => {
|
||||
toggleEnterBugNumber = (tf) => {
|
||||
this.setState(
|
||||
{
|
||||
enteringBugNumber: tf,
|
||||
|
@ -331,7 +331,7 @@ class PinBoard extends React.Component {
|
|||
);
|
||||
};
|
||||
|
||||
isNumber = text => !text || /^[0-9]*$/.test(text);
|
||||
isNumber = (text) => !text || /^[0-9]*$/.test(text);
|
||||
|
||||
saveEnteredBugNumber = () => {
|
||||
const { newBugNumber, enteringBugNumber } = this.state;
|
||||
|
@ -347,7 +347,7 @@ class PinBoard extends React.Component {
|
|||
}
|
||||
};
|
||||
|
||||
bugNumberKeyPress = ev => {
|
||||
bugNumberKeyPress = (ev) => {
|
||||
if (ev.key === 'Enter') {
|
||||
this.saveEnteredBugNumber(ev.target.value);
|
||||
if (ev.ctrlKey) {
|
||||
|
@ -395,7 +395,7 @@ class PinBoard extends React.Component {
|
|||
press spacebar to pin a selected job
|
||||
</span>
|
||||
)}
|
||||
{Object.values(pinnedJobs).map(job => (
|
||||
{Object.values(pinnedJobs).map((job) => (
|
||||
<span className="btn-group" key={job.id}>
|
||||
<Button
|
||||
className={`pinned-job mb-1 ${getBtnClass(
|
||||
|
@ -466,14 +466,14 @@ class PinBoard extends React.Component {
|
|||
placeholder="enter bug number"
|
||||
invalid={!this.isNumber(newBugNumber)}
|
||||
onKeyPress={this.bugNumberKeyPress}
|
||||
onChange={ev =>
|
||||
onChange={(ev) =>
|
||||
this.setState({ newBugNumber: ev.target.value })
|
||||
}
|
||||
/>
|
||||
<FormFeedback>Please enter only numbers</FormFeedback>
|
||||
</span>
|
||||
)}
|
||||
{Object.values(pinnedJobBugs).map(bug => (
|
||||
{Object.values(pinnedJobBugs).map((bug) => (
|
||||
<span key={bug.id}>
|
||||
<span className="btn-group pinboard-related-bugs-btn">
|
||||
<a
|
||||
|
@ -511,11 +511,11 @@ class PinBoard extends React.Component {
|
|||
id="pinboard-classification-select"
|
||||
className="classification-select"
|
||||
value={failureClassificationId}
|
||||
onChange={evt =>
|
||||
onChange={(evt) =>
|
||||
setClassificationId(parseInt(evt.target.value, 10))
|
||||
}
|
||||
>
|
||||
{classificationTypes.map(opt => (
|
||||
{classificationTypes.map((opt) => (
|
||||
<option value={opt.id} key={opt.id}>
|
||||
{opt.name}
|
||||
</option>
|
||||
|
@ -528,7 +528,7 @@ class PinBoard extends React.Component {
|
|||
id="classification-comment"
|
||||
type="text"
|
||||
className="form-control add-classification-input"
|
||||
onChange={evt => setClassificationComment(evt.target.value)}
|
||||
onChange={(evt) => setClassificationComment(evt.target.value)}
|
||||
onPaste={this.pasteSHA}
|
||||
placeholder="click to add comment"
|
||||
value={failureClassificationComment}
|
||||
|
@ -541,14 +541,14 @@ class PinBoard extends React.Component {
|
|||
className="classification-select"
|
||||
type="select"
|
||||
defaultValue={0}
|
||||
onChange={evt =>
|
||||
onChange={(evt) =>
|
||||
setClassificationComment(evt.target.value)
|
||||
}
|
||||
>
|
||||
<option value="0" disabled>
|
||||
Choose a recent commit
|
||||
</option>
|
||||
{revisionTips.slice(0, 20).map(tip => (
|
||||
{revisionTips.slice(0, 20).map((tip) => (
|
||||
<option
|
||||
title={tip.title}
|
||||
value={tip.revision}
|
||||
|
|
|
@ -56,7 +56,7 @@ class ActionBar extends React.PureComponent {
|
|||
window.removeEventListener(thEvents.jobRetrigger, this.onRetriggerJob);
|
||||
}
|
||||
|
||||
onRetriggerJob = event => {
|
||||
onRetriggerJob = (event) => {
|
||||
this.retriggerJob([event.detail.job]);
|
||||
};
|
||||
|
||||
|
@ -100,7 +100,7 @@ class ActionBar extends React.PureComponent {
|
|||
const { id: decisionTaskId } = decisionTaskMap[selectedJobFull.push_id];
|
||||
|
||||
TaskclusterModel.load(decisionTaskId, selectedJobFull, currentRepo).then(
|
||||
results => {
|
||||
(results) => {
|
||||
try {
|
||||
const geckoprofile = getAction(results.actions, 'geckoprofile');
|
||||
|
||||
|
@ -128,7 +128,7 @@ class ActionBar extends React.PureComponent {
|
|||
'success',
|
||||
);
|
||||
},
|
||||
e => {
|
||||
(e) => {
|
||||
// The full message is too large to fit in a Treeherder
|
||||
// notification box.
|
||||
notify(formatTaskclusterError(e), 'danger', { sticky: true });
|
||||
|
@ -141,7 +141,7 @@ class ActionBar extends React.PureComponent {
|
|||
);
|
||||
};
|
||||
|
||||
retriggerJob = async jobs => {
|
||||
retriggerJob = async (jobs) => {
|
||||
const { notify, decisionTaskMap, currentRepo } = this.props;
|
||||
|
||||
// Spin the retrigger button when retriggers happen
|
||||
|
@ -180,7 +180,7 @@ class ActionBar extends React.PureComponent {
|
|||
const { id: decisionTaskId } = decisionTaskMap[selectedJobFull.push_id];
|
||||
|
||||
TaskclusterModel.load(decisionTaskId, selectedJobFull, currentRepo).then(
|
||||
results => {
|
||||
(results) => {
|
||||
try {
|
||||
const backfilltask = getAction(results.actions, 'backfill');
|
||||
|
||||
|
@ -198,7 +198,7 @@ class ActionBar extends React.PureComponent {
|
|||
'success',
|
||||
);
|
||||
},
|
||||
e => {
|
||||
(e) => {
|
||||
// The full message is too large to fit in a Treeherder
|
||||
// notification box.
|
||||
notify(formatTaskclusterError(e), 'danger', { sticky: true });
|
||||
|
@ -237,7 +237,7 @@ class ActionBar extends React.PureComponent {
|
|||
}
|
||||
|
||||
TaskclusterModel.load(decisionTaskId, selectedJobFull, currentRepo).then(
|
||||
results => {
|
||||
(results) => {
|
||||
try {
|
||||
const isolationtask = getAction(
|
||||
results.actions,
|
||||
|
@ -285,7 +285,7 @@ class ActionBar extends React.PureComponent {
|
|||
'success',
|
||||
);
|
||||
},
|
||||
e => {
|
||||
(e) => {
|
||||
// The full message is too large to fit in a Treeherder
|
||||
// notification box.
|
||||
notify(formatTaskclusterError(e), 'danger', { sticky: true });
|
||||
|
@ -320,7 +320,7 @@ class ActionBar extends React.PureComponent {
|
|||
} else {
|
||||
// Cut off trailing '/ ' if one exists, capitalize first letter
|
||||
title = title.replace(/\/ $/, '');
|
||||
title = title.replace(/^./, l => l.toUpperCase());
|
||||
title = title.replace(/^./, (l) => l.toUpperCase());
|
||||
}
|
||||
return title;
|
||||
};
|
||||
|
@ -367,7 +367,7 @@ class ActionBar extends React.PureComponent {
|
|||
}
|
||||
};
|
||||
|
||||
cancelJobs = jobs => {
|
||||
cancelJobs = (jobs) => {
|
||||
const { notify, decisionTaskMap, currentRepo } = this.props;
|
||||
|
||||
JobModel.cancel(
|
||||
|
@ -429,7 +429,7 @@ class ActionBar extends React.PureComponent {
|
|||
</Button>
|
||||
</li>
|
||||
{isReftest(selectedJobFull) &&
|
||||
jobLogUrls.map(jobLogUrl => (
|
||||
jobLogUrls.map((jobLogUrl) => (
|
||||
<li key={`reftest-${jobLogUrl.id}`}>
|
||||
<a
|
||||
title="Launch the Reftest Analyzer in a new window"
|
||||
|
|
|
@ -66,7 +66,7 @@ export default function LogItem(props) {
|
|||
{props.children}
|
||||
</DropdownToggle>
|
||||
<DropdownMenu>
|
||||
{logUrls.map(logUrl => (
|
||||
{logUrls.map((logUrl) => (
|
||||
<DropdownItem
|
||||
tag="a"
|
||||
{...getLogUrlProps(
|
||||
|
|
|
@ -30,7 +30,7 @@ class SummaryPanel extends React.PureComponent {
|
|||
title: 'Log parsing status',
|
||||
value: !jobLogUrls.length
|
||||
? 'No logs'
|
||||
: jobLogUrls.map(log => log.parse_status).join(', '),
|
||||
: jobLogUrls.map((log) => log.parse_status).join(', '),
|
||||
},
|
||||
];
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ function RelatedBug(props) {
|
|||
<span>
|
||||
<p className="annotations-bug-header font-weight-bold">Bugs</p>
|
||||
<ul className="annotations-bug-list">
|
||||
{bugs.map(bug => (
|
||||
{bugs.map((bug) => (
|
||||
<li key={bug.bug_id}>
|
||||
<RelatedBugSaved bug={bug} deleteBug={() => deleteBug(bug)} />
|
||||
</li>
|
||||
|
@ -130,7 +130,7 @@ function AnnotationsTable(props) {
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{classifications.map(classification => (
|
||||
{classifications.map((classification) => (
|
||||
<TableRow
|
||||
key={classification.id}
|
||||
classification={classification}
|
||||
|
@ -170,7 +170,7 @@ class AnnotationsTab extends React.Component {
|
|||
if (classifications.length) {
|
||||
this.deleteClassification(classifications[0]);
|
||||
// Delete any number of bugs if they exist
|
||||
bugs.forEach(bug => {
|
||||
bugs.forEach((bug) => {
|
||||
this.deleteBug(bug);
|
||||
});
|
||||
} else {
|
||||
|
@ -178,7 +178,7 @@ class AnnotationsTab extends React.Component {
|
|||
}
|
||||
};
|
||||
|
||||
deleteClassification = classification => {
|
||||
deleteClassification = (classification) => {
|
||||
const {
|
||||
selectedJobFull,
|
||||
recalculateUnclassifiedCounts,
|
||||
|
@ -201,7 +201,7 @@ class AnnotationsTab extends React.Component {
|
|||
);
|
||||
};
|
||||
|
||||
deleteBug = bug => {
|
||||
deleteBug = (bug) => {
|
||||
const { notify } = this.props;
|
||||
|
||||
bug.destroy().then(
|
||||
|
|
|
@ -50,7 +50,7 @@ class SimilarJobsTab extends React.Component {
|
|||
offset: (page - 1) * this.pageSize,
|
||||
};
|
||||
|
||||
['filterBuildPlatformId', 'filterOptionCollectionHash'].forEach(key => {
|
||||
['filterBuildPlatformId', 'filterOptionCollectionHash'].forEach((key) => {
|
||||
if (this.state[key]) {
|
||||
const field = this.filterMap[key];
|
||||
options[field] = selectedJobFull[field];
|
||||
|
@ -66,7 +66,7 @@ class SimilarJobsTab extends React.Component {
|
|||
this.setState({ hasNextPage: newSimilarJobs.length > this.pageSize });
|
||||
newSimilarJobs.pop();
|
||||
// create an array of unique push ids
|
||||
const pushIds = [...new Set(newSimilarJobs.map(job => job.push_id))];
|
||||
const pushIds = [...new Set(newSimilarJobs.map((job) => job.push_id))];
|
||||
// get pushes and revisions for the given ids
|
||||
let pushList = { results: [] };
|
||||
const { data, failureStatus } = await PushModel.getList({
|
||||
|
@ -81,7 +81,7 @@ class SimilarJobsTab extends React.Component {
|
|||
(acc, push) => ({ ...acc, [push.id]: push }),
|
||||
{},
|
||||
);
|
||||
newSimilarJobs.forEach(simJob => {
|
||||
newSimilarJobs.forEach((simJob) => {
|
||||
simJob.result_set = pushes[simJob.push_id];
|
||||
simJob.revisionResultsetFilterUrl = getJobsUrl({
|
||||
repo: repoName,
|
||||
|
@ -116,16 +116,16 @@ class SimilarJobsTab extends React.Component {
|
|||
this.setState({ page: page + 1, isLoading: true }, this.getSimilarJobs);
|
||||
};
|
||||
|
||||
showJobInfo = job => {
|
||||
showJobInfo = (job) => {
|
||||
const { repoName, classificationMap } = this.props;
|
||||
|
||||
JobModel.get(repoName, job.id).then(nextJob => {
|
||||
JobModel.get(repoName, job.id).then((nextJob) => {
|
||||
addAggregateFields(nextJob);
|
||||
nextJob.failure_classification =
|
||||
classificationMap[nextJob.failure_classification_id];
|
||||
|
||||
// retrieve the list of error lines
|
||||
TextLogStepModel.get(nextJob.id).then(textLogSteps => {
|
||||
TextLogStepModel.get(nextJob.id).then((textLogSteps) => {
|
||||
nextJob.error_lines = textLogSteps.reduce(
|
||||
(acc, step) => [...acc, ...step.errors],
|
||||
[],
|
||||
|
@ -135,9 +135,9 @@ class SimilarJobsTab extends React.Component {
|
|||
});
|
||||
};
|
||||
|
||||
toggleFilter = filterField => {
|
||||
toggleFilter = (filterField) => {
|
||||
this.setState(
|
||||
prevState => ({
|
||||
(prevState) => ({
|
||||
[filterField]: !prevState[filterField],
|
||||
similarJobs: [],
|
||||
isLoading: true,
|
||||
|
@ -177,7 +177,7 @@ class SimilarJobsTab extends React.Component {
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{similarJobs.map(similarJob => (
|
||||
{similarJobs.map((similarJob) => (
|
||||
<tr
|
||||
key={similarJob.id}
|
||||
onClick={() => this.showJobInfo(similarJob)}
|
||||
|
@ -297,7 +297,7 @@ class SimilarJobsTab extends React.Component {
|
|||
<tr>
|
||||
<td colSpan={2}>
|
||||
<ul className="list-unstyled error_list">
|
||||
{selectedSimilarJob.error_lines.map(error => (
|
||||
{selectedSimilarJob.error_lines.map((error) => (
|
||||
<li key={error.id}>
|
||||
<small title={error.line}>{error.line}</small>
|
||||
</li>
|
||||
|
|
|
@ -85,11 +85,11 @@ class TabsPanel extends React.Component {
|
|||
|
||||
static getTabNames(showPerf) {
|
||||
return ['details', 'failure', 'annotations', 'similar', 'perf'].filter(
|
||||
name => !(name === 'perf' && !showPerf),
|
||||
(name) => !(name === 'perf' && !showPerf),
|
||||
);
|
||||
}
|
||||
|
||||
setTabIndex = tabIndex => {
|
||||
setTabIndex = (tabIndex) => {
|
||||
this.setState({ tabIndex });
|
||||
};
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ class FailureSummaryTab extends React.Component {
|
|||
};
|
||||
}
|
||||
|
||||
fileBug = suggestion => {
|
||||
fileBug = (suggestion) => {
|
||||
const { selectedJobFull, pinJob } = this.props;
|
||||
|
||||
pinJob(selectedJobFull);
|
||||
|
@ -34,10 +34,12 @@ class FailureSummaryTab extends React.Component {
|
|||
};
|
||||
|
||||
toggleBugFiler = () => {
|
||||
this.setState(prevState => ({ isBugFilerOpen: !prevState.isBugFilerOpen }));
|
||||
this.setState((prevState) => ({
|
||||
isBugFilerOpen: !prevState.isBugFilerOpen,
|
||||
}));
|
||||
};
|
||||
|
||||
bugFilerCallback = data => {
|
||||
bugFilerCallback = (data) => {
|
||||
const { addBug } = this.props;
|
||||
|
||||
addBug({ id: data.success });
|
||||
|
@ -59,7 +61,9 @@ class FailureSummaryTab extends React.Component {
|
|||
} = this.props;
|
||||
const { isBugFilerOpen, suggestion } = this.state;
|
||||
const logs = jobLogUrls;
|
||||
const jobLogsAllParsed = logs.every(jlu => jlu.parse_status !== 'pending');
|
||||
const jobLogsAllParsed = logs.every(
|
||||
(jlu) => jlu.parse_status !== 'pending',
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="w-100 h-100" role="region" aria-label="Failure Summary">
|
||||
|
@ -99,7 +103,7 @@ class FailureSummaryTab extends React.Component {
|
|||
|
||||
{!bugSuggestionsLoading &&
|
||||
!jobLogsAllParsed &&
|
||||
logs.map(jobLog => (
|
||||
logs.map((jobLog) => (
|
||||
<li key={jobLog.id}>
|
||||
<p className="failure-summary-line-empty mb-0">
|
||||
Log parsing in progress.
|
||||
|
|
|
@ -17,7 +17,7 @@ export default class SuggestionsListItem extends React.Component {
|
|||
}
|
||||
|
||||
clickShowMore = () => {
|
||||
this.setState(prevState => ({
|
||||
this.setState((prevState) => ({
|
||||
suggestionShowMore: !prevState.suggestionShowMore,
|
||||
}));
|
||||
};
|
||||
|
@ -44,7 +44,7 @@ export default class SuggestionsListItem extends React.Component {
|
|||
{/* <!--Open recent bugs--> */}
|
||||
{suggestion.valid_open_recent && (
|
||||
<ul className="list-unstyled failure-summary-bugs">
|
||||
{suggestion.bugs.open_recent.map(bug => (
|
||||
{suggestion.bugs.open_recent.map((bug) => (
|
||||
<BugListItem
|
||||
key={bug.id}
|
||||
bug={bug}
|
||||
|
@ -70,7 +70,7 @@ export default class SuggestionsListItem extends React.Component {
|
|||
{suggestion.valid_all_others &&
|
||||
(suggestionShowMore || !suggestion.valid_open_recent) && (
|
||||
<ul className="list-unstyled failure-summary-bugs">
|
||||
{suggestion.bugs.all_others.map(bug => (
|
||||
{suggestion.bugs.all_others.map((bug) => (
|
||||
<BugListItem
|
||||
key={bug.id}
|
||||
bug={bug}
|
||||
|
|
|
@ -26,7 +26,7 @@ export default class ActiveFilters extends React.Component {
|
|||
return { fieldChoices };
|
||||
}
|
||||
|
||||
setNewFilterField = field => {
|
||||
setNewFilterField = (field) => {
|
||||
const { fieldChoices } = this.state;
|
||||
this.setState({
|
||||
newFilterField: field,
|
||||
|
@ -35,14 +35,14 @@ export default class ActiveFilters extends React.Component {
|
|||
});
|
||||
};
|
||||
|
||||
setNewFilterValue = value => {
|
||||
setNewFilterValue = (value) => {
|
||||
this.setState({ newFilterValue: value });
|
||||
};
|
||||
|
||||
getFilterValue(field, value) {
|
||||
const { fieldChoices } = this.state;
|
||||
const choice = fieldChoices[field];
|
||||
const choiceValue = choice.choices.find(c => String(c.id) === value);
|
||||
const choiceValue = choice.choices.find((c) => String(c.id) === value);
|
||||
|
||||
return choice.matchType === 'choice' && choiceValue
|
||||
? choiceValue.name
|
||||
|
@ -99,8 +99,8 @@ export default class ActiveFilters extends React.Component {
|
|||
<span className="active-filters-title">
|
||||
<b>Active Filters</b>
|
||||
</span>
|
||||
{filterBarFilters.map(filter =>
|
||||
filter.value.map(filterValue => (
|
||||
{filterBarFilters.map((filter) =>
|
||||
filter.value.map((filterValue) => (
|
||||
<span
|
||||
className="filtersbar-filter"
|
||||
key={`${filter.field}${filterValue}`}
|
||||
|
@ -153,7 +153,7 @@ export default class ActiveFilters extends React.Component {
|
|||
id="job-filter-field"
|
||||
className="form-control"
|
||||
value={newFilterField}
|
||||
onChange={evt => this.setNewFilterField(evt.target.value)}
|
||||
onChange={(evt) => this.setNewFilterField(evt.target.value)}
|
||||
placeholder="filter field"
|
||||
aria-label="Field"
|
||||
required
|
||||
|
@ -174,7 +174,9 @@ export default class ActiveFilters extends React.Component {
|
|||
<input
|
||||
className="form-control"
|
||||
value={newFilterValue}
|
||||
onChange={evt => this.setNewFilterValue(evt.target.value)}
|
||||
onChange={(evt) =>
|
||||
this.setNewFilterValue(evt.target.value)
|
||||
}
|
||||
id="job-filter-value"
|
||||
type="text"
|
||||
required
|
||||
|
@ -187,7 +189,7 @@ export default class ActiveFilters extends React.Component {
|
|||
<select
|
||||
className="form-control"
|
||||
value={newFilterValue}
|
||||
onChange={evt => this.setNewFilterValue(evt.target.value)}
|
||||
onChange={(evt) => this.setNewFilterValue(evt.target.value)}
|
||||
id="job-filter-choice-value"
|
||||
aria-label="Value"
|
||||
>
|
||||
|
|
|
@ -16,7 +16,7 @@ import { setSelectedJob, clearSelectedJob } from '../redux/stores/selectedJob';
|
|||
import { pinJobs } from '../redux/stores/pinnedJobs';
|
||||
|
||||
const resultStatusMenuItems = thAllResultStatuses.filter(
|
||||
rs => rs !== 'runnable',
|
||||
(rs) => rs !== 'runnable',
|
||||
);
|
||||
|
||||
function FiltersMenu(props) {
|
||||
|
@ -52,7 +52,7 @@ function FiltersMenu(props) {
|
|||
Filters
|
||||
</DropdownToggle>
|
||||
<DropdownMenu>
|
||||
{resultStatusMenuItems.map(filterName => (
|
||||
{resultStatusMenuItems.map((filterName) => (
|
||||
<DropdownItem
|
||||
key={filterName}
|
||||
tag="a"
|
||||
|
|
|
@ -16,7 +16,7 @@ class HealthMenu extends PureComponent {
|
|||
}
|
||||
|
||||
toggle = () => {
|
||||
this.setState(prevState => ({
|
||||
this.setState((prevState) => ({
|
||||
dropdownOpen: !prevState.dropdownOpen,
|
||||
}));
|
||||
};
|
||||
|
|
|
@ -63,7 +63,7 @@ class NotificationsMenu extends React.Component {
|
|||
)}
|
||||
</DropdownItem>
|
||||
{storedNotifications.length ? (
|
||||
storedNotifications.map(notification => (
|
||||
storedNotifications.map((notification) => (
|
||||
<DropdownItem
|
||||
className="pl-0 notification-dropdown-line"
|
||||
key={`${notification.created}${notification.message}`}
|
||||
|
|
|
@ -33,13 +33,13 @@ const DEV_GROUP_ORDER = {
|
|||
export default function ReposMenu(props) {
|
||||
const { repos } = props;
|
||||
const groups = repos.reduce(
|
||||
(acc, repo, idx, arr, group = repo => repo.repository_group.name) => ({
|
||||
(acc, repo, idx, arr, group = (repo) => repo.repository_group.name) => ({
|
||||
...acc,
|
||||
[group(repo)]: [...(acc[group(repo)] || []), repo],
|
||||
}),
|
||||
{},
|
||||
);
|
||||
const groupedRepos = GROUP_ORDER.map(name => ({
|
||||
const groupedRepos = GROUP_ORDER.map((name) => ({
|
||||
name,
|
||||
repos: groups[name]
|
||||
? groups[name].sort((a, b) =>
|
||||
|
@ -66,7 +66,7 @@ export default function ReposMenu(props) {
|
|||
aria-haspopup="true"
|
||||
aria-expanded="false"
|
||||
>
|
||||
{groupedRepos.map(group => (
|
||||
{groupedRepos.map((group) => (
|
||||
<DropdownItem
|
||||
className="repogroup dropdown-item col"
|
||||
key={group.name}
|
||||
|
@ -80,7 +80,7 @@ export default function ReposMenu(props) {
|
|||
<FontAwesomeIcon icon={faInfoCircle} title={group.name} />
|
||||
</li>
|
||||
{!!group.repos &&
|
||||
group.repos.map(repo => (
|
||||
group.repos.map((repo) => (
|
||||
<li key={repo.name}>
|
||||
<a
|
||||
title="Open repo"
|
||||
|
|
|
@ -66,7 +66,7 @@ class SecondaryNavBar extends React.PureComponent {
|
|||
this.setState({ searchQueryStr: ev.target.value });
|
||||
}
|
||||
|
||||
handleUrlChanges = evt => {
|
||||
handleUrlChanges = (evt) => {
|
||||
const { oldURL, newURL } = evt;
|
||||
const { repoName } = this.state;
|
||||
const { recalculateUnclassifiedCounts } = this.props;
|
||||
|
@ -85,7 +85,7 @@ class SecondaryNavBar extends React.PureComponent {
|
|||
});
|
||||
};
|
||||
|
||||
search = ev => {
|
||||
search = (ev) => {
|
||||
const { filterModel } = this.props;
|
||||
const { value } = ev.target;
|
||||
|
||||
|
@ -99,12 +99,12 @@ class SecondaryNavBar extends React.PureComponent {
|
|||
}
|
||||
};
|
||||
|
||||
isFilterOn = filter => {
|
||||
isFilterOn = (filter) => {
|
||||
const { filterModel } = this.props;
|
||||
const { resultStatus } = filterModel.urlParams;
|
||||
|
||||
if (filter in thFilterGroups) {
|
||||
return thFilterGroups[filter].some(val => resultStatus.includes(val));
|
||||
return thFilterGroups[filter].some((val) => resultStatus.includes(val));
|
||||
}
|
||||
return resultStatus.includes(filter);
|
||||
};
|
||||
|
@ -113,7 +113,7 @@ class SecondaryNavBar extends React.PureComponent {
|
|||
* Handle toggling one of the individual result status filter chicklets
|
||||
* on the nav bar
|
||||
*/
|
||||
toggleResultStatusFilterChicklet = filter => {
|
||||
toggleResultStatusFilterChicklet = (filter) => {
|
||||
const { filterModel } = this.props;
|
||||
const filterValues =
|
||||
filter in thFilterGroups
|
||||
|
@ -149,10 +149,10 @@ class SecondaryNavBar extends React.PureComponent {
|
|||
filterModel.removeFilter('searchStr');
|
||||
};
|
||||
|
||||
unwatchRepo = name => {
|
||||
unwatchRepo = (name) => {
|
||||
const { watchedRepoNames } = this.state;
|
||||
|
||||
this.saveWatchedRepos(watchedRepoNames.filter(repo => repo !== name));
|
||||
this.saveWatchedRepos(watchedRepoNames.filter((repo) => repo !== name));
|
||||
};
|
||||
|
||||
loadWatchedRepos() {
|
||||
|
@ -164,7 +164,7 @@ class SecondaryNavBar extends React.PureComponent {
|
|||
// Ensure the current repo is first in the list
|
||||
const watchedRepoNames = [
|
||||
repoName,
|
||||
...storedWatched.filter(value => value !== repoName),
|
||||
...storedWatched.filter((value) => value !== repoName),
|
||||
].slice(0, MAX_WATCHED_REPOS);
|
||||
|
||||
// Re-save the list, in case it has now changed
|
||||
|
@ -205,8 +205,8 @@ class SecondaryNavBar extends React.PureComponent {
|
|||
const watchedRepos =
|
||||
(repos.length &&
|
||||
watchedRepoNames
|
||||
.map(name => RepositoryModel.getRepo(name, repos))
|
||||
.filter(name => name)) ||
|
||||
.map((name) => RepositoryModel.getRepo(name, repos))
|
||||
.filter((name) => name)) ||
|
||||
[];
|
||||
|
||||
return (
|
||||
|
@ -217,7 +217,7 @@ class SecondaryNavBar extends React.PureComponent {
|
|||
>
|
||||
<span className="justify-content-between w-100 d-flex flex-wrap">
|
||||
<span className="d-flex push-left watched-repos">
|
||||
{watchedRepos.map(watchedRepo => (
|
||||
{watchedRepos.map((watchedRepo) => (
|
||||
<ErrorBoundary
|
||||
errorClasses="pl-1 pr-1 btn-view-nav border-right"
|
||||
message={`Error watching ${watchedRepo.name}: `}
|
||||
|
@ -315,7 +315,7 @@ class SecondaryNavBar extends React.PureComponent {
|
|||
{/* Result Status Filter Chicklets */}
|
||||
<span className="resultStatusChicklets">
|
||||
<span id="filter-chicklets">
|
||||
{this.filterChicklets.map(filterName => {
|
||||
{this.filterChicklets.map((filterName) => {
|
||||
const isOn = this.isFilterOn(filterName);
|
||||
return (
|
||||
<span key={filterName}>
|
||||
|
@ -368,8 +368,8 @@ class SecondaryNavBar extends React.PureComponent {
|
|||
required
|
||||
value={searchQueryStr}
|
||||
title="Click to enter filter values"
|
||||
onChange={evt => this.setSearchStr(evt)}
|
||||
onKeyDown={evt => this.search(evt)}
|
||||
onChange={(evt) => this.setSearchStr(evt)}
|
||||
onKeyDown={(evt) => this.search(evt)}
|
||||
type="text"
|
||||
placeholder="Filter platforms & jobs"
|
||||
/>
|
||||
|
|
|
@ -10,7 +10,7 @@ export default function TierIndicator(props) {
|
|||
|
||||
return (
|
||||
<ButtonGroup>
|
||||
{TIERS.map(tier => {
|
||||
{TIERS.map((tier) => {
|
||||
const isOnlyTier = shownTiers.length === 1 && tier === shownTiers[0];
|
||||
return (
|
||||
<Button
|
||||
|
|
|
@ -25,7 +25,7 @@ export default function TiersMenu(props) {
|
|||
Tiers
|
||||
</DropdownToggle>
|
||||
<DropdownMenu>
|
||||
{TIERS.map(tier => {
|
||||
{TIERS.map((tier) => {
|
||||
const isOnlyTier = shownTiers.length === 1 && tier === shownTiers[0];
|
||||
return (
|
||||
<DropdownItem
|
||||
|
|
|
@ -102,7 +102,7 @@ export default class WatchedRepo extends React.Component {
|
|||
});
|
||||
clearInterval(this.treeStatusIntervalId);
|
||||
} else {
|
||||
TreeStatusModel.get(watchedRepoName).then(data => {
|
||||
TreeStatusModel.get(watchedRepoName).then((data) => {
|
||||
const treeStatus = data.result;
|
||||
|
||||
if (watchedRepoName === repoName) {
|
||||
|
|
|
@ -39,7 +39,7 @@ class FuzzyJobFinder extends React.Component {
|
|||
* Only actually do the filtering when `enter` is pressed, as filtering 13K DOM elements is slow...
|
||||
* If this input is empty when `enter` is pressed, reset back to the full list of runnable jobs.
|
||||
*/
|
||||
filterJobs = ev => {
|
||||
filterJobs = (ev) => {
|
||||
// By default we show a trimmed down list of runnable jobs, but there's an option to show the full list
|
||||
let currentList;
|
||||
if (this.state.useFullList) {
|
||||
|
@ -62,7 +62,7 @@ class FuzzyJobFinder extends React.Component {
|
|||
// Always search from the full (or full filtered) list of jobs
|
||||
const fuse = new Fuse(currentList, options);
|
||||
|
||||
this.setState(prevState => ({
|
||||
this.setState((prevState) => ({
|
||||
fuzzyList: prevState.fuzzySearch
|
||||
? fuse.search(prevState.fuzzySearch)
|
||||
: currentList,
|
||||
|
@ -87,7 +87,7 @@ class FuzzyJobFinder extends React.Component {
|
|||
addAllJobs = () => {
|
||||
const selectedOptions = Array.from(
|
||||
this.state.fuzzyList,
|
||||
option => option.name,
|
||||
(option) => option.name,
|
||||
);
|
||||
let { selectedList } = this.state;
|
||||
|
||||
|
@ -103,7 +103,7 @@ class FuzzyJobFinder extends React.Component {
|
|||
});
|
||||
};
|
||||
|
||||
addJobs = evt => {
|
||||
addJobs = (evt) => {
|
||||
const { selectedList } = this.state;
|
||||
const { addJobsSelected } = this.state;
|
||||
|
||||
|
@ -120,7 +120,7 @@ class FuzzyJobFinder extends React.Component {
|
|||
const { removeJobsSelected } = this.state;
|
||||
|
||||
const newSelectedList = selectedList.filter(
|
||||
value => !removeJobsSelected.includes(value),
|
||||
(value) => !removeJobsSelected.includes(value),
|
||||
);
|
||||
|
||||
this.setState({ selectedList: newSelectedList }, () => {
|
||||
|
@ -142,11 +142,11 @@ class FuzzyJobFinder extends React.Component {
|
|||
this.props.decisionTaskId,
|
||||
this.props.currentRepo,
|
||||
)
|
||||
.then(result => {
|
||||
.then((result) => {
|
||||
notify(result, 'success');
|
||||
this.props.toggle();
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
notify(formatTaskclusterError(e), 'danger', { sticky: true });
|
||||
this.setState({
|
||||
submitDisabled: false,
|
||||
|
@ -157,7 +157,7 @@ class FuzzyJobFinder extends React.Component {
|
|||
}
|
||||
};
|
||||
|
||||
toggleFullList = evt => {
|
||||
toggleFullList = (evt) => {
|
||||
this.setState(
|
||||
{
|
||||
useFullList: evt.target.checked,
|
||||
|
@ -173,10 +173,10 @@ class FuzzyJobFinder extends React.Component {
|
|||
);
|
||||
};
|
||||
|
||||
updateAddButton = evt => {
|
||||
updateAddButton = (evt) => {
|
||||
const selectedOptions = Array.from(
|
||||
evt.target.selectedOptions,
|
||||
option => option.textContent,
|
||||
(option) => option.textContent,
|
||||
);
|
||||
|
||||
this.setState({
|
||||
|
@ -185,10 +185,10 @@ class FuzzyJobFinder extends React.Component {
|
|||
});
|
||||
};
|
||||
|
||||
updateRemoveButton = evt => {
|
||||
updateRemoveButton = (evt) => {
|
||||
const selectedOptions = Array.from(
|
||||
evt.target.selectedOptions,
|
||||
option => option.textContent,
|
||||
(option) => option.textContent,
|
||||
);
|
||||
this.setState({
|
||||
removeDisabled: selectedOptions.length === 0,
|
||||
|
@ -222,7 +222,7 @@ class FuzzyJobFinder extends React.Component {
|
|||
<Col sm={2}>
|
||||
<Label
|
||||
className="my-3"
|
||||
onChange={evt => this.toggleFullList(evt)}
|
||||
onChange={(evt) => this.toggleFullList(evt)}
|
||||
title="The full list includes thousands of jobs that don't typically get run, and is much slower to render"
|
||||
>
|
||||
<Input type="checkbox" /> Use full job list
|
||||
|
@ -245,7 +245,7 @@ class FuzzyJobFinder extends React.Component {
|
|||
</div>
|
||||
<InputGroup id="addJobsGroup">
|
||||
<Input type="select" multiple onChange={this.updateAddButton}>
|
||||
{this.state.fuzzyList.sort(sortAlphaNum).map(e => (
|
||||
{this.state.fuzzyList.sort(sortAlphaNum).map((e) => (
|
||||
<option
|
||||
title={`${e.name} - ${e.groupsymbol}(${e.symbol})`}
|
||||
key={e.name}
|
||||
|
@ -279,7 +279,7 @@ class FuzzyJobFinder extends React.Component {
|
|||
</div>
|
||||
<InputGroup id="removeJobsGroup">
|
||||
<Input type="select" multiple onChange={this.updateRemoveButton}>
|
||||
{this.state.selectedList.sort(sortAlphaNum).map(e => (
|
||||
{this.state.selectedList.sort(sortAlphaNum).map((e) => (
|
||||
<option title={e} key={e}>
|
||||
{e}
|
||||
</option>
|
||||
|
|
|
@ -68,7 +68,7 @@ export default class JobButtonComponent extends React.Component {
|
|||
}
|
||||
|
||||
toggleRunnableSelected() {
|
||||
this.setState(prevState => ({
|
||||
this.setState((prevState) => ({
|
||||
isRunnableSelected: !prevState.isRunnableSelected,
|
||||
}));
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ export class JobGroupComponent extends React.Component {
|
|||
}
|
||||
|
||||
toggleExpanded = () => {
|
||||
this.setState(prevState => ({ expanded: !prevState.expanded }));
|
||||
this.setState((prevState) => ({ expanded: !prevState.expanded }));
|
||||
};
|
||||
|
||||
groupButtonsAndCounts(jobs, expanded) {
|
||||
|
@ -71,7 +71,7 @@ export class JobGroupComponent extends React.Component {
|
|||
} else {
|
||||
const stateCounts = {};
|
||||
const typeSymbolCounts = countBy(jobs, 'job_type_symbol');
|
||||
jobs.forEach(job => {
|
||||
jobs.forEach((job) => {
|
||||
const { resultStatus, visible } = job;
|
||||
const btnClass = getBtnClass(resultStatus);
|
||||
if (!visible) return;
|
||||
|
@ -139,7 +139,7 @@ export class JobGroupComponent extends React.Component {
|
|||
/>
|
||||
<span className="group-content">
|
||||
<span className="group-job-list">
|
||||
{buttons.map(job => (
|
||||
{buttons.map((job) => (
|
||||
<JobButton
|
||||
job={job}
|
||||
filterModel={filterModel}
|
||||
|
@ -153,7 +153,7 @@ export class JobGroupComponent extends React.Component {
|
|||
))}
|
||||
</span>
|
||||
<span className="group-count-list">
|
||||
{counts.map(countInfo => (
|
||||
{counts.map((countInfo) => (
|
||||
<JobCount
|
||||
count={countInfo.count}
|
||||
onClick={this.toggleExpanded}
|
||||
|
|
|
@ -18,7 +18,7 @@ export default class JobsAndGroups extends React.Component {
|
|||
|
||||
return (
|
||||
<td className="job-row">
|
||||
{groups.map(group => {
|
||||
{groups.map((group) => {
|
||||
if (group.tier !== 1 || group.symbol !== '') {
|
||||
return (
|
||||
group.visible && (
|
||||
|
@ -35,7 +35,7 @@ export default class JobsAndGroups extends React.Component {
|
|||
)
|
||||
);
|
||||
}
|
||||
return group.jobs.map(job => (
|
||||
return group.jobs.map((job) => (
|
||||
<JobButton
|
||||
job={job}
|
||||
filterModel={filterModel}
|
||||
|
|
|
@ -50,14 +50,14 @@ export default class Platform extends React.PureComponent {
|
|||
}
|
||||
}
|
||||
|
||||
filter = selectedTaskRun => {
|
||||
filter = (selectedTaskRun) => {
|
||||
const { platform, filterModel, runnableVisible } = this.props;
|
||||
const filteredPlatform = { ...platform };
|
||||
|
||||
filteredPlatform.visible = false;
|
||||
filteredPlatform.groups.forEach(group => {
|
||||
filteredPlatform.groups.forEach((group) => {
|
||||
group.visible = false;
|
||||
group.jobs.forEach(job => {
|
||||
group.jobs.forEach((job) => {
|
||||
job.visible =
|
||||
filterModel.showJob(job) || job.task_run === selectedTaskRun;
|
||||
if (job.state === 'runnable') {
|
||||
|
@ -75,7 +75,7 @@ export default class Platform extends React.PureComponent {
|
|||
this.setState({ filteredPlatform });
|
||||
};
|
||||
|
||||
filterCb = selectedTaskRun => {
|
||||
filterCb = (selectedTaskRun) => {
|
||||
this.filter(selectedTaskRun);
|
||||
};
|
||||
|
||||
|
|
|
@ -43,11 +43,11 @@ export const joinArtifacts = (manifestsByTask, testsByManifest) => {
|
|||
// e.g. testPath: devtools/client/framework/browser-toolbox/test/browser_browser_toolbox_debugger.js
|
||||
const taskNameToTestPaths = {};
|
||||
Object.entries(manifestsByTask).forEach(([taskName, manifetsts]) => {
|
||||
manifetsts.forEach(manifest => {
|
||||
manifetsts.forEach((manifest) => {
|
||||
const splitPath = manifest.split('/');
|
||||
const basePath = splitPath.splice(0, splitPath.length - 1).join('/');
|
||||
taskNameToTestPaths[taskName] = taskNameToTestPaths[taskName] || [];
|
||||
(testsByManifest[manifest] || []).forEach(test => {
|
||||
(testsByManifest[manifest] || []).forEach((test) => {
|
||||
taskNameToTestPaths[taskName].push(`${basePath}/${test}`);
|
||||
});
|
||||
taskNameToTestPaths[taskName].push(manifest);
|
||||
|
@ -129,7 +129,7 @@ class Push extends React.PureComponent {
|
|||
|
||||
getJobCount(jobList) {
|
||||
const filteredByCommit = jobList.filter(
|
||||
job => job.failure_classification_id === 2,
|
||||
(job) => job.failure_classification_id === 2,
|
||||
);
|
||||
|
||||
return jobList.reduce(
|
||||
|
@ -182,7 +182,7 @@ class Push extends React.PureComponent {
|
|||
const filterParams = ['revision', 'author'];
|
||||
const urlParams = getAllUrlParams();
|
||||
const filteredTryPush =
|
||||
filterParams.some(f => urlParams.has(f)) && currentRepo.name === 'try';
|
||||
filterParams.some((f) => urlParams.has(f)) && currentRepo.name === 'try';
|
||||
|
||||
this.setState({ filteredTryPush });
|
||||
};
|
||||
|
@ -200,7 +200,7 @@ class Push extends React.PureComponent {
|
|||
this.setState({ collapsed: collapsedPushes.includes(push.id) });
|
||||
};
|
||||
|
||||
handleApplyNewJobs = event => {
|
||||
handleApplyNewJobs = (event) => {
|
||||
const { push } = this.props;
|
||||
const { jobs } = event.detail;
|
||||
const jobList = jobs[push.id];
|
||||
|
@ -210,7 +210,7 @@ class Push extends React.PureComponent {
|
|||
}
|
||||
};
|
||||
|
||||
toggleSelectedRunnableJob = signature => {
|
||||
toggleSelectedRunnableJob = (signature) => {
|
||||
const { selectedRunnableJobs } = this.state;
|
||||
const jobIndex = selectedRunnableJobs.indexOf(signature);
|
||||
|
||||
|
@ -276,11 +276,11 @@ class Push extends React.PureComponent {
|
|||
push.jobsLoaded = true;
|
||||
if (jobs.length > 0) {
|
||||
const { jobList } = this.state;
|
||||
const newIds = jobs.map(job => job.id);
|
||||
const newIds = jobs.map((job) => job.id);
|
||||
// remove old versions of jobs we just fetched.
|
||||
const existingJobs = jobList.filter(job => !newIds.includes(job.id));
|
||||
const existingJobs = jobList.filter((job) => !newIds.includes(job.id));
|
||||
// Join both lists and add test_paths and task_run property
|
||||
const newJobList = [...existingJobs, ...jobs].map(job => {
|
||||
const newJobList = [...existingJobs, ...jobs].map((job) => {
|
||||
job.test_paths = taskNameToTestPaths[job.job_type_name] || [];
|
||||
job.task_run = getTaskRunStr(job);
|
||||
return job;
|
||||
|
@ -305,17 +305,17 @@ class Push extends React.PureComponent {
|
|||
/*
|
||||
* Convert a flat list of jobs into a structure grouped by platform and job_group.
|
||||
*/
|
||||
groupJobByPlatform = jobList => {
|
||||
groupJobByPlatform = (jobList) => {
|
||||
const platforms = [];
|
||||
|
||||
if (jobList.length === 0) {
|
||||
return platforms;
|
||||
}
|
||||
jobList.forEach(job => {
|
||||
jobList.forEach((job) => {
|
||||
// search for the right platform
|
||||
const platformName = thPlatformMap[job.platform] || job.platform;
|
||||
let platform = platforms.find(
|
||||
platform =>
|
||||
(platform) =>
|
||||
platformName === platform.name &&
|
||||
job.platform_option === platform.option,
|
||||
);
|
||||
|
@ -331,7 +331,7 @@ class Push extends React.PureComponent {
|
|||
const groupInfo = this.getJobGroupInfo(job);
|
||||
// search for the right group
|
||||
let group = platform.groups.find(
|
||||
group =>
|
||||
(group) =>
|
||||
groupInfo.symbol === group.symbol && groupInfo.tier === group.tier,
|
||||
);
|
||||
if (group === undefined) {
|
||||
|
@ -343,10 +343,10 @@ class Push extends React.PureComponent {
|
|||
return platforms;
|
||||
};
|
||||
|
||||
sortGroupedJobs = platforms => {
|
||||
platforms.forEach(platform => {
|
||||
platform.groups.forEach(group => {
|
||||
group.jobs = sortBy(group.jobs, job =>
|
||||
sortGroupedJobs = (platforms) => {
|
||||
platforms.forEach((platform) => {
|
||||
platform.groups.forEach((group) => {
|
||||
group.jobs = sortBy(group.jobs, (job) =>
|
||||
// Symbol could be something like 1, 2 or 3. Or A, B, C or R1, R2, R10.
|
||||
// So this will pad the numeric portion with 0s like R001, R010, etc.
|
||||
job.job_type_symbol.replace(/([\D]*)([\d]*)/g, (matcher, s1, s2) =>
|
||||
|
@ -367,7 +367,7 @@ class Push extends React.PureComponent {
|
|||
return platforms;
|
||||
};
|
||||
|
||||
expandAllPushGroups = callback => {
|
||||
expandAllPushGroups = (callback) => {
|
||||
// This sets the group state once, then unsets it in the callback. This
|
||||
// has the result of triggering an expand on all the groups, but then
|
||||
// gives control back to each group to decide to expand or not.
|
||||
|
@ -377,7 +377,7 @@ class Push extends React.PureComponent {
|
|||
});
|
||||
};
|
||||
|
||||
showUpdateNotifications = prevState => {
|
||||
showUpdateNotifications = (prevState) => {
|
||||
const { watched, jobCounts } = this.state;
|
||||
const {
|
||||
currentRepo,
|
||||
|
@ -417,11 +417,11 @@ class Push extends React.PureComponent {
|
|||
tag: pushId,
|
||||
});
|
||||
|
||||
notification.onerror = event => {
|
||||
notification.onerror = (event) => {
|
||||
notify(`${event.target.title}: ${event.target.body}`, 'danger');
|
||||
};
|
||||
|
||||
notification.onclick = event => {
|
||||
notification.onclick = (event) => {
|
||||
if (this.container) {
|
||||
this.container.scrollIntoView();
|
||||
event.target.close();
|
||||
|
@ -455,7 +455,7 @@ class Push extends React.PureComponent {
|
|||
|
||||
hideRunnableJobs = () => {
|
||||
const { jobList } = this.state;
|
||||
const newJobList = jobList.filter(job => job.state !== 'runnable');
|
||||
const newJobList = jobList.filter((job) => job.state !== 'runnable');
|
||||
|
||||
this.setState(
|
||||
{
|
||||
|
@ -487,7 +487,7 @@ class Push extends React.PureComponent {
|
|||
});
|
||||
fuzzyJobList = [
|
||||
...new Set(
|
||||
fuzzyJobList.map(job => {
|
||||
fuzzyJobList.map((job) => {
|
||||
const obj = {};
|
||||
obj.name = job.job_type_name;
|
||||
obj.symbol = job.job_type_symbol;
|
||||
|
@ -497,7 +497,7 @@ class Push extends React.PureComponent {
|
|||
),
|
||||
].sort((a, b) => (a.name > b.name ? 1 : -1));
|
||||
const filteredFuzzyList = fuzzyJobList.filter(
|
||||
job => job.name.search(excludedJobNames) < 0,
|
||||
(job) => job.name.search(excludedJobNames) < 0,
|
||||
);
|
||||
this.setState({
|
||||
fuzzyJobList,
|
||||
|
@ -535,13 +535,13 @@ class Push extends React.PureComponent {
|
|||
};
|
||||
|
||||
toggleFuzzyModal = async () => {
|
||||
this.setState(prevState => ({
|
||||
this.setState((prevState) => ({
|
||||
fuzzyModal: !prevState.fuzzyModal,
|
||||
jobList: prevState.jobList,
|
||||
}));
|
||||
};
|
||||
|
||||
pushHealthStatusCallback = pushHealthStatus => {
|
||||
pushHealthStatusCallback = (pushHealthStatus) => {
|
||||
this.setState({ pushHealthStatus });
|
||||
};
|
||||
|
||||
|
@ -592,7 +592,7 @@ class Push extends React.PureComponent {
|
|||
<div
|
||||
className="push"
|
||||
data-testid={`push-${push.id}`}
|
||||
ref={ref => {
|
||||
ref={(ref) => {
|
||||
this.container = ref;
|
||||
}}
|
||||
>
|
||||
|
|
|
@ -81,7 +81,7 @@ class PushActionMenu extends React.PureComponent {
|
|||
notify,
|
||||
decisionTask,
|
||||
currentRepo,
|
||||
).catch(e => {
|
||||
).catch((e) => {
|
||||
notify(formatTaskclusterError(e), 'danger', { sticky: true });
|
||||
});
|
||||
};
|
||||
|
|
|
@ -162,12 +162,12 @@ class PushHeader extends React.Component {
|
|||
const { id: decisionTaskId } = decisionTaskMap[pushId];
|
||||
|
||||
PushModel.triggerNewJobs(selectedRunnableJobs, decisionTaskId, currentRepo)
|
||||
.then(result => {
|
||||
.then((result) => {
|
||||
notify(result, 'success');
|
||||
hideRunnableJobs(pushId);
|
||||
this.props.hideRunnableJobs();
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
notify(formatTaskclusterError(e), 'danger', { sticky: true });
|
||||
});
|
||||
};
|
||||
|
|
|
@ -35,7 +35,7 @@ class PushJobs extends React.Component {
|
|||
]);
|
||||
}
|
||||
|
||||
onMouseDown = ev => {
|
||||
onMouseDown = (ev) => {
|
||||
const { togglePinJob } = this.props;
|
||||
const jobInstance = findInstance(ev.target);
|
||||
const selectedTaskRun = getUrlParam('selectedTaskRun');
|
||||
|
@ -77,10 +77,10 @@ class PushJobs extends React.Component {
|
|||
setSelectedJob(job);
|
||||
};
|
||||
|
||||
handleLogViewerClick = jobId => {
|
||||
handleLogViewerClick = (jobId) => {
|
||||
// Open logviewer in a new window
|
||||
const { repoName } = this.props;
|
||||
JobModel.get(repoName, jobId).then(data => {
|
||||
JobModel.get(repoName, jobId).then((data) => {
|
||||
if (data.logs.length > 0) {
|
||||
window.open(
|
||||
`${window.location.origin}/${getLogViewerUrl(jobId, repoName)}`,
|
||||
|
@ -89,7 +89,7 @@ class PushJobs extends React.Component {
|
|||
});
|
||||
};
|
||||
|
||||
handleRunnableClick = jobInstance => {
|
||||
handleRunnableClick = (jobInstance) => {
|
||||
const { toggleSelectedRunnableJob } = this.props;
|
||||
|
||||
toggleSelectedRunnableJob(jobInstance.props.job.signature);
|
||||
|
@ -112,7 +112,7 @@ class PushJobs extends React.Component {
|
|||
<table id={this.aggregateId} className="table-hover">
|
||||
<tbody>
|
||||
{platforms ? (
|
||||
platforms.map(platform => (
|
||||
platforms.map((platform) => (
|
||||
<Platform
|
||||
platform={platform}
|
||||
repoName={repoName}
|
||||
|
|
|
@ -68,7 +68,7 @@ class PushList extends React.Component {
|
|||
document.title = `[${allUnclassifiedFailureCount}] ${repoName}`;
|
||||
}
|
||||
|
||||
getUrlRangeValues = url => {
|
||||
getUrlRangeValues = (url) => {
|
||||
const params = [...new URLSearchParams(url.split('?')[1]).entries()];
|
||||
|
||||
return params.reduce((acc, [key, value]) => {
|
||||
|
@ -86,7 +86,7 @@ class PushList extends React.Component {
|
|||
}, PUSH_POLL_INTERVAL);
|
||||
};
|
||||
|
||||
handleUrlChanges = evt => {
|
||||
handleUrlChanges = (evt) => {
|
||||
const { updateRange } = this.props;
|
||||
const { oldURL, newURL } = evt;
|
||||
const oldRange = this.getUrlRangeValues(oldURL);
|
||||
|
@ -141,11 +141,11 @@ class PushList extends React.Component {
|
|||
<div
|
||||
role="list"
|
||||
id="push-list"
|
||||
onClick={evt => this.clearIfEligibleTarget(evt.target)}
|
||||
onClick={(evt) => this.clearIfEligibleTarget(evt.target)}
|
||||
>
|
||||
{jobsLoaded && <span className="hidden ready" />}
|
||||
{repoName &&
|
||||
pushList.map(push => (
|
||||
pushList.map((push) => (
|
||||
<ErrorBoundary
|
||||
errorClasses="pl-2 border-top border-bottom border-dark d-block"
|
||||
message={`Error on push with revision ${push.revision}: `}
|
||||
|
@ -183,7 +183,7 @@ class PushList extends React.Component {
|
|||
<div className="card card-body get-next">
|
||||
<span>get next:</span>
|
||||
<div className="btn-group">
|
||||
{[10, 20, 50].map(count => (
|
||||
{[10, 20, 50].map((count) => (
|
||||
<Button
|
||||
color="darker-secondary"
|
||||
outline
|
||||
|
|
|
@ -12,7 +12,7 @@ function PushLoadErrors(props) {
|
|||
const urlParams = getAllUrlParams();
|
||||
urlParams.delete('revision');
|
||||
|
||||
const isRevision = revision =>
|
||||
const isRevision = (revision) =>
|
||||
revision && (revision.length === 12 || revision.length === 40);
|
||||
|
||||
return (
|
||||
|
|
|
@ -18,7 +18,7 @@ export const clearAllOnScreenNotifications = () => ({
|
|||
type: CLEAR_ALL_ON_SCREEN,
|
||||
});
|
||||
|
||||
export const clearNotification = index => ({
|
||||
export const clearNotification = (index) => ({
|
||||
type: CLEAR,
|
||||
index,
|
||||
});
|
||||
|
|
|
@ -23,28 +23,28 @@ const pulsePinCount = () => {
|
|||
}
|
||||
};
|
||||
|
||||
export const setClassificationId = id => ({
|
||||
export const setClassificationId = (id) => ({
|
||||
type: SET_CLASSIFICATION_ID,
|
||||
payload: {
|
||||
failureClassificationId: id,
|
||||
},
|
||||
});
|
||||
|
||||
export const setClassificationComment = text => ({
|
||||
export const setClassificationComment = (text) => ({
|
||||
type: SET_CLASSIFICATION_COMMENT,
|
||||
payload: {
|
||||
failureClassificationComment: text,
|
||||
},
|
||||
});
|
||||
|
||||
export const setPinBoardVisible = isPinBoardVisible => ({
|
||||
export const setPinBoardVisible = (isPinBoardVisible) => ({
|
||||
type: SET_PINBOARD_VISIBLE,
|
||||
payload: {
|
||||
isPinBoardVisible,
|
||||
},
|
||||
});
|
||||
|
||||
export const pinJob = job => {
|
||||
export const pinJob = (job) => {
|
||||
return async (dispatch, getState) => {
|
||||
const {
|
||||
pinnedJobs: { pinnedJobs },
|
||||
|
@ -64,7 +64,7 @@ export const pinJob = job => {
|
|||
};
|
||||
};
|
||||
|
||||
export const unPinJob = job => {
|
||||
export const unPinJob = (job) => {
|
||||
return async (dispatch, getState) => {
|
||||
const {
|
||||
pinnedJobs: { pinnedJobs },
|
||||
|
@ -79,7 +79,7 @@ export const unPinJob = job => {
|
|||
};
|
||||
};
|
||||
|
||||
export const pinJobs = jobsToPin => {
|
||||
export const pinJobs = (jobsToPin) => {
|
||||
return async (dispatch, getState) => {
|
||||
const {
|
||||
pinnedJobs: { pinnedJobs },
|
||||
|
@ -135,7 +135,7 @@ export const addBug = (bug, job) => {
|
|||
};
|
||||
};
|
||||
|
||||
export const removeBug = bugId => ({
|
||||
export const removeBug = (bugId) => ({
|
||||
type: REMOVE_JOB_BUG,
|
||||
bugId,
|
||||
});
|
||||
|
@ -150,7 +150,7 @@ export const unPinAll = () => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const togglePinJob = job => {
|
||||
export const togglePinJob = (job) => {
|
||||
return async (dispatch, getState) => {
|
||||
const {
|
||||
pinnedJobs: { pinnedJobs },
|
||||
|
|
|
@ -33,9 +33,9 @@ const DEFAULT_PUSH_COUNT = 10;
|
|||
const PUSH_POLLING_KEYS = ['tochange', 'enddate', 'revision', 'author'];
|
||||
const PUSH_FETCH_KEYS = [...PUSH_POLLING_KEYS, 'fromchange', 'startdate'];
|
||||
|
||||
const getRevisionTips = pushList => {
|
||||
const getRevisionTips = (pushList) => {
|
||||
return {
|
||||
revisionTips: pushList.map(push => ({
|
||||
revisionTips: pushList.map((push) => ({
|
||||
revision: push.revision,
|
||||
author: push.author,
|
||||
title: push.revisions[0].comments.split('\n')[0],
|
||||
|
@ -43,10 +43,11 @@ const getRevisionTips = pushList => {
|
|||
};
|
||||
};
|
||||
|
||||
const getLastModifiedJobTime = jobMap => {
|
||||
const getLastModifiedJobTime = (jobMap) => {
|
||||
const latest =
|
||||
max(Object.values(jobMap).map(job => new Date(`${job.last_modified}Z`))) ||
|
||||
new Date();
|
||||
max(
|
||||
Object.values(jobMap).map((job) => new Date(`${job.last_modified}Z`)),
|
||||
) || new Date();
|
||||
|
||||
latest.setSeconds(latest.getSeconds() - 3);
|
||||
return latest;
|
||||
|
@ -58,13 +59,13 @@ const getLastModifiedJobTime = jobMap => {
|
|||
* gives us the difference in unclassified failures and, of those jobs, the
|
||||
* ones that have been filtered out
|
||||
*/
|
||||
const doRecalculateUnclassifiedCounts = jobMap => {
|
||||
const doRecalculateUnclassifiedCounts = (jobMap) => {
|
||||
const filterModel = new FilterModel();
|
||||
const tiers = filterModel.urlParams.tier;
|
||||
let allUnclassifiedFailureCount = 0;
|
||||
let filteredUnclassifiedFailureCount = 0;
|
||||
|
||||
Object.values(jobMap).forEach(job => {
|
||||
Object.values(jobMap).forEach((job) => {
|
||||
if (isUnclassifiedFailure(job) && tiers.includes(String(job.tier))) {
|
||||
if (filterModel.showJob(job)) {
|
||||
filteredUnclassifiedFailureCount++;
|
||||
|
@ -80,10 +81,10 @@ const doRecalculateUnclassifiedCounts = jobMap => {
|
|||
|
||||
const addPushes = (data, pushList, jobMap, setFromchange) => {
|
||||
if (data.results.length > 0) {
|
||||
const pushIds = pushList.map(push => push.id);
|
||||
const pushIds = pushList.map((push) => push.id);
|
||||
const newPushList = [
|
||||
...pushList,
|
||||
...data.results.filter(push => !pushIds.includes(push.id)),
|
||||
...data.results.filter((push) => !pushIds.includes(push.id)),
|
||||
];
|
||||
|
||||
newPushList.sort((a, b) => b.push_timestamp - a.push_timestamp);
|
||||
|
@ -125,7 +126,7 @@ const fetchNewJobs = () => {
|
|||
return;
|
||||
}
|
||||
|
||||
const pushIds = pushList.map(push => push.id);
|
||||
const pushIds = pushList.map((push) => push.id);
|
||||
const lastModified = getLastModifiedJobTime(jobMap);
|
||||
|
||||
const resp = await JobModel.getList(
|
||||
|
@ -148,7 +149,7 @@ const fetchNewJobs = () => {
|
|||
// updated version of that selected job, then send that with the event.
|
||||
const selectedTaskRun = getUrlParam('selectedTaskRun');
|
||||
const updatedSelectedJob = selectedTaskRun
|
||||
? data.find(job => getTaskRunStr(job) === selectedTaskRun)
|
||||
? data.find((job) => getTaskRunStr(job) === selectedTaskRun)
|
||||
: null;
|
||||
|
||||
window.dispatchEvent(
|
||||
|
@ -177,12 +178,12 @@ const doUpdateJobMap = (jobList, jobMap, decisionTaskMap, pushList) => {
|
|||
...keyBy(
|
||||
jobList
|
||||
.filter(
|
||||
job =>
|
||||
(job) =>
|
||||
job.job_type_name.includes('Decision Task') &&
|
||||
job.result === 'success' &&
|
||||
job.job_type_symbol === 'D',
|
||||
)
|
||||
.map(job => ({
|
||||
.map((job) => ({
|
||||
push_id: job.push_id,
|
||||
id: job.task_id,
|
||||
run: job.retry_id,
|
||||
|
@ -190,7 +191,7 @@ const doUpdateJobMap = (jobList, jobMap, decisionTaskMap, pushList) => {
|
|||
'push_id',
|
||||
),
|
||||
},
|
||||
jobsLoaded: pushList.every(push => push.jobsLoaded),
|
||||
jobsLoaded: pushList.every((push) => push.jobsLoaded),
|
||||
};
|
||||
}
|
||||
return {};
|
||||
|
@ -295,7 +296,7 @@ export const pollPushes = () => {
|
|||
/**
|
||||
* Get the next batch of pushes based on our current offset.
|
||||
*/
|
||||
export const fetchNextPushes = count => {
|
||||
export const fetchNextPushes = (count) => {
|
||||
const params = getAllUrlParams();
|
||||
|
||||
if (params.has('revision')) {
|
||||
|
@ -329,17 +330,17 @@ export const setPushes = (pushList, jobMap) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const recalculateUnclassifiedCounts = filterModel => ({
|
||||
export const recalculateUnclassifiedCounts = (filterModel) => ({
|
||||
type: RECALCULATE_UNCLASSIFIED_COUNTS,
|
||||
filterModel,
|
||||
});
|
||||
|
||||
export const updateJobMap = jobList => ({
|
||||
export const updateJobMap = (jobList) => ({
|
||||
type: UPDATE_JOB_MAP,
|
||||
jobList,
|
||||
});
|
||||
|
||||
export const updateRange = range => {
|
||||
export const updateRange = (range) => {
|
||||
return (dispatch, getState) => {
|
||||
const {
|
||||
pushes: { pushList, jobMap },
|
||||
|
@ -347,7 +348,7 @@ export const updateRange = range => {
|
|||
const { revision } = range;
|
||||
// change the range of pushes. might already have them.
|
||||
const revisionPushList = revision
|
||||
? pushList.filter(push => push.revision === revision)
|
||||
? pushList.filter((push) => push.revision === revision)
|
||||
: [];
|
||||
|
||||
window.dispatchEvent(new CustomEvent(thEvents.clearPinboard));
|
||||
|
|
|
@ -29,12 +29,12 @@ export const setSelectedJobFromQueryString = (notify, jobMap) => ({
|
|||
jobMap,
|
||||
});
|
||||
|
||||
export const clearSelectedJob = countPinnedJobs => ({
|
||||
export const clearSelectedJob = (countPinnedJobs) => ({
|
||||
type: CLEAR_JOB,
|
||||
countPinnedJobs,
|
||||
});
|
||||
|
||||
export const updateJobDetails = job => ({
|
||||
export const updateJobDetails = (job) => ({
|
||||
type: UPDATE_JOB_DETAILS,
|
||||
job,
|
||||
meta: {
|
||||
|
@ -42,7 +42,7 @@ export const updateJobDetails = job => ({
|
|||
},
|
||||
});
|
||||
|
||||
const doUpdateJobDetails = job => {
|
||||
const doUpdateJobDetails = (job) => {
|
||||
const taskRun = job ? getTaskRunStr(job) : null;
|
||||
|
||||
setUrlParam('selectedTaskRun', taskRun);
|
||||
|
@ -77,7 +77,7 @@ export const doSelectJob = (job, updateDetails) => {
|
|||
return { selectedJob: job };
|
||||
};
|
||||
|
||||
export const doClearSelectedJob = countPinnedJobs => {
|
||||
export const doClearSelectedJob = (countPinnedJobs) => {
|
||||
if (!countPinnedJobs) {
|
||||
const selected = findSelectedInstance();
|
||||
if (selected) selected.setSelected(false);
|
||||
|
@ -137,7 +137,7 @@ const doSetSelectedJobFromQueryString = (notify, jobMap) => {
|
|||
if (taskId) {
|
||||
const retryId = parseInt(runId, 10);
|
||||
const task = Object.values(jobMap).find(
|
||||
job => job.task_id === taskId && job.retry_id === retryId,
|
||||
(job) => job.task_id === taskId && job.retry_id === retryId,
|
||||
);
|
||||
|
||||
if (task) {
|
||||
|
|
|
@ -25,7 +25,7 @@ const getUrlLineNumber = function getUrlLineNumber() {
|
|||
const lineNumberParam = getUrlParam('lineNumber');
|
||||
|
||||
if (lineNumberParam) {
|
||||
return lineNumberParam.split('-').map(line => parseInt(line, 10));
|
||||
return lineNumberParam.split('-').map((line) => parseInt(line, 10));
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
@ -70,7 +70,7 @@ class App extends React.PureComponent {
|
|||
|
||||
Promise.all([repoPromise, jobPromise])
|
||||
.then(async ([repos, job]) => {
|
||||
const currentRepo = repos.find(repo => repo.name === repoName);
|
||||
const currentRepo = repos.find((repo) => repo.name === repoName);
|
||||
|
||||
// set the title of the browser window/tab
|
||||
document.title = job.searchStr;
|
||||
|
@ -135,16 +135,16 @@ class App extends React.PureComponent {
|
|||
},
|
||||
);
|
||||
})
|
||||
.catch(error => {
|
||||
.catch((error) => {
|
||||
this.setState({
|
||||
jobExists: false,
|
||||
jobError: error.toString(),
|
||||
});
|
||||
});
|
||||
|
||||
TextLogStepModel.get(jobId).then(textLogSteps => {
|
||||
TextLogStepModel.get(jobId).then((textLogSteps) => {
|
||||
const stepErrors = textLogSteps.length ? textLogSteps[0].errors : [];
|
||||
const errors = stepErrors.map(error => ({
|
||||
const errors = stepErrors.map((error) => ({
|
||||
line: error.line,
|
||||
lineNumber: error.line_number + 1,
|
||||
}));
|
||||
|
@ -160,7 +160,7 @@ class App extends React.PureComponent {
|
|||
});
|
||||
}
|
||||
|
||||
onHighlight = range => {
|
||||
onHighlight = (range) => {
|
||||
const { highlight } = this.state;
|
||||
const { _start, _end, size } = range;
|
||||
// We can't use null to represent "no highlight", due to:
|
||||
|
@ -186,7 +186,7 @@ class App extends React.PureComponent {
|
|||
});
|
||||
};
|
||||
|
||||
scrollHighlightToTop = highlight => {
|
||||
scrollHighlightToTop = (highlight) => {
|
||||
const lineAtTop = highlight && highlight[0] > 7 ? highlight[0] - 7 : 0;
|
||||
|
||||
scrollToLine(`a[id="${lineAtTop}"]`, 100);
|
||||
|
|
|
@ -9,7 +9,7 @@ export default class ErrorLines extends React.PureComponent {
|
|||
<div className="error-lines">
|
||||
<table>
|
||||
<tbody>
|
||||
{errors.map(error => (
|
||||
{errors.map((error) => (
|
||||
<tr
|
||||
key={error.lineNumber}
|
||||
onClick={() => onClickLine([error.lineNumber], true)}
|
||||
|
|
|
@ -7,7 +7,7 @@ import { faTree } from '@fortawesome/free-solid-svg-icons';
|
|||
import LogoMenu from '../shared/LogoMenu';
|
||||
|
||||
// Get the css class for the result, step buttons and other general use
|
||||
const getShadingClass = result => `result-status-shading-${result}`;
|
||||
const getShadingClass = (result) => `result-status-shading-${result}`;
|
||||
|
||||
export default class Navigation extends React.PureComponent {
|
||||
render() {
|
||||
|
|
|
@ -13,8 +13,8 @@ export default class BugJobMapModel {
|
|||
static getList(options) {
|
||||
return fetch(
|
||||
`${getProjectUrl(uri)}${createQueryParams(options)}`,
|
||||
).then(resp =>
|
||||
resp.json().then(data => data.map(elem => new BugJobMapModel(elem))),
|
||||
).then((resp) =>
|
||||
resp.json().then((data) => data.map((elem) => new BugJobMapModel(elem))),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ import { getProjectJobUrl } from '../helpers/location';
|
|||
|
||||
export default class BugSuggestionsModel {
|
||||
static get(jobId) {
|
||||
return fetch(getProjectJobUrl('/bug_suggestions/', jobId)).then(resp =>
|
||||
return fetch(getProjectJobUrl('/bug_suggestions/', jobId)).then((resp) =>
|
||||
resp.json(),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -13,10 +13,10 @@ export default class JobClassificationModel {
|
|||
static getList(params) {
|
||||
return fetch(
|
||||
`${getProjectUrl(uri)}${createQueryParams(params)}`,
|
||||
).then(resp =>
|
||||
).then((resp) =>
|
||||
resp
|
||||
.json()
|
||||
.then(data => data.map(elem => new JobClassificationModel(elem))),
|
||||
.then((data) => data.map((elem) => new JobClassificationModel(elem))),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ const uri = getApiUrl('/failureclassification/');
|
|||
|
||||
export default class ClassificationTypeModel {
|
||||
static getList() {
|
||||
return fetch(uri).then(async resp => resp.json());
|
||||
return fetch(uri).then(async (resp) => resp.json());
|
||||
}
|
||||
|
||||
static getMap(classificationTypes) {
|
||||
|
|
|
@ -96,7 +96,7 @@ export default class FilterModel {
|
|||
|
||||
if (currentValue && currentValue.length) {
|
||||
this.urlParams[field] = currentValue.filter(
|
||||
filterValue => filterValue !== value,
|
||||
(filterValue) => filterValue !== value,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
@ -139,19 +139,19 @@ export default class FilterModel {
|
|||
* If none or only some of the statuses here are on, then set them all to on.
|
||||
* If they ARE all on, then set them to off.
|
||||
*/
|
||||
toggleResultStatuses = resultStatuses => {
|
||||
toggleResultStatuses = (resultStatuses) => {
|
||||
const currentResultStatuses = this.urlParams.resultStatus;
|
||||
const allOn = resultStatuses.every(rs =>
|
||||
const allOn = resultStatuses.every((rs) =>
|
||||
currentResultStatuses.includes(rs),
|
||||
);
|
||||
this.urlParams.resultStatus = allOn
|
||||
? currentResultStatuses.filter(rs => !resultStatuses.includes(rs))
|
||||
? currentResultStatuses.filter((rs) => !resultStatuses.includes(rs))
|
||||
: [...new Set([...resultStatuses, ...currentResultStatuses])];
|
||||
|
||||
this.push();
|
||||
};
|
||||
|
||||
toggleClassifiedFilter = classifiedState => {
|
||||
toggleClassifiedFilter = (classifiedState) => {
|
||||
this.toggleFilter('classifiedState', classifiedState);
|
||||
};
|
||||
|
||||
|
@ -195,7 +195,7 @@ export default class FilterModel {
|
|||
*
|
||||
* @param job - the job we are checking against the filters
|
||||
*/
|
||||
showJob = job => {
|
||||
showJob = (job) => {
|
||||
// when runnable jobs have been added to a resultset, they should be
|
||||
// shown regardless of settings for classified or result state
|
||||
const { resultStatus } = job;
|
||||
|
@ -214,7 +214,7 @@ export default class FilterModel {
|
|||
return this._checkFieldFilters(job);
|
||||
};
|
||||
|
||||
_checkClassifiedStateFilters = job => {
|
||||
_checkClassifiedStateFilters = (job) => {
|
||||
const { classifiedState } = this.urlParams;
|
||||
const isJobClassified = isClassified(job);
|
||||
|
||||
|
@ -226,7 +226,7 @@ export default class FilterModel {
|
|||
return !(!classifiedState.includes('classified') && isJobClassified);
|
||||
};
|
||||
|
||||
_checkFieldFilters = job =>
|
||||
_checkFieldFilters = (job) =>
|
||||
Object.entries(this.urlParams).every(([field, values]) => {
|
||||
let jobFieldValue = this._getJobFieldValue(job, field);
|
||||
|
||||
|
@ -239,14 +239,14 @@ export default class FilterModel {
|
|||
switch (thFieldChoices[field].matchType) {
|
||||
case thMatchType.substr:
|
||||
// at least ONE filter value must be a substring of this job's field.
|
||||
if (!values.some(val => jobFieldValue.includes(val))) {
|
||||
if (!values.some((val) => jobFieldValue.includes(val))) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case thMatchType.searchStr:
|
||||
// ALL of the values must be in the searchStr for this job
|
||||
if (!values.every(val => jobFieldValue.includes(val))) {
|
||||
if (!values.every((val) => jobFieldValue.includes(val))) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -48,7 +48,7 @@ export default class JobModel {
|
|||
if (jobPropertyNames) {
|
||||
// the results came as list of fields
|
||||
// we need to convert them to objects
|
||||
itemList = results.map(elem =>
|
||||
itemList = results.map((elem) =>
|
||||
addAggregateFields(
|
||||
jobPropertyNames.reduce(
|
||||
(prev, prop, i) => ({ ...prev, [prop]: elem[i] }),
|
||||
|
@ -57,7 +57,7 @@ export default class JobModel {
|
|||
),
|
||||
);
|
||||
} else {
|
||||
itemList = results.map(jobObj => addAggregateFields(jobObj));
|
||||
itemList = results.map((jobObj) => addAggregateFields(jobObj));
|
||||
}
|
||||
return { data: [...itemList, ...nextPagesJobs], failureStatus: null };
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ export default class JobModel {
|
|||
static get(repoName, pk, signal) {
|
||||
// a static method to retrieve a single instance of JobModel
|
||||
return fetch(`${getProjectUrl(uri, repoName)}${pk}/`, { signal }).then(
|
||||
async response => {
|
||||
async (response) => {
|
||||
if (response.ok) {
|
||||
const job = await response.json();
|
||||
return addAggregateFields(job);
|
||||
|
@ -98,21 +98,21 @@ export default class JobModel {
|
|||
try {
|
||||
notify(`Attempting to retrigger/add ${jobTerm} via actions.json`, 'info');
|
||||
|
||||
const pushIds = [...new Set(jobs.map(job => job.push_id))];
|
||||
const pushIds = [...new Set(jobs.map((job) => job.push_id))];
|
||||
const taskIdMap =
|
||||
decisionTaskIdMap ||
|
||||
(await PushModel.getDecisionTaskMap(pushIds, notify));
|
||||
const uniquePerPushJobs = groupBy(jobs, job => job.push_id);
|
||||
const uniquePerPushJobs = groupBy(jobs, (job) => job.push_id);
|
||||
|
||||
for (const [key, value] of Object.entries(uniquePerPushJobs)) {
|
||||
const decisionTaskId = taskIdMap[key].id;
|
||||
|
||||
TaskclusterModel.load(decisionTaskId, null, currentRepo, testMode)
|
||||
.then(async results => {
|
||||
const taskLabels = value.map(job => job.job_type_name);
|
||||
.then(async (results) => {
|
||||
const taskLabels = value.map((job) => job.job_type_name);
|
||||
|
||||
let retriggerAction = results.actions.find(
|
||||
action => action.name === 'retrigger-multiple',
|
||||
(action) => action.name === 'retrigger-multiple',
|
||||
);
|
||||
let actionInput = {
|
||||
requests: [{ tasks: taskLabels, times }],
|
||||
|
@ -138,12 +138,12 @@ export default class JobModel {
|
|||
currentRepo,
|
||||
testMode,
|
||||
})
|
||||
.then(actionTaskId =>
|
||||
.then((actionTaskId) =>
|
||||
notify(
|
||||
`Request sent to retrigger/add new jobs via actions.json (${actionTaskId})`,
|
||||
),
|
||||
)
|
||||
.catch(error => {
|
||||
.catch((error) => {
|
||||
notify(
|
||||
`Retrigger failed with Decision task: ${decisionTaskId}: ${error}`,
|
||||
'danger',
|
||||
|
@ -151,7 +151,7 @@ export default class JobModel {
|
|||
);
|
||||
});
|
||||
})
|
||||
.catch(error => notify(error.message, 'danger', { sticky: true }));
|
||||
.catch((error) => notify(error.message, 'danger', { sticky: true }));
|
||||
}
|
||||
} catch (e) {
|
||||
notify(
|
||||
|
@ -214,7 +214,7 @@ export default class JobModel {
|
|||
const taskIdMap =
|
||||
decisionTaskIdMap ||
|
||||
(await PushModel.getDecisionTaskMap(
|
||||
[...new Set(jobs.map(job => job.push_id))],
|
||||
[...new Set(jobs.map((job) => job.push_id))],
|
||||
notify,
|
||||
));
|
||||
|
||||
|
|
|
@ -7,6 +7,6 @@ export default class JobDetailModel {
|
|||
static getJobDetails(params, signal) {
|
||||
return fetch(`${getApiUrl('/jobdetail/')}${createQueryParams(params)}`, {
|
||||
signal,
|
||||
}).then(resp => resp.json().then(data => data.results));
|
||||
}).then((resp) => resp.json().then((data) => data.results));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,6 @@ export default class JobLogUrlModel {
|
|||
static getList(options, signal) {
|
||||
return fetch(`${getProjectUrl(uri)}${createQueryParams(options)}`, {
|
||||
signal,
|
||||
}).then(resp => resp.json());
|
||||
}).then((resp) => resp.json());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,13 +10,13 @@ export default class OptionCollectionModel {
|
|||
);
|
||||
}
|
||||
|
||||
return fetch(uri).then(resp =>
|
||||
resp.json().then(data => {
|
||||
return fetch(uri).then((resp) =>
|
||||
resp.json().then((data) => {
|
||||
OptionCollectionModel.prototype.optionCollectionMap = data.reduce(
|
||||
(hashAcc, optColl) => ({
|
||||
...hashAcc,
|
||||
[optColl.option_collection_hash]: optColl.options
|
||||
.map(opt => opt.name)
|
||||
.map((opt) => opt.name)
|
||||
.sort()
|
||||
.join(),
|
||||
}),
|
||||
|
|
|
@ -12,7 +12,7 @@ export const getTestName = function getTestName(signatureProps) {
|
|||
// undefined test name
|
||||
return [
|
||||
...new Set(
|
||||
[signatureProps.suite, signatureProps.test].filter(item => item),
|
||||
[signatureProps.suite, signatureProps.test].filter((item) => item),
|
||||
),
|
||||
].join(' ');
|
||||
};
|
||||
|
@ -124,7 +124,7 @@ export default class PerfSeriesModel {
|
|||
'/performance/data/',
|
||||
projectName,
|
||||
)}?${queryString.stringify(params)}`,
|
||||
).then(resp => {
|
||||
).then((resp) => {
|
||||
if (resp.ok) {
|
||||
return resp.json();
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ export default class PushModel {
|
|||
: (await PushModel.getDecisionTaskId(pushId, notify)).id;
|
||||
|
||||
return TaskclusterModel.load(decisionTaskId, null, currentRepo).then(
|
||||
results => {
|
||||
(results) => {
|
||||
try {
|
||||
const missingTestsTask = getAction(
|
||||
results.actions,
|
||||
|
@ -85,7 +85,7 @@ export default class PushModel {
|
|||
input: {},
|
||||
staticActionVariables: results.staticActionVariables,
|
||||
currentRepo,
|
||||
}).then(actionTaskId =>
|
||||
}).then((actionTaskId) =>
|
||||
notify(
|
||||
`Request sent to trigger missing jobs (${actionTaskId})`,
|
||||
'success',
|
||||
|
@ -102,7 +102,7 @@ export default class PushModel {
|
|||
|
||||
static triggerNewJobs(jobs, decisionTaskId, currentRepo) {
|
||||
return TaskclusterModel.load(decisionTaskId, null, currentRepo).then(
|
||||
results => {
|
||||
(results) => {
|
||||
const addNewJobsTask = getAction(results.actions, 'add-new-jobs');
|
||||
|
||||
return TaskclusterModel.submit({
|
||||
|
@ -114,7 +114,7 @@ export default class PushModel {
|
|||
staticActionVariables: results.staticActionVariables,
|
||||
currentRepo,
|
||||
}).then(
|
||||
actionTaskId =>
|
||||
(actionTaskId) =>
|
||||
`Request sent to trigger new jobs via actions.json (${actionTaskId})`,
|
||||
);
|
||||
},
|
||||
|
@ -154,7 +154,7 @@ export default class PushModel {
|
|||
// Otherwise just return the map since it has everything
|
||||
// that's needed.
|
||||
const cachedMap = pick(decisionTaskIdCache, pushIds);
|
||||
const missedIds = pushIds.filter(id => !cachedMap[id]);
|
||||
const missedIds = pushIds.filter((id) => !cachedMap[id]);
|
||||
|
||||
if (!missedIds.length) {
|
||||
return cachedMap;
|
||||
|
|
|
@ -19,12 +19,12 @@ export default class RepositoryModel {
|
|||
|
||||
static getList() {
|
||||
return fetch(getApiUrl(repoEndpoint))
|
||||
.then(resp => resp.json())
|
||||
.then(repos => repos.map(datum => new RepositoryModel(datum)));
|
||||
.then((resp) => resp.json())
|
||||
.then((repos) => repos.map((datum) => new RepositoryModel(datum)));
|
||||
}
|
||||
|
||||
static getRepo(name, repos) {
|
||||
return repos.find(repo => repo.name === name);
|
||||
return repos.find((repo) => repo.name === name);
|
||||
}
|
||||
|
||||
getRevisionHref(revision) {
|
||||
|
|
|
@ -10,7 +10,7 @@ export default class RunnableJobModel {
|
|||
static async getList(repo, params) {
|
||||
const { push_id: pushId, decisionTask } = params;
|
||||
const uri = getRunnableJobsURL(decisionTask, repo.tc_root_url);
|
||||
const rawJobs = await fetch(uri).then(response => response.json());
|
||||
const rawJobs = await fetch(uri).then((response) => response.json());
|
||||
|
||||
return Object.entries(rawJobs).map(([key, value]) =>
|
||||
addAggregateFields({
|
||||
|
|
|
@ -8,9 +8,9 @@ import { checkRootUrl } from '../taskcluster-auth-callback/constants';
|
|||
|
||||
export default class TaskclusterModel {
|
||||
static taskInContext(tagSetList, taskTags) {
|
||||
return tagSetList.some(tagSet =>
|
||||
return tagSetList.some((tagSet) =>
|
||||
Object.keys(tagSet).every(
|
||||
tag => taskTags[tag] && taskTags[tag] === tagSet[tag],
|
||||
(tag) => taskTags[tag] && taskTags[tag] === tagSet[tag],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ import { getProjectJobUrl } from '../helpers/location';
|
|||
|
||||
export default class TextLogStepModel {
|
||||
static get(jobId) {
|
||||
return fetch(getProjectJobUrl('/text_log_steps/', jobId)).then(resp =>
|
||||
return fetch(getProjectJobUrl('/text_log_steps/', jobId)).then((resp) =>
|
||||
resp.json(),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ const uri = 'https://treestatus.mozilla-releng.net/trees/';
|
|||
export default class TreeStatusModel {
|
||||
static get(repoName) {
|
||||
return fetch(`${uri}${repoName}`)
|
||||
.then(async resp => {
|
||||
.then(async (resp) => {
|
||||
if (resp.ok) {
|
||||
return resp.json();
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ export default class TreeStatusModel {
|
|||
}
|
||||
throw new Error(await resp.text());
|
||||
})
|
||||
.catch(reason =>
|
||||
.catch((reason) =>
|
||||
Promise.resolve({
|
||||
result: {
|
||||
status: 'error',
|
||||
|
|
|
@ -9,8 +9,10 @@ export default class UserModel {
|
|||
}
|
||||
|
||||
static get() {
|
||||
return fetch(`${uri}`).then(resp =>
|
||||
resp.json().then(data => (data.length > 0 ? new UserModel(data[0]) : {})),
|
||||
return fetch(`${uri}`).then((resp) =>
|
||||
resp
|
||||
.json()
|
||||
.then((data) => (data.length > 0 ? new UserModel(data[0]) : {})),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче