Bug 1442690 - Fix compare chooser for repos other than m-i (#3294)

This commit is contained in:
Cameron Dawson 2018-03-02 13:24:46 -08:00 коммит произвёл Ed Morley
Родитель 843fb44817
Коммит a5cee318f6
2 изменённых файлов: 11 добавлений и 11 удалений

Просмотреть файл

@ -33,11 +33,11 @@ export const getLogViewerUrl = (job_id, repoName, line_number) => {
return line_number ? `${rv}&lineNumber=${line_number}` : rv;
};
// if we can't find "repo" on the url (like in perfherder) they don't
// care WHICH repo it is, just need one because of Bug 1441938 (see above).
// So we default to mozilla-inbound.
export const getProjectUrl = (uri) => {
const repo = getUrlParam("repo") || 'mozilla-inbound';
// Take the repoName, if passed in. If not, then try to find it on the
// URL. If not there, then try m-i and hope for the best. The caller may
// not actually need a repo if they're trying to get a job by ``id``.
export const getProjectUrl = (uri, repoName) => {
const repo = repoName || getUrlParam("repo") || 'mozilla-inbound';
return `${SERVICE_DOMAIN}/api/project/${repo}${uri}`;
};

Просмотреть файл

@ -47,7 +47,7 @@ treeherder.factory('ThResultSetModel', ['$http', '$location',
});
return $http.get(
getProjectUrl("/resultset/"),
getProjectUrl("/resultset/", repoName),
{ params: locationParams }
);
},
@ -103,13 +103,13 @@ treeherder.factory('ThResultSetModel', ['$http', '$location',
}
return $http.get(
getProjectUrl("/resultset/"),
getProjectUrl("/resultset/", repoName),
{ params: params }
);
},
getResultSetList: function (repoName, resultSetList, full) {
return $http.get(
getProjectUrl("/resultset/"), {
getProjectUrl("/resultset/", repoName), {
params: {
full: _.isUndefined(full) ? true : full,
offset: 0,
@ -120,7 +120,7 @@ treeherder.factory('ThResultSetModel', ['$http', '$location',
},
getResultSet: function (repoName, pk) {
return $http.get(
getProjectUrl(`/resultset/${pk}/`)
getProjectUrl(`/resultset/${pk}/`, repoName)
);
},
get: function (uri) {
@ -160,7 +160,7 @@ treeherder.factory('ThResultSetModel', ['$http', '$location',
getRevisions: function (projectName, resultSetId) {
return $http.get(getProjectUrl(
`/resultset/${resultSetId}/`), { cache: true }).then(
`/resultset/${resultSetId}/`, projectName), { cache: true }).then(
function (response) {
if (response.data.revisions.length > 0) {
return _.map(response.data.revisions, function (r) {
@ -174,7 +174,7 @@ treeherder.factory('ThResultSetModel', ['$http', '$location',
getResultSetsFromRevision: function (projectName, revision) {
return $http.get(getProjectUrl(
`/resultset/?revision=${revision}`),
`/resultset/?revision=${revision}`, projectName),
{ cache: true }).then(
function (response) {
if (response.data.results.length > 0) {