diff --git a/ui/helpers/url.js b/ui/helpers/url.js index cc879d59c..5d30125d2 100644 --- a/ui/helpers/url.js +++ b/ui/helpers/url.js @@ -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/'; diff --git a/ui/intermittent-failures/BugDetailsView.jsx b/ui/intermittent-failures/BugDetailsView.jsx index 996a3802d..ffda2a5f7 100644 --- a/ui/intermittent-failures/BugDetailsView.jsx +++ b/ui/intermittent-failures/BugDetailsView.jsx @@ -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'); } } diff --git a/ui/intermittent-failures/redux/actions.js b/ui/intermittent-failures/redux/actions.js index be6761c75..58f87a73b 100644 --- a/ui/intermittent-failures/redux/actions.js +++ b/ui/intermittent-failures/redux/actions.js @@ -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')); diff --git a/ui/job-view/details/BugFiler.jsx b/ui/job-view/details/BugFiler.jsx index 507a92539..9a7568732 100644 --- a/ui/job-view/details/BugFiler.jsx +++ b/ui/job-view/details/BugFiler.jsx @@ -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]; diff --git a/ui/job-view/details/DetailsPanel.jsx b/ui/job-view/details/DetailsPanel.jsx index ee698dbe0..836649fbf 100644 --- a/ui/job-view/details/DetailsPanel.jsx +++ b/ui/job-view/details/DetailsPanel.jsx @@ -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 = []; diff --git a/ui/job-view/details/tabs/autoclassify/LineOption.jsx b/ui/job-view/details/tabs/autoclassify/LineOption.jsx index c5f5b9125..67317e30a 100644 --- a/ui/job-view/details/tabs/autoclassify/LineOption.jsx +++ b/ui/job-view/details/tabs/autoclassify/LineOption.jsx @@ -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} diff --git a/ui/js/controllers/logviewer.js b/ui/js/controllers/logviewer.js index f13e3d9eb..d55ce8e0e 100644 --- a/ui/js/controllers/logviewer.js +++ b/ui/js/controllers/logviewer.js @@ -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