Skip to content

Commit

Permalink
DEVPROD-5859 Remove Evergreen commit queue (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsamek authored Jun 18, 2024
1 parent f2fd8f4 commit 2e3181a
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 299 deletions.
1 change: 1 addition & 0 deletions apps/spruce/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ env/.cmdrc.json
.env.production.local
.vscode
node_modules
.tool-versions

npm-debug.log*
yarn-debug.log*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,6 @@ describe("Project Settings when defaulting to repo", () => {
cy.contains("Authorized Teams").should("not.exist");
});

it("Displays the repo's merge method as its default", () => {
cy.get("button[name=merge-method-select]").should(
"have.text",
"Default to Repo (squash)",
);
});

it("Defaults to overriding repo since a patch definition is defined", () => {
cy.dataCy("cq-override-radio-box")
.find("input")
Expand Down
32 changes: 3 additions & 29 deletions apps/spruce/cypress/integration/projectSettings/repo_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ describe("Repo Settings", () => {
cy.dataCy("cq-card")
.children()
.as("cqCardFields")
.should("have.length", 2);
.should("have.length", 1);

cy.get("@enableCQButton").click();
cy.get("@cqCardFields").should("have.length", 4);
cy.get("@cqCardFields").should("have.length", 2);
cy.contains("Commit Queue Patch Definitions").scrollIntoView();
cy.dataCy("error-banner")
.contains(
Expand All @@ -129,34 +129,13 @@ describe("Repo Settings", () => {
.should("be.visible");
});

it("Shows merge method only if merge queue is Evergreen", () => {
cy.get("@enableCQButton").click();
// Evergreen is the default value
cy.getInputByLabel("Evergreen").should("be.checked");
const selectId = "merge-method-select";
cy.dataCy(selectId).as("mergeMethodDropdown").scrollIntoView();
cy.dataCy(selectId).should("be.visible");
// Click GitHub
cy.contains("label", "GitHub").click();
cy.getInputByLabel("GitHub").should("be.checked");

// Hides merge method for GitHub.
cy.get("mergeMethodDropdown").should("not.exist");
// Shows merge method for Evergreen.
cy.contains("label", "Evergreen").click();
cy.getInputByLabel("Evergreen").should("be.checked");
cy.get("@mergeMethodDropdown").should("be.visible");
});

it("Does not show override buttons for commit queue patch definitions", () => {
cy.get("@enableCQButton").click();
cy.getInputByLabel("Evergreen").should("be.checked");
cy.dataCy("cq-override-radio-box").should("not.exist");
});

it("Saves a commit queue definition and uses the repo message as placeholder for a project setting ", () => {
it("Saves a commit queue definition", () => {
cy.get("@enableCQButton").click();
cy.dataCy("cq-message-input").type("Repo message wohoo!");
cy.contains("button", "Add Patch Definition").click();
cy.dataCy("variant-tags-input").first().type("vtag");
cy.dataCy("task-tags-input").first().type("ttag");
Expand All @@ -170,11 +149,6 @@ describe("Repo Settings", () => {
cy.validateToast("success", "Successfully updated repo");
cy.visit(getGeneralRoute(projectUseRepoEnabled));
cy.dataCy("navitem-github-commitqueue").click();
cy.dataCy("cq-message-input").should(
"have.attr",
"placeholder",
"Repo message wohoo! (Default from repo)",
);
});
});
});
Expand Down
2 changes: 0 additions & 2 deletions apps/spruce/src/constants/externalResources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ export const gitTagAliasesDocumentationUrl = `${projectDistroSettingsDocumentati

export const githubChecksAliasesDocumentationUrl = `${projectDistroSettingsDocumentationUrl}#github-checks-aliases`;

export const githubMergeQueueDocumentationUrl = `${wikiBaseUrl}/Project-Configuration/Merge-Queue`;

export const ignoredFilesDocumentationUrl = `${wikiBaseUrl}/Project-Configuration/Project-Configuration-Files#ignoring-changes-to-certain-files`;

export const cliDocumentationUrl = `${wikiBaseUrl}/CLI`;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
fragment ProjectGithubSettings on Project {
commitQueue {
enabled
mergeMethod
mergeQueue
message
}
githubChecksEnabled
githubTriggerAliases
Expand All @@ -18,9 +15,6 @@ fragment ProjectGithubSettings on Project {
fragment RepoGithubSettings on RepoRef {
commitQueue {
enabled
mergeMethod
mergeQueue
message
}
githubChecksEnabled
githubTriggerAliases
Expand Down
87 changes: 9 additions & 78 deletions apps/spruce/src/gql/generated/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3587,13 +3587,7 @@ export type ProjectGithubSettingsFragment = {
manualPrTestingEnabled?: boolean | null;
oldestAllowedMergeBase: string;
prTestingEnabled?: boolean | null;
commitQueue: {
__typename?: "CommitQueueParams";
enabled?: boolean | null;
mergeMethod: string;
mergeQueue: MergeQueue;
message: string;
};
commitQueue: { __typename?: "CommitQueueParams"; enabled?: boolean | null };
};

export type RepoGithubSettingsFragment = {
Expand All @@ -3606,13 +3600,7 @@ export type RepoGithubSettingsFragment = {
manualPrTestingEnabled: boolean;
oldestAllowedMergeBase: string;
prTestingEnabled: boolean;
commitQueue: {
__typename?: "RepoCommitQueueParams";
enabled: boolean;
mergeMethod: string;
mergeQueue: MergeQueue;
message: string;
};
commitQueue: { __typename?: "RepoCommitQueueParams"; enabled: boolean };
};

export type ProjectGithubCommitQueueFragment = {
Expand All @@ -3628,13 +3616,7 @@ export type ProjectGithubCommitQueueFragment = {
manualPrTestingEnabled?: boolean | null;
oldestAllowedMergeBase: string;
prTestingEnabled?: boolean | null;
commitQueue: {
__typename?: "CommitQueueParams";
enabled?: boolean | null;
mergeMethod: string;
mergeQueue: MergeQueue;
message: string;
};
commitQueue: { __typename?: "CommitQueueParams"; enabled?: boolean | null };
} | null;
};

Expand All @@ -3651,13 +3633,7 @@ export type RepoGithubCommitQueueFragment = {
manualPrTestingEnabled: boolean;
oldestAllowedMergeBase: string;
prTestingEnabled: boolean;
commitQueue: {
__typename?: "RepoCommitQueueParams";
enabled: boolean;
mergeMethod: string;
mergeQueue: MergeQueue;
message: string;
};
commitQueue: { __typename?: "RepoCommitQueueParams"; enabled: boolean };
} | null;
};

Expand All @@ -3674,13 +3650,7 @@ export type ProjectEventGithubCommitQueueFragment = {
manualPrTestingEnabled?: boolean | null;
oldestAllowedMergeBase: string;
prTestingEnabled?: boolean | null;
commitQueue: {
__typename?: "CommitQueueParams";
enabled?: boolean | null;
mergeMethod: string;
mergeQueue: MergeQueue;
message: string;
};
commitQueue: { __typename?: "CommitQueueParams"; enabled?: boolean | null };
} | null;
};

Expand Down Expand Up @@ -3820,13 +3790,7 @@ export type ProjectSettingsFieldsFragment = {
directory: string;
}> | null;
};
commitQueue: {
__typename?: "CommitQueueParams";
enabled?: boolean | null;
mergeMethod: string;
mergeQueue: MergeQueue;
message: string;
};
commitQueue: { __typename?: "CommitQueueParams"; enabled?: boolean | null };
} | null;
subscriptions?: Array<{
__typename?: "GeneralSubscription";
Expand Down Expand Up @@ -4017,13 +3981,7 @@ export type RepoSettingsFieldsFragment = {
directory: string;
}> | null;
};
commitQueue: {
__typename?: "RepoCommitQueueParams";
enabled: boolean;
mergeMethod: string;
mergeQueue: MergeQueue;
message: string;
};
commitQueue: { __typename?: "RepoCommitQueueParams"; enabled: boolean };
} | null;
subscriptions?: Array<{
__typename?: "GeneralSubscription";
Expand Down Expand Up @@ -4404,13 +4362,7 @@ export type ProjectEventSettingsFragment = {
directory: string;
}> | null;
};
commitQueue: {
__typename?: "CommitQueueParams";
enabled?: boolean | null;
mergeMethod: string;
mergeQueue: MergeQueue;
message: string;
};
commitQueue: { __typename?: "CommitQueueParams"; enabled?: boolean | null };
} | null;
subscriptions?: Array<{
__typename?: "GeneralSubscription";
Expand Down Expand Up @@ -6865,9 +6817,6 @@ export type ProjectEventLogsQuery = {
commitQueue: {
__typename?: "CommitQueueParams";
enabled?: boolean | null;
mergeMethod: string;
mergeQueue: MergeQueue;
message: string;
};
} | null;
subscriptions?: Array<{
Expand Down Expand Up @@ -7074,9 +7023,6 @@ export type ProjectEventLogsQuery = {
commitQueue: {
__typename?: "CommitQueueParams";
enabled?: boolean | null;
mergeMethod: string;
mergeQueue: MergeQueue;
message: string;
};
} | null;
subscriptions?: Array<{
Expand Down Expand Up @@ -7362,9 +7308,6 @@ export type ProjectSettingsQuery = {
commitQueue: {
__typename?: "CommitQueueParams";
enabled?: boolean | null;
mergeMethod: string;
mergeQueue: MergeQueue;
message: string;
};
} | null;
subscriptions?: Array<{
Expand Down Expand Up @@ -7619,9 +7562,6 @@ export type RepoEventLogsQuery = {
commitQueue: {
__typename?: "CommitQueueParams";
enabled?: boolean | null;
mergeMethod: string;
mergeQueue: MergeQueue;
message: string;
};
} | null;
subscriptions?: Array<{
Expand Down Expand Up @@ -7828,9 +7768,6 @@ export type RepoEventLogsQuery = {
commitQueue: {
__typename?: "CommitQueueParams";
enabled?: boolean | null;
mergeMethod: string;
mergeQueue: MergeQueue;
message: string;
};
} | null;
subscriptions?: Array<{
Expand Down Expand Up @@ -8039,13 +7976,7 @@ export type RepoSettingsQuery = {
directory: string;
}> | null;
};
commitQueue: {
__typename?: "RepoCommitQueueParams";
enabled: boolean;
mergeMethod: string;
mergeQueue: MergeQueue;
message: string;
};
commitQueue: { __typename?: "RepoCommitQueueParams"; enabled: boolean };
} | null;
subscriptions?: Array<{
__typename?: "GeneralSubscription";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
ProjectSettingsQueryVariables,
RepoSettingsQuery,
RepoSettingsQueryVariables,
MergeQueue,
} from "gql/generated/types";
import { COPY_PROJECT } from "gql/mutations";
import { PROJECT_SETTINGS, REPO_SETTINGS } from "gql/queries";
Expand Down Expand Up @@ -371,9 +370,6 @@ const projectSettingsMock: ApolloMock<
gitTagAuthorizedTeams: ["team"],
commitQueue: {
enabled: true,
mergeMethod: "squash",
mergeQueue: MergeQueue.Evergreen,
message: "",
__typename: "CommitQueueParams",
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
ProjectEventLogsQuery,
ProjectEventLogsQueryVariables,
ProjectHealthView,
MergeQueue,
} from "gql/generated/types";
import { PROJECT_EVENT_LOGS } from "gql/queries";
import { renderWithRouterMatch as render, screen, waitFor } from "test_utils";
Expand Down Expand Up @@ -151,9 +150,6 @@ const projectEventsQuery: ProjectEventLogsQuery = {
gitTagAuthorizedTeams: ["arst"],
commitQueue: {
enabled: true,
mergeMethod: "squash",
mergeQueue: MergeQueue.Evergreen,
message: "",
__typename: "CommitQueueParams",
},
parsleyFilters: [],
Expand Down Expand Up @@ -238,9 +234,6 @@ const projectEventsQuery: ProjectEventLogsQuery = {
gitTagAuthorizedTeams: ["evergreen"],
commitQueue: {
enabled: true,
mergeMethod: "squash",
mergeQueue: MergeQueue.Github,
message: "",
__typename: "CommitQueueParams",
},
parsleyFilters: [],
Expand Down
Loading

0 comments on commit 2e3181a

Please sign in to comment.