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 github.com:evergreen-ci/spruce into DEVPROD-3126
Browse files Browse the repository at this point in the history
  • Loading branch information
SupaJoon committed Jan 2, 2024
2 parents ad6079a + 723543d commit 6646635
Show file tree
Hide file tree
Showing 25 changed files with 302 additions and 77 deletions.
61 changes: 61 additions & 0 deletions cypress/integration/projectSettings/stepback_bisect.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { clickSave } from "../../utils";
import { getGeneralRoute, project, projectUseRepoEnabled } from "./constants";

describe("Stepback bisect setting", () => {
describe("Repo project present", () => {
const destination = getGeneralRoute(projectUseRepoEnabled);

beforeEach(() => {
cy.visit(destination);
});

it("Starts as default to repo", () => {
cy.dataCy("stepback-bisect-group")
.contains("Default to repo")
.find("input")
.should("have.attr", "aria-checked", "true");
});

it("Clicking on enabled and then save shows a success toast", () => {
cy.dataCy("stepback-bisect-group").contains("Enable").click();
clickSave();
cy.validateToast("success", "Successfully updated project");

cy.reload();

cy.dataCy("stepback-bisect-group")
.contains("Enable")
.find("input")
.should("have.attr", "aria-checked", "true");
});
});

describe("Repo project not present", () => {
const destination = getGeneralRoute(project);

beforeEach(() => {
cy.visit(destination);
});

it("Starts as disabled", () => {
cy.dataCy("stepback-bisect-group")
.contains("Disable")
.find("input")
.should("have.attr", "aria-checked", "true");
});

it("Clicking on enabled and then save shows a success toast", () => {
cy.dataCy("stepback-bisect-group").contains("Enable").click();

clickSave();
cy.validateToast("success", "Successfully updated project");

cy.reload();

cy.dataCy("stepback-bisect-group")
.contains("Enable")
.find("input")
.should("have.attr", "aria-checked", "true");
});
});
});
2 changes: 1 addition & 1 deletion cypress/integration/spawn/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ describe("Navigating to Spawn Host page", () => {
cy.dataCy("distro-option-ubuntu1804-workstation")
.should("be.visible")
.click();
cy.dataCy("volume-select").should("be.disabled");
cy.dataCy("volume-select").should("have.attr", "aria-disabled", "true");
});

it("Clicking 'Add new key' hides the key name dropdown and shows the key value text area", () => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/spawn/volume.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ describe("Spawn volume page", () => {
).click();
cy.dataCy("distro-input").click();
cy.dataCy("distro-option-ubuntu1804-workstation").click();
cy.dataCy("region-select").should("be.disabled");
cy.dataCy("region-select").should("have.attr", "aria-disabled", "true");
cy.dataCy("migrate-modal").contains("Next").click({ force: true });
cy.dataCy("migrate-modal")
.contains("Migrate Volume")
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/task/files_tables.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe("files table", () => {
const FILES_ROUTE = "/task/evergreen_ubuntu1604_89/files";
const FILES_ROUTE_WITHOUT_FILES =
"/task/evergreen_ubuntu1604_test_model_commitqueue_patch_5e823e1f28baeaa22ae00823d83e03082cd148ab_5e4ff3abe3c3317e352062e4_20_02_21_15_13_48/files ";
"/task/evergreen_ubuntu1604_test_model_commitqueue_patch_5e823e1f28baeaa22ae00823d83e03082cd148ab_5e4ff3abe3c3317e352062e4_20_02_21_15_13_48/files";

it("File names under name column should link to a new tab", () => {
cy.visit(FILES_ROUTE);
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
"@leafygreen-ui/confirmation-modal": "5.0.6",
"@leafygreen-ui/emotion": "4.0.7",
"@leafygreen-ui/expandable-card": "3.0.5",
"@leafygreen-ui/guide-cue": "5.0.4",
"@leafygreen-ui/icon": "11.12.1",
"@leafygreen-ui/guide-cue": "5.0.5",
"@leafygreen-ui/icon": "11.26.0",
"@leafygreen-ui/icon-button": "15.0.5",
"@leafygreen-ui/inline-definition": "6.0.14",
"@leafygreen-ui/interaction-ring": "7.0.2",
Expand All @@ -86,7 +86,7 @@
"@leafygreen-ui/radio-group": "10.1.1",
"@leafygreen-ui/search-input": "2.0.8",
"@leafygreen-ui/segmented-control": "8.2.6",
"@leafygreen-ui/select": "10.2.0",
"@leafygreen-ui/select": "11.1.1",
"@leafygreen-ui/side-nav": "14.0.3",
"@leafygreen-ui/skeleton-loader": "1.1.0",
"@leafygreen-ui/table": "12.1.4",
Expand Down Expand Up @@ -158,7 +158,7 @@
"@types/new-relic-browser": "0.1212.2",
"@types/node": "^16.11.47",
"@types/pluralize": "0.0.29",
"@types/prompts": "2.4.6",
"@types/prompts": "2.4.9",
"@types/react": "18.2.0",
"@types/react-dom": "18.2.0",
"@typescript-eslint/eslint-plugin": "5.57.1",
Expand Down
4 changes: 4 additions & 0 deletions src/analytics/task/useTaskAnalytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ type Action =
}
| { name: "Click Trace Link" }
| { name: "Click Trace Metrics Link" }
| { name: "Click Last Passing Stepback Task Link" }
| { name: "Click Last Failing Stepback Task Link" }
| { name: "Click Previous Stepback Task Link" }
| { name: "Click Next Stepback Task Link" }
| { name: "Submit Previous Commit Selector"; type: CommitType };

export const useTaskAnalytics = () => {
Expand Down
1 change: 0 additions & 1 deletion src/components/Hosts/UpdateStatusModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ export const UpdateStatusModal: React.FC<Props> = ({
);
};

// @ts-expect-error
const StyledSelect = styled(Select)`
margin-bottom: ${size.xs};
`;
Expand Down
1 change: 0 additions & 1 deletion src/components/PageSizeSelector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const PageSizeSelector: React.FC<Props> = ({ onChange, value, ...rest }) => (
</StyledSelect>
);

// @ts-expect-error
const StyledSelect = styled(Select)`
width: 120px;
`;
Expand Down
1 change: 0 additions & 1 deletion src/components/TupleSelect/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ const LabelContainer = styled.div`
flex-direction: row;
`;

// @ts-expect-error
const GroupedSelect = styled(Select)`
width: 30%;
/* overwrite lg borders https://jira.mongodb.org/browse/PD-1995 */
Expand Down
2 changes: 2 additions & 0 deletions src/constants/cookies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ export const INCLUDE_COMMIT_QUEUE_USER_PATCHES =
"include-commit-queue-user-patches";
export const INCLUDE_HIDDEN_PATCHES = "include-hidden-patches";
export const SEEN_HONEYCOMB_GUIDE_CUE = "seen-honeycomb-guide-cue";
export const SEEN_PARSLEY_FILES_GUIDE_CUE = "seen-parsley-files-guide-cue";
export const SEEN_MIGRATE_GUIDE_CUE = "seen-migrate-guide-cue";
export const SLACK_NOTIFICATION_BANNER = "has-closed-slack-banner";
export const SUBSCRIPTION_METHOD = "subscription-method";
2 changes: 2 additions & 0 deletions src/gql/fragments/projectSettings/general.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ fragment ProjectGeneralSettings on Project {
repo
repotrackerDisabled
spawnHostScriptPath
stepbackBisect
stepbackDisabled
taskSync {
configEnabled
Expand All @@ -32,6 +33,7 @@ fragment RepoGeneralSettings on RepoRef {
repo
repotrackerDisabled
spawnHostScriptPath
stepbackBisect
stepbackDisabled
taskSync {
configEnabled
Expand Down
27 changes: 27 additions & 0 deletions src/gql/generated/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2418,6 +2418,14 @@ export type StatusCount = {
status: Scalars["String"]["output"];
};

export type StepbackInfo = {
__typename?: "StepbackInfo";
lastFailingStepbackTaskId?: Maybe<Scalars["String"]["output"]>;
lastPassingStepbackTaskId?: Maybe<Scalars["String"]["output"]>;
nextStepbackTaskId?: Maybe<Scalars["String"]["output"]>;
previousStepbackTaskId?: Maybe<Scalars["String"]["output"]>;
};

export type Subscriber = {
__typename?: "Subscriber";
emailSubscriber?: Maybe<Scalars["String"]["output"]>;
Expand Down Expand Up @@ -2526,6 +2534,7 @@ export type Task = {
spawnHostLink?: Maybe<Scalars["String"]["output"]>;
startTime?: Maybe<Scalars["Time"]["output"]>;
status: Scalars["String"]["output"];
stepbackInfo?: Maybe<StepbackInfo>;
/** @deprecated Use files instead */
taskFiles: TaskFiles;
taskGroup?: Maybe<Scalars["String"]["output"]>;
Expand Down Expand Up @@ -3459,6 +3468,7 @@ export type ProjectGeneralSettingsFragment = {
repo: string;
repotrackerDisabled?: boolean | null;
spawnHostScriptPath: string;
stepbackBisect?: boolean | null;
stepbackDisabled?: boolean | null;
versionControlEnabled?: boolean | null;
taskSync: {
Expand All @@ -3481,6 +3491,7 @@ export type RepoGeneralSettingsFragment = {
repo: string;
repotrackerDisabled: boolean;
spawnHostScriptPath: string;
stepbackBisect?: boolean | null;
stepbackDisabled: boolean;
versionControlEnabled: boolean;
taskSync: {
Expand Down Expand Up @@ -3628,6 +3639,7 @@ export type ProjectSettingsFieldsFragment = {
repo: string;
repotrackerDisabled?: boolean | null;
spawnHostScriptPath: string;
stepbackBisect?: boolean | null;
stepbackDisabled?: boolean | null;
versionControlEnabled?: boolean | null;
notifyOnBuildFailure?: boolean | null;
Expand Down Expand Up @@ -3834,6 +3846,7 @@ export type RepoSettingsFieldsFragment = {
repo: string;
repotrackerDisabled: boolean;
spawnHostScriptPath: string;
stepbackBisect?: boolean | null;
stepbackDisabled: boolean;
versionControlEnabled: boolean;
notifyOnBuildFailure: boolean;
Expand Down Expand Up @@ -4235,6 +4248,7 @@ export type ProjectEventSettingsFragment = {
repo: string;
repotrackerDisabled?: boolean | null;
spawnHostScriptPath: string;
stepbackBisect?: boolean | null;
stepbackDisabled?: boolean | null;
notifyOnBuildFailure?: boolean | null;
githubTriggerAliases?: Array<string> | null;
Expand Down Expand Up @@ -6698,6 +6712,7 @@ export type ProjectEventLogsQuery = {
repo: string;
repotrackerDisabled?: boolean | null;
spawnHostScriptPath: string;
stepbackBisect?: boolean | null;
stepbackDisabled?: boolean | null;
notifyOnBuildFailure?: boolean | null;
githubTriggerAliases?: Array<string> | null;
Expand Down Expand Up @@ -6910,6 +6925,7 @@ export type ProjectEventLogsQuery = {
repo: string;
repotrackerDisabled?: boolean | null;
spawnHostScriptPath: string;
stepbackBisect?: boolean | null;
stepbackDisabled?: boolean | null;
notifyOnBuildFailure?: boolean | null;
githubTriggerAliases?: Array<string> | null;
Expand Down Expand Up @@ -7197,6 +7213,7 @@ export type ProjectSettingsQuery = {
repo: string;
repotrackerDisabled?: boolean | null;
spawnHostScriptPath: string;
stepbackBisect?: boolean | null;
stepbackDisabled?: boolean | null;
versionControlEnabled?: boolean | null;
notifyOnBuildFailure?: boolean | null;
Expand Down Expand Up @@ -7455,6 +7472,7 @@ export type RepoEventLogsQuery = {
repo: string;
repotrackerDisabled?: boolean | null;
spawnHostScriptPath: string;
stepbackBisect?: boolean | null;
stepbackDisabled?: boolean | null;
notifyOnBuildFailure?: boolean | null;
githubTriggerAliases?: Array<string> | null;
Expand Down Expand Up @@ -7667,6 +7685,7 @@ export type RepoEventLogsQuery = {
repo: string;
repotrackerDisabled?: boolean | null;
spawnHostScriptPath: string;
stepbackBisect?: boolean | null;
stepbackDisabled?: boolean | null;
notifyOnBuildFailure?: boolean | null;
githubTriggerAliases?: Array<string> | null;
Expand Down Expand Up @@ -7883,6 +7902,7 @@ export type RepoSettingsQuery = {
repo: string;
repotrackerDisabled: boolean;
spawnHostScriptPath: string;
stepbackBisect?: boolean | null;
stepbackDisabled: boolean;
versionControlEnabled: boolean;
notifyOnBuildFailure: boolean;
Expand Down Expand Up @@ -8551,6 +8571,13 @@ export type TaskQuery = {
};
pod?: { __typename?: "Pod"; id: string } | null;
project?: { __typename?: "Project"; id: string; identifier: string } | null;
stepbackInfo?: {
__typename?: "StepbackInfo";
lastFailingStepbackTaskId?: string | null;
lastPassingStepbackTaskId?: string | null;
nextStepbackTaskId?: string | null;
previousStepbackTaskId?: string | null;
} | null;
versionMetadata: {
__typename?: "Version";
author: string;
Expand Down
6 changes: 6 additions & 0 deletions src/gql/queries/task.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ query Task($taskId: String!, $execution: Int) {
resetWhenFinished
spawnHostLink
startTime
stepbackInfo {
lastFailingStepbackTaskId
lastPassingStepbackTaskId
nextStepbackTaskId
previousStepbackTaskId
}
timeTaken
totalTestCount
versionMetadata {
Expand Down
1 change: 1 addition & 0 deletions src/pages/projectSettings/CopyProjectModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ const projectSettingsMock: ApolloMock<
deactivatePrevious: true,
repotrackerDisabled: false,
stepbackDisabled: null,
stepbackBisect: null,
patchingDisabled: false,
taskSync: {
configEnabled: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ const projectEventsQuery: ProjectEventLogsQuery = {
deactivatePrevious: true,
repotrackerDisabled: false,
stepbackDisabled: null,
stepbackBisect: null,
patchingDisabled: false,
taskSync: {
configEnabled: false,
Expand Down Expand Up @@ -186,6 +187,7 @@ const projectEventsQuery: ProjectEventLogsQuery = {
deactivatePrevious: true,
repotrackerDisabled: false,
stepbackDisabled: null,
stepbackBisect: null,
patchingDisabled: false,
taskSync: {
configEnabled: false,
Expand Down
14 changes: 14 additions & 0 deletions src/pages/projectSettings/tabs/GeneralTab/getFormSchema.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,14 @@ export const getFormSchema = (
true
),
},
stepbackBisection: {
type: ["boolean", "null"],
title: "Stepback Bisection",
oneOf: radioBoxOptions(
["Enabled", "Disabled"],
repoData?.projectFlags?.scheduling?.stepbackBisection
),
},
deactivateStepback: {
type: "null" as "null",
},
Expand Down Expand Up @@ -342,6 +350,12 @@ export const getFormSchema = (
"ui:description":
"Disabling this setting will override all enabled stepback settings for the project. Disabling stepback won't cancel any active stepback tasks, but it will prevent any future ones.",
},
stepbackBisection: {
"ui:widget": widgets.RadioBoxWidget,
"ui:description":
"Bisection will cause your stepback to activate the midway task between the last failing task and last passing task.",
"ui:data-cy": "stepback-bisect-group",
},
deactivateStepback: {
"ui:field": "deactivateStepbackTask",
"ui:showLabel": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const repoForm: GeneralFormState = {
scheduling: {
deactivatePrevious: true,
stepbackDisabled: true,
stepbackBisection: true,
deactivateStepback: null,
},
repotracker: {
Expand Down Expand Up @@ -81,6 +82,7 @@ const repoResult: Pick<RepoSettingsInput, "projectRef"> = {
repotrackerDisabled: false,
patchingDisabled: false,
stepbackDisabled: true,
stepbackBisect: true,
taskSync: {
configEnabled: true,
patchEnabled: true,
Expand Down Expand Up @@ -111,6 +113,7 @@ const projectForm: GeneralFormState = {
scheduling: {
deactivatePrevious: null,
stepbackDisabled: null,
stepbackBisection: null,
deactivateStepback: null,
},
repotracker: {
Expand Down Expand Up @@ -148,6 +151,7 @@ const projectResult: Pick<ProjectSettingsInput, "projectRef"> = {
repotrackerDisabled: null,
patchingDisabled: null,
stepbackDisabled: null,
stepbackBisect: null,
taskSync: {
configEnabled: null,
patchEnabled: null,
Expand Down
Loading

0 comments on commit 6646635

Please sign in to comment.