Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' of https://github.com/evergreen-ci/spruce into EV…
Browse files Browse the repository at this point in the history
  • Loading branch information
sophstad committed Sep 6, 2023
2 parents 2130941 + 55af81b commit d8e6cf0
Show file tree
Hide file tree
Showing 26 changed files with 491 additions and 159 deletions.
1 change: 1 addition & 0 deletions .evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ functions:
script: |
echo "Generating .env-cmdrc.json"
REACT_APP_BUGSNAG_API_KEY=${REACT_APP_BUGSNAG_API_KEY} \
REACT_APP_SENTRY_AUTH_TOKEN=${REACT_APP_SENTRY_AUTH_TOKEN} \
REACT_APP_SENTRY_DSN=${REACT_APP_SENTRY_DSN} \
REACT_APP_NEW_RELIC_ACCOUNT_ID=${REACT_APP_NEW_RELIC_ACCOUNT_ID} \
REACT_APP_NEW_RELIC_AGENT_ID=${REACT_APP_NEW_RELIC_AGENT_ID} \
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/job_logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe("Job logs page", () => {
cy.get("th")
.should("have.length", 1)
.then((th) => {
cy.wrap(th).should("have.attr", "aria-sort", "none");
cy.wrap(th).should("not.have.attr", "aria-sort");
});

cy.dataCy("complete-test-logs-link")
Expand Down
3 changes: 0 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,5 @@ module.exports = {
"jest-watch-typeahead/testname",
],
globalSetup: "<rootDir>/global-setup.js",
globals: {
APP_VERSION: JSON.stringify(process.env.npm_package_version),
},
testTimeout: 30000,
};
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spruce",
"version": "3.0.132",
"version": "3.0.133",
"private": true,
"scripts": {
"bootstrap-logkeeper": "./scripts/bootstrap-logkeeper.sh",
Expand Down Expand Up @@ -77,7 +77,7 @@
"@leafygreen-ui/inline-definition": "6.0.0",
"@leafygreen-ui/interaction-ring": "7.0.2",
"@leafygreen-ui/leafygreen-provider": "3.1.0",
"@leafygreen-ui/loading-indicator": "2.0.0",
"@leafygreen-ui/loading-indicator": "2.0.5",
"@leafygreen-ui/marketing-modal": "^4.0.5",
"@leafygreen-ui/menu": "20.0.1",
"@leafygreen-ui/modal": "14.0.1",
Expand All @@ -92,7 +92,7 @@
"@leafygreen-ui/select": "10.2.0",
"@leafygreen-ui/side-nav": "13.0.2",
"@leafygreen-ui/table": "10.0.1",
"@leafygreen-ui/table/new": "npm:@leafygreen-ui/[email protected].0",
"@leafygreen-ui/table/new": "npm:@leafygreen-ui/[email protected].10",
"@leafygreen-ui/tabs": "11.0.4",
"@leafygreen-ui/text-area": "8.0.4",
"@leafygreen-ui/text-input": "12.1.0",
Expand Down Expand Up @@ -142,6 +142,7 @@
"@graphql-codegen/typescript-operations": "4.0.1",
"@graphql-eslint/eslint-plugin": "3.18.0",
"@originjs/vite-plugin-commonjs": "1.0.3",
"@sentry/vite-plugin": "2.6.2",
"@storybook/addon-actions": "7.0.21",
"@storybook/addon-essentials": "7.0.21",
"@storybook/addon-interactions": "7.0.21",
Expand Down
1 change: 1 addition & 0 deletions scripts/setup-credentials.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const production = {
REACT_APP_SPRUCE_URL: "https://spruce.mongodb.com",
REACT_APP_RELEASE_STAGE: "production",
REACT_APP_BUGSNAG_API_KEY: process.env.REACT_APP_BUGSNAG_API_KEY,
REACT_APP_SENTRY_AUTH_TOKEN: process.env.REACT_APP_SENTRY_AUTH_TOKEN,
REACT_APP_SENTRY_DSN: process.env.REACT_APP_SENTRY_DSN,
REACT_APP_NEW_RELIC_ACCOUNT_ID: process.env.REACT_APP_NEW_RELIC_ACCOUNT_ID,
REACT_APP_NEW_RELIC_AGENT_ID: process.env.REACT_APP_NEW_RELIC_AGENT_ID,
Expand Down
1 change: 0 additions & 1 deletion src/components/ErrorHandling/Sentry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const initializeSentry = () => {
dsn: getSentryDSN(),
debug: !isProduction(),
normalizeDepth: 5,
release: APP_VERSION,
environment: releaseStage,
});
} catch (e) {
Expand Down
3 changes: 0 additions & 3 deletions src/components/ErrorHandling/initialize.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ describe("should initialize error handlers according to release stage", () => {
dsn: "fake-sentry-key",
debug: false,
normalizeDepth: 5,
release: APP_VERSION,
environment: "production",
});
});
Expand All @@ -71,7 +70,6 @@ describe("should initialize error handlers according to release stage", () => {
dsn: "fake-sentry-key",
debug: true,
normalizeDepth: 5,
release: APP_VERSION,
environment: "beta",
});
});
Expand All @@ -95,7 +93,6 @@ describe("should initialize error handlers according to release stage", () => {
dsn: "fake-sentry-key",
debug: true,
normalizeDepth: 5,
release: APP_VERSION,
environment: "staging",
});
});
Expand Down
91 changes: 51 additions & 40 deletions src/components/Settings/EventLog/EventDiffTable.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import styled from "@emotion/styled";
import Badge, { Variant } from "@leafygreen-ui/badge";
import { Table, TableHeader, Row, Cell } from "@leafygreen-ui/table";
import {
V10Table as Table,
V10TableHeader as TableHeader,
V10Row as Row,
V10Cell as Cell,
V11Adapter,
V10HeaderRow as HeaderRow,
} from "@leafygreen-ui/table/new";
import { fontFamilies } from "@leafygreen-ui/tokens";
import { getEventDiffLines } from "./EventLogDiffs";
import { Event, EventDiffLine, EventValue } from "./types";
Expand All @@ -11,45 +18,49 @@ type TableProps = {
};

export const EventDiffTable: React.FC<TableProps> = ({ after, before }) => (
<Table
data={getEventDiffLines(before, after)}
data-cy="event-diff-table"
columns={[
<TableHeader
key="key"
label="Property"
sortBy={(datum: EventDiffLine) => datum.key}
/>,
<TableHeader
key="before"
label="Before"
sortBy={(datum: EventDiffLine) => JSON.stringify(datum.before)}
/>,
<TableHeader
key="after"
label="After"
sortBy={(datum: EventDiffLine) => JSON.stringify(datum.after)}
/>,
]}
>
{({ datum }) => (
<Row key={datum.key} data-cy="event-log-table-row">
<Cell>
<CellText>{datum.key}</CellText>
</Cell>
<Cell>
<CellText>{renderEventValue(datum.before)}</CellText>
</Cell>
<Cell>
{renderEventValue(datum.after) === null ? (
<Badge variant={Variant.Red}>Deleted</Badge>
) : (
<CellText>{renderEventValue(datum.after)}</CellText>
)}
</Cell>
</Row>
)}
</Table>
<V11Adapter shouldAlternateRowColor>
<Table
data={getEventDiffLines(before, after)}
data-cy="event-diff-table"
columns={
<HeaderRow>
<TableHeader
key="key"
label="Property"
sortBy={(datum: EventDiffLine) => datum.key}
/>
<TableHeader
key="before"
label="Before"
sortBy={(datum: EventDiffLine) => JSON.stringify(datum.before)}
/>
<TableHeader
key="after"
label="After"
sortBy={(datum: EventDiffLine) => JSON.stringify(datum.after)}
/>
</HeaderRow>
}
>
{({ datum }) => (
<Row key={datum.key} data-cy="event-log-table-row">
<Cell>
<CellText>{datum.key}</CellText>
</Cell>
<Cell>
<CellText>{renderEventValue(datum.before)}</CellText>
</Cell>
<Cell>
{renderEventValue(datum.after) === null ? (
<Badge variant={Variant.Red}>Deleted</Badge>
) : (
<CellText>{renderEventValue(datum.after)}</CellText>
)}
</Cell>
</Row>
)}
</Table>
</V11Adapter>
);

const CellText = styled.span`
Expand Down
3 changes: 2 additions & 1 deletion src/components/SpruceForm/Widgets/LeafyGreenWidgets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export const LeafyGreenCheckBox: React.FC<SpruceWidgetProps> = ({
value,
}) => {
const {
bold,
customLabel,
"data-cy": dataCy,
description,
Expand All @@ -113,7 +114,7 @@ export const LeafyGreenCheckBox: React.FC<SpruceWidgetProps> = ({
return (
<ElementWrapper css={elementWrapperCSS}>
<Checkbox
bold={false}
bold={bold || false}
checked={value}
data-cy={dataCy}
description={description}
Expand Down
1 change: 1 addition & 0 deletions src/components/SpruceForm/Widgets/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface SpruceWidgetProps extends WidgetProps {
"aria-controls": string[];
"data-cy": string;
ariaLabelledBy: string;
bold: boolean;
customLabel: string;
description: string;
elementWrapperCSS: SerializedStyles;
Expand Down
2 changes: 2 additions & 0 deletions src/gql/fragments/projectSettings/projectTriggers.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ fragment ProjectTriggersSettings on Project {
project
status
taskRegex
unscheduleDownstreamVersions
}
}

Expand All @@ -21,5 +22,6 @@ fragment RepoTriggersSettings on RepoRef {
project
status
taskRegex
unscheduleDownstreamVersions
}
}
13 changes: 13 additions & 0 deletions src/gql/generated/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2426,6 +2426,7 @@ export type Task = {
executionTasksFull?: Maybe<Array<Task>>;
expectedDuration?: Maybe<Scalars["Duration"]["output"]>;
failedTestCount: Scalars["Int"]["output"];
files: TaskFiles;
finishTime?: Maybe<Scalars["Time"]["output"]>;
generateTask?: Maybe<Scalars["Boolean"]["output"]>;
generatedBy?: Maybe<Scalars["String"]["output"]>;
Expand All @@ -2452,6 +2453,7 @@ export type Task = {
spawnHostLink?: Maybe<Scalars["String"]["output"]>;
startTime?: Maybe<Scalars["Time"]["output"]>;
status: Scalars["String"]["output"];
/** @deprecated Use files instead */
taskFiles: TaskFiles;
taskGroup?: Maybe<Scalars["String"]["output"]>;
taskGroupMaxHosts?: Maybe<Scalars["Int"]["output"]>;
Expand Down Expand Up @@ -3634,6 +3636,7 @@ export type ProjectSettingsFieldsFragment = {
project: string;
status: string;
taskRegex: string;
unscheduleDownstreamVersions?: boolean | null;
}> | null;
parsleyFilters?: Array<{
__typename?: "ParsleyFilter";
Expand Down Expand Up @@ -3832,6 +3835,7 @@ export type RepoSettingsFieldsFragment = {
project: string;
status: string;
taskRegex: string;
unscheduleDownstreamVersions?: boolean | null;
}>;
workstationConfig: {
__typename?: "RepoWorkstationConfig";
Expand Down Expand Up @@ -4222,6 +4226,7 @@ export type ProjectEventSettingsFragment = {
project: string;
status: string;
taskRegex: string;
unscheduleDownstreamVersions?: boolean | null;
}> | null;
parsleyFilters?: Array<{
__typename?: "ParsleyFilter";
Expand Down Expand Up @@ -4321,6 +4326,7 @@ export type ProjectTriggersSettingsFragment = {
project: string;
status: string;
taskRegex: string;
unscheduleDownstreamVersions?: boolean | null;
}> | null;
};

Expand All @@ -4336,6 +4342,7 @@ export type RepoTriggersSettingsFragment = {
project: string;
status: string;
taskRegex: string;
unscheduleDownstreamVersions?: boolean | null;
}>;
};

Expand Down Expand Up @@ -6596,6 +6603,7 @@ export type ProjectEventLogsQuery = {
project: string;
status: string;
taskRegex: string;
unscheduleDownstreamVersions?: boolean | null;
}> | null;
parsleyFilters?: Array<{
__typename?: "ParsleyFilter";
Expand Down Expand Up @@ -6806,6 +6814,7 @@ export type ProjectEventLogsQuery = {
project: string;
status: string;
taskRegex: string;
unscheduleDownstreamVersions?: boolean | null;
}> | null;
parsleyFilters?: Array<{
__typename?: "ParsleyFilter";
Expand Down Expand Up @@ -7031,6 +7040,7 @@ export type ProjectSettingsQuery = {
project: string;
status: string;
taskRegex: string;
unscheduleDownstreamVersions?: boolean | null;
}> | null;
parsleyFilters?: Array<{
__typename?: "ParsleyFilter";
Expand Down Expand Up @@ -7280,6 +7290,7 @@ export type RepoEventLogsQuery = {
project: string;
status: string;
taskRegex: string;
unscheduleDownstreamVersions?: boolean | null;
}> | null;
parsleyFilters?: Array<{
__typename?: "ParsleyFilter";
Expand Down Expand Up @@ -7490,6 +7501,7 @@ export type RepoEventLogsQuery = {
project: string;
status: string;
taskRegex: string;
unscheduleDownstreamVersions?: boolean | null;
}> | null;
parsleyFilters?: Array<{
__typename?: "ParsleyFilter";
Expand Down Expand Up @@ -7705,6 +7717,7 @@ export type RepoSettingsQuery = {
project: string;
status: string;
taskRegex: string;
unscheduleDownstreamVersions?: boolean | null;
}>;
workstationConfig: {
__typename?: "RepoWorkstationConfig";
Expand Down
Loading

0 comments on commit d8e6cf0

Please sign in to comment.