Skip to content
Snippets Groups Projects
Unverified Commit 6e48b655 authored by Ryan Laurie's avatar Ryan Laurie Committed by GitHub
Browse files

Remove instance settings from error diagnostics (#40245)

parent 87680795
No related merge requests found
......@@ -37,7 +37,7 @@ describe("error reporting modal", () => {
expect(fileContent).to.have.property("backendErrors");
expect(fileContent).to.have.property("userLogs");
expect(fileContent).to.have.property("logs");
expect(fileContent).to.have.property("instanceInfo");
expect(fileContent).to.have.property("bugReportDetails");
});
});
......@@ -66,7 +66,7 @@ describe("error reporting modal", () => {
expect(fileContent).to.have.property("backendErrors");
expect(fileContent).to.have.property("userLogs");
expect(fileContent).to.have.property("logs");
expect(fileContent).to.have.property("instanceInfo");
expect(fileContent).to.have.property("bugReportDetails");
expect(fileContent).to.have.property("entityInfo");
expect(fileContent).not.to.have.property("queryResults");
});
......@@ -89,7 +89,7 @@ describe("error reporting modal", () => {
expect(fileContent).to.have.property("backendErrors");
expect(fileContent).to.have.property("userLogs");
expect(fileContent).to.have.property("logs");
expect(fileContent).to.have.property("instanceInfo");
expect(fileContent).to.have.property("bugReportDetails");
expect(fileContent).to.have.property("entityInfo");
expect(fileContent).to.have.property("queryResults");
});
......@@ -122,7 +122,7 @@ describe("error reporting modal", () => {
expect(fileContent).to.have.property("backendErrors");
expect(fileContent).to.have.property("userLogs");
expect(fileContent).to.have.property("logs");
expect(fileContent).to.have.property("instanceInfo");
expect(fileContent).to.have.property("bugReportDetails");
expect(fileContent).to.have.property("entityInfo");
expect(fileContent).to.have.property("queryResults");
});
......@@ -149,7 +149,7 @@ describe("error reporting modal", () => {
expect(fileContent.url).to.include("/dashboard/");
expect(fileContent).to.have.property("frontendErrors");
expect(fileContent).to.have.property("instanceInfo");
expect(fileContent).to.have.property("bugReportDetails");
expect(fileContent).to.have.property("entityInfo");
expect(fileContent).not.to.have.property("logs");
expect(fileContent).not.to.have.property("userLogs");
......
......@@ -93,7 +93,7 @@ export const ErrorDiagnosticModal = ({
backendErrors: true,
userLogs: true,
logs: true,
instanceInfo: true,
bugReportDetails: true,
}}
onSubmit={handleSubmit}
>
......@@ -131,9 +131,9 @@ export const ErrorDiagnosticModal = ({
</>
)}
<FormCheckbox
name="instanceInfo"
name="bugReportDetails"
// eslint-disable-next-line no-literal-metabase-strings -- we're mucking around in the software here
label={t`Metabase instance version and settings`}
label={t`Metabase instance version information`}
/>
</Stack>
<Alert variant="warning">
......
......@@ -45,23 +45,18 @@ const defaultErrorPayload: ErrorPayload = {
localizedEntityName: "Question",
entityInfo: createMockCard(),
queryResults: createMockDatasetData({ rows: [[1]] }),
instanceInfo: {
bugReportDetails: {
"application-database": "h2",
"application-database-details": {},
databases: ["h2"],
"hosting-env": "production",
"run-mode": "prod",
settings: {},
version: {
date: "2021-08-31",
hash: "abcdef",
src_hash: "abcdef",
tag: "v1.0.0",
},
},
sessionProperties: {
settings: "foo",
bugReportDetails: {
"application-database": "h2",
"application-database-details": {},
databases: ["h2"],
"hosting-env": "production",
"run-mode": "prod",
settings: {},
version: {
date: "2021-08-31",
hash: "abcdef",
src_hash: "abcdef",
tag: "v1.0.0",
},
},
};
......
......@@ -23,8 +23,5 @@ export type ErrorPayload = Partial<{
localizedEntityName: string;
entityInfo: Card | Dashboard | Collection;
queryResults: DatasetData;
instanceInfo: {
bugReportDetails: MetabaseInfo;
sessionProperties: any;
};
bugReportDetails: MetabaseInfo;
}>;
......@@ -4,7 +4,7 @@ import { t } from "ttag";
import { getCurrentUser } from "metabase/admin/datamodel/selectors";
import { useSelector } from "metabase/lib/redux";
import { getUserIsAdmin } from "metabase/selectors/user";
import { UtilApi, MetabaseApi, SessionApi } from "metabase/services";
import { UtilApi, MetabaseApi } from "metabase/services";
import type { ErrorPayload, ReportableEntityName } from "./types";
import { getEntityDetails, hasQueryData } from "./utils";
......@@ -49,8 +49,6 @@ export const useErrorInfo = (
? UtilApi.bug_report_details().catch(nullOnCatch)
: Promise.resolve(null);
const sessionPropertiesRequest = SessionApi.properties().catch(nullOnCatch);
const logsRequest: any = isAdmin
? UtilApi.logs().catch(nullOnCatch)
: Promise.resolve(null);
......@@ -65,12 +63,12 @@ export const useErrorInfo = (
const settledPromises = await Promise.allSettled([
entityInfoRequest,
bugReportDetailsRequest,
sessionPropertiesRequest,
logsRequest,
]);
const [entityInfo, bugReportDetails, sessionProperties, logs] =
settledPromises.map((promise: any) => promise.value);
const [entityInfo, bugReportDetails, logs] = settledPromises.map(
(promise: any) => promise.value,
);
const queryResults =
hasQueryData(entity) &&
......@@ -94,8 +92,6 @@ export const useErrorInfo = (
log?.msg?.includes?.(` userID: ${currentUser.id} `),
);
const { engines, ...sessionPropertiesWithoutEngines } = sessionProperties;
const payload: ErrorPayload = {
url: location,
entityInfo,
......@@ -106,10 +102,7 @@ export const useErrorInfo = (
frontendErrors,
backendErrors,
userLogs,
instanceInfo: {
sessionProperties: sessionPropertiesWithoutEngines,
bugReportDetails,
},
bugReportDetails,
};
return payload;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment