зеркало из https://github.com/mozilla/treeherder.git
Bug 1465987 - BugFiler post-merge cleanup (#3913)
This commit is contained in:
Родитель
920052fdff
Коммит
7b0a1c400d
|
@ -5,6 +5,12 @@ import { getUrlParam, getAllUrlParams } from './location';
|
|||
|
||||
export const uiJobsUrlBase = '/#/jobs';
|
||||
|
||||
export const bzBaseUrl = 'https://bugzilla.mozilla.org/';
|
||||
|
||||
export const hgBaseUrl = 'https://hg.mozilla.org/';
|
||||
|
||||
export const dxrBaseUrl = 'https://dxr.mozilla.org/';
|
||||
|
||||
export const createQueryParams = function createQueryParams(params) {
|
||||
const query = new URLSearchParams(params);
|
||||
return `?${query.toString()}`;
|
||||
|
@ -21,7 +27,7 @@ export const getApiUrl = function getApiUrl(uri) {
|
|||
};
|
||||
|
||||
export const getBugUrl = function getBugUrl(bug_id) {
|
||||
return `https://bugzilla.mozilla.org/show_bug.cgi?id=${bug_id}`;
|
||||
return `${bzBaseUrl}show_bug.cgi?id=${bug_id}`;
|
||||
};
|
||||
|
||||
export const getSlaveHealthUrl = function getSlaveHealthUrl(machine_name) {
|
||||
|
@ -119,7 +125,7 @@ export const createApiUrl = function createApiUrl(api, params) {
|
|||
// bugs can be one bug or a comma separated (no spaces) string of bugs
|
||||
export const bugzillaBugsApi = function bugzillaBugsApi(api, params) {
|
||||
const query = createQueryParams(params);
|
||||
return `https://bugzilla.mozilla.org/${api}${query}`;
|
||||
return `${bzBaseUrl}rest/${api}${query}`;
|
||||
};
|
||||
|
||||
export const deployedRevisionUrl = '/revision.txt';
|
||||
|
@ -136,9 +142,3 @@ export const getRepoUrl = function getRepoUrl(newRepoName) {
|
|||
params.set('repo', newRepoName);
|
||||
return `${uiJobsUrlBase}?${params.toString()}`;
|
||||
};
|
||||
|
||||
export const bzBaseUrl = 'https://bugzilla.mozilla.org/';
|
||||
|
||||
export const hgBaseUrl = 'https://hg.mozilla.org/';
|
||||
|
||||
export const dxrBaseUrl = 'https://dxr.mozilla.org/';
|
||||
|
|
|
@ -78,7 +78,7 @@ class BugDetailsView extends React.Component {
|
|||
|
||||
if (bug !== bugId) {
|
||||
updateBugDetails(bug, '', 'BUG_DETAILS');
|
||||
fetchData(bugzillaBugsApi('rest/bug', { include_fields: 'summary,id', id: bug }), 'BUGZILLA_BUG_DETAILS');
|
||||
fetchData(bugzillaBugsApi('bug', { include_fields: 'summary,id', id: bug }), 'BUGZILLA_BUG_DETAILS');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ export const fetchBugsThenBugzilla = (url, name) => (dispatch, getState) => (
|
|||
).then(() => {
|
||||
const { results } = getState().bugsData.data;
|
||||
const bugs_list = formatBugs(results);
|
||||
return dispatch(fetchBugData(bugzillaBugsApi('rest/bug', {
|
||||
return dispatch(fetchBugData(bugzillaBugsApi('bug', {
|
||||
include_fields: 'id,status,summary,whiteboard',
|
||||
id: bugs_list,
|
||||
}), 'BUGZILLA'));
|
||||
|
|
|
@ -6,6 +6,7 @@ import {
|
|||
} from 'reactstrap';
|
||||
|
||||
import {
|
||||
bugzillaBugsApi,
|
||||
bzBaseUrl,
|
||||
dxrBaseUrl,
|
||||
getApiUrl,
|
||||
|
@ -304,10 +305,10 @@ export default class BugFiler extends React.Component {
|
|||
|
||||
const descriptionStrings = [...checkedLogLinks, comment].join('\n\n');
|
||||
const keywords = isIntermittent ? ['intermittent-failure'] : [];
|
||||
|
||||
let severity = 'normal';
|
||||
const priority = 'P5';
|
||||
const crashSignature = crashSignatures.join('\n');
|
||||
|
||||
if (crashSignature.length > 0) {
|
||||
keywords.push('crash');
|
||||
severity = 'critical';
|
||||
|
@ -317,7 +318,7 @@ export default class BugFiler extends React.Component {
|
|||
// submit the new bug. Only request the versions because some products
|
||||
// take quite a long time to fetch the full object
|
||||
try {
|
||||
const productResp = await fetch(`${bzBaseUrl}rest/product/${product}?include_fields=versions`);
|
||||
const productResp = await fetch(bugzillaBugsApi(`product/${product}`, { include_fields: 'versions' }));
|
||||
const productData = await productResp.json();
|
||||
if (productResp.ok) {
|
||||
const productObject = productData.products[0];
|
||||
|
|
|
@ -268,9 +268,7 @@ export default class DetailsPanel extends React.Component {
|
|||
|
||||
const logViewerUrl = getLogViewerUrl(job.id, repoName);
|
||||
const logViewerFullUrl = `${location.origin}/${logViewerUrl}`;
|
||||
const reftestUrl = jobLogUrls.length ?
|
||||
`${getReftestUrl(jobLogUrls[0].url)}&only_show_unexpected=1` :
|
||||
'';
|
||||
const reftestUrl = jobLogUrls.length ? getReftestUrl(jobLogUrls[0].url) : '';
|
||||
const performanceData = Object.values(results[3]).reduce((a, b) => [...a, ...b], []);
|
||||
|
||||
let perfJobDetail = [];
|
||||
|
|
|
@ -180,7 +180,7 @@ export default class LineOption extends React.Component {
|
|||
suggestions={[errorLine.data.bug_suggestions]}
|
||||
fullLog={logUrl}
|
||||
parsedLog={`${location.origin}/${getLogViewerUrl(job.id, repoName)}`}
|
||||
reftestUrl={isReftest(job) ? `${getReftestUrl(logUrl)}&only_show_unexpected=1` : ''}
|
||||
reftestUrl={isReftest(job) ? getReftestUrl(logUrl) : ''}
|
||||
successCallback={this.bugFilerCallback}
|
||||
jobGroupName={job.job_group_name}
|
||||
notify={this.thNotify}
|
||||
|
|
|
@ -186,7 +186,7 @@ logViewerApp.controller('LogviewerCtrl', [
|
|||
|
||||
// Test to expose the reftest button in the logviewer actionbar
|
||||
if ($scope.rawLogURL && job.job_group_name && isReftest(job)) {
|
||||
$scope.reftestUrl = `${getReftestUrl($scope.rawLogURL)}&only_show_unexpected=1`;
|
||||
$scope.reftestUrl = getReftestUrl($scope.rawLogURL);
|
||||
}
|
||||
|
||||
// get the revision and linkify it
|
||||
|
|
Загрузка…
Ссылка в новой задаче