Bug 1896687 - Switch Treeherder production to use the new Treestatus hosts

This commit is contained in:
Sebastian Hengst 2024-05-14 14:35:44 +02:00
Родитель 0d72ce8f1d
Коммит 3b40cf771a
9 изменённых файлов: 38 добавлений и 49 удалений

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

@ -34,14 +34,17 @@ describe('history', () => {
fetchMock.get(getApiUrl('/performance/framework/'), {});
fetchMock.get(getApiUrl('/user/'), []);
fetchMock.get(getApiUrl('/failureclassification/'), []);
fetchMock.get('begin:https://treestatus.mozilla-releng.net/trees/', {
result: {
message_of_the_day: '',
reason: '',
status: 'open',
tree: repoName,
fetchMock.get(
'begin:https://treestatus.prod.lando.prod.cloudops.mozgcp.net/trees/',
{
result: {
message_of_the_day: '',
reason: '',
status: 'open',
tree: repoName,
},
},
});
);
fetchMock.get(
`begin:${getProjectUrl('/push/?full=true&count=', repoName)}`,
{

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

@ -32,14 +32,17 @@ describe('App', () => {
beforeAll(() => {
// tests will pass without this, but a lot of console warnings/errors
fetchMock.get('begin:https://treestatus.mozilla-releng.net/trees/', {
result: {
message_of_the_day: '',
reason: '',
status: 'open',
tree: repoName,
fetchMock.get(
'begin:https://treestatus.prod.lando.prod.cloudops.mozgcp.net/trees/',
{
result: {
message_of_the_day: '',
reason: '',
status: 'open',
tree: repoName,
},
},
});
);
fetchMock.get(getApiUrl('/repository/'), reposFixture);
fetchMock.get(getApiUrl('/performance/framework/'), {});

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

@ -53,7 +53,7 @@ describe('Filtering', () => {
fetchMock.get(getApiUrl('/failureclassification/'), []);
fetchMock.get(`begin:${bzBaseUrl}rest/bug`, emptyBzResponse);
fetchMock.get(
'begin:https://treestatus.mozilla-releng.net/trees/',
'begin:https://treestatus.prod.lando.prod.cloudops.mozgcp.net/trees/',
treeStatusResponse,
);
fetchMock.get(

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

@ -19,7 +19,7 @@ const router = { location: history.location };
beforeEach(() => {
fetchMock.get(
'https://treestatus.dev.lando.nonprod.cloudops.mozgcp.net/trees/autoland',
'https://treestatus.prod.lando.prod.cloudops.mozgcp.net/trees/autoland',
{
result: {
message_of_the_day: '',

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

@ -18,14 +18,17 @@ const { jobs } = pushHealth;
const testFailure = pushHealth.metrics.tests.details.needInvestigation[2];
beforeEach(() => {
fetchMock.get('https://treestatus.mozilla-releng.net/trees/autoland', {
result: {
message_of_the_day: '',
reason: '',
status: 'open',
tree: 'autoland',
fetchMock.get(
'https://treestatus.prod.lando.prod.cloudops.mozgcp.net/trees/autoland',
{
result: {
message_of_the_day: '',
reason: '',
status: 'open',
tree: 'autoland',
},
},
});
);
setUrlParam('repo', repoName);
fetchMock.get(getProjectUrl('/jobs/285857770/', repoName), fullJob);
fetchMock.get(getProjectUrl('/jobs/285852303/', repoName), fullJob);

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

@ -18,7 +18,7 @@ CSP_DIRECTIVES = [
"font-src 'self' https://fonts.gstatic.com",
# The `data:` is required for images that were inlined by webpack's url-loader (as an optimisation).
"img-src 'self' data:",
"connect-src 'self' https://community-tc.services.mozilla.com https://firefox-ci-tc.services.mozilla.com https://*.taskcluster-artifacts.net https://taskcluster-artifacts.net https://treestatus.mozilla-releng.net https://treestatus.dev.lando.nonprod.cloudops.mozgcp.net https://bugzilla.mozilla.org https://auth.mozilla.auth0.com https://stage.taskcluster.nonprod.cloudops.mozgcp.net https://insights-api.newrelic.com https://prototype.treeherder.nonprod.cloudops.mozgcp.net https://treeherder.allizom.org",
"connect-src 'self' https://community-tc.services.mozilla.com https://firefox-ci-tc.services.mozilla.com https://*.taskcluster-artifacts.net https://taskcluster-artifacts.net https://lando.services.mozilla.com https://bugzilla.mozilla.org https://auth.mozilla.auth0.com https://stage.taskcluster.nonprod.cloudops.mozgcp.net https://insights-api.newrelic.com https://prototype.treeherder.nonprod.cloudops.mozgcp.net https://treeherder.allizom.org",
# Required since auth0-js performs session renewals in an iframe.
"frame-src 'self' https://auth.mozilla.auth0.com",
]

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

@ -4,41 +4,21 @@ import closedTreeFavicon from '../img/tree_closed.png';
export const thHosts = {
production: {
host: 'treeherder.mozilla.org',
treestatus: {
uiUrl: 'https://treestatus.mozilla-releng.net/static/ui/treestatus/',
apiUrl: 'https://treestatus.mozilla-releng.net/',
},
},
stage: {
host: 'treeherder.allizom.org',
treestatus: {
uiUrl: 'https://ui.dev.lando.nonprod.cloudops.mozgcp.net/treestatus/',
apiUrl: 'https://treestatus.dev.lando.nonprod.cloudops.mozgcp.net/',
},
},
prototype: {
host: 'prototype.treeherder.nonprod.cloudops.mozgcp.net',
treestatus: {
uiUrl: 'https://ui.dev.lando.nonprod.cloudops.mozgcp.net/treestatus/',
apiUrl: 'https://treestatus.dev.lando.nonprod.cloudops.mozgcp.net/',
},
},
localhost: {
host: 'localhost',
treestatus: {
uiUrl: 'https://ui.dev.lando.nonprod.cloudops.mozgcp.net/treestatus/',
apiUrl: 'https://treestatus.dev.lando.nonprod.cloudops.mozgcp.net/',
},
},
default: {
host: null,
treestatus: {
uiUrl: 'https://treestatus.mozilla-releng.net/static/ui/treestatus/',
apiUrl: 'https://treestatus.mozilla-releng.net/',
/*
uiUrl: 'https://ui.dev.lando.nonprod.cloudops.mozgcp.net/treestatus/',
apiUrl: 'https://treestatus.dev.lando.nonprod.cloudops.mozgcp.net/',
*/
uiUrl: 'https://lando.services.mozilla.com/treestatus/',
apiUrl: 'https://treestatus.prod.lando.prod.cloudops.mozgcp.net/',
},
},
};

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

@ -199,7 +199,7 @@ export default class WatchedRepo extends React.Component {
)}
<DropdownItem
tag="a"
href={`${treeStatusUiUrl()}show/${watchedRepo}`}
href={`${treeStatusUiUrl()}${watchedRepo}`}
target="_blank"
rel="noopener noreferrer"
>

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

@ -4,8 +4,8 @@ let _treeStatusApiUrl;
let _treeStatusUiUrl;
for (const [hostPrettyName, config] of Object.entries(thHosts)) {
if (config.host === window.location.hostname) {
_treeStatusApiUrl = thHosts[hostPrettyName].treestatus.apiUrl;
_treeStatusUiUrl = thHosts[hostPrettyName].treestatus.uiUrl;
_treeStatusApiUrl = thHosts[hostPrettyName]?.treestatus?.apiUrl;
_treeStatusUiUrl = thHosts[hostPrettyName]?.treestatus?.uiUrl;
}
}
if (_treeStatusApiUrl === undefined) {