diff --git a/apps/parsley/README.md b/apps/parsley/README.md index a61767eba..5ec8c50fb 100644 --- a/apps/parsley/README.md +++ b/apps/parsley/README.md @@ -33,17 +33,14 @@ develop against them you will need to run both of the servers locally. **Logkeeper** 1. Clone the [Logkeeper Repository](https://github.com/evergreen-ci/logkeeper) -2. Run `yarn bootstrap-logkeeper` to download some sample resmoke logs from s3. +2. Run `yarn bootstrap-s3-logs` to download some sample resmoke logs from s3. 3. Run the command outputted by the previous step to seed the env variables and - start the local logkeeper server + start the local logkeeper server with the following command: ```bash LK_CORS_ORIGINS=http:\/\/localhost:\\d+ LK_EVERGREEN_ORIGIN=http://localhost:8080 LK_PARSLEY_ORIGIN=http://localhost:5173 go run main/logkeeper.go --localPath {abs_path_to_parsley}/bin/_bucketdata ``` - Note that all log output is piped to a file named `logkeeperapp.log`. You can - use `tail -f logkeeperapp.log` to view the log output. - ### GraphQL Type Generation To be able to use code generation, you'll need to create a symlink to the diff --git a/apps/parsley/package.json b/apps/parsley/package.json index 86996bb5a..70304c4ee 100644 --- a/apps/parsley/package.json +++ b/apps/parsley/package.json @@ -1,10 +1,10 @@ { "name": "parsley", - "version": "2.1.56", + "version": "2.1.58", "private": true, "type": "module", "scripts": { - "bootstrap-logkeeper": "./scripts/bootstrap-logkeeper.sh", + "bootstrap-s3-logs": "../../scripts/bootstrap-s3-logs.sh", "build": "tsc && GIT_SHA=`git rev-parse HEAD` APP_VERSION=$npm_package_version vite build", "build:local": "env-cmd -e local -r .env-cmdrc.local.json yarn build", "build:beta": "env-cmd -e beta yarn build", diff --git a/apps/parsley/src/gql/generated/types.ts b/apps/parsley/src/gql/generated/types.ts index 29a008cb1..9c2d388e4 100644 --- a/apps/parsley/src/gql/generated/types.ts +++ b/apps/parsley/src/gql/generated/types.ts @@ -633,6 +633,14 @@ export type GeneralSubscription = { triggerData?: Maybe; }; +export type GeneratedTaskCountResults = { + __typename?: "GeneratedTaskCountResults"; + buildVariantName?: Maybe; + estimatedTasks: Scalars["Int"]["output"]; + taskId?: Maybe; + taskName?: Maybe; +}; + export type GitHubDynamicTokenPermissionGroup = { __typename?: "GitHubDynamicTokenPermissionGroup"; name: Scalars["String"]["output"]; @@ -748,6 +756,8 @@ export type Host = { distro?: Maybe; distroId?: Maybe; elapsed?: Maybe; + /** events returns the event log entries for a given host. */ + events: HostEvents; expiration?: Maybe; homeVolume?: Maybe; homeVolumeID?: Maybe; @@ -770,6 +780,13 @@ export type Host = { volumes: Array; }; +/** Host models a host, which are used for things like running tasks or as virtual workstations. */ +export type HostEventsArgs = { + limit?: InputMaybe; + page?: InputMaybe; + sortDir?: InputMaybe; +}; + export type HostAllocatorSettings = { __typename?: "HostAllocatorSettings"; acceptableHostIdleTime: Scalars["Duration"]["output"]; @@ -1616,7 +1633,7 @@ export type Patch = { createTime?: Maybe; description: Scalars["String"]["output"]; duration?: Maybe; - generatedTaskCounts: Scalars["Map"]["output"]; + generatedTaskCounts: Array; githash: Scalars["String"]["output"]; hidden: Scalars["Boolean"]["output"]; id: Scalars["ID"]["output"]; @@ -1879,7 +1896,6 @@ export type Project = { perfEnabled?: Maybe; periodicBuilds?: Maybe>; prTestingEnabled?: Maybe; - private?: Maybe; projectHealthView: ProjectHealthView; remotePath: Scalars["String"]["output"]; repo: Scalars["String"]["output"]; @@ -2018,7 +2034,6 @@ export type ProjectInput = { perfEnabled?: InputMaybe; periodicBuilds?: InputMaybe>; prTestingEnabled?: InputMaybe; - private?: InputMaybe; projectHealthView?: InputMaybe; remotePath?: InputMaybe; repo?: InputMaybe; @@ -2150,6 +2165,7 @@ export type Query = { githubProjectConflicts: GithubProjectConflicts; hasVersion: Scalars["Boolean"]["output"]; host?: Maybe; + /** @deprecated Use host.events instead. */ hostEvents: HostEvents; hosts: HostsResponse; image?: Maybe; @@ -2180,6 +2196,7 @@ export type Query = { userSettings?: Maybe; version: Version; viewableProjectRefs: Array; + waterfall?: Maybe; }; export type QueryBbGetCreatedTicketsArgs = { @@ -2320,6 +2337,10 @@ export type QueryVersionArgs = { versionId: Scalars["String"]["input"]; }; +export type QueryWaterfallArgs = { + options: WaterfallOptions; +}; + export type RemoveFavoriteProjectInput = { projectIdentifier: Scalars["String"]["input"]; }; @@ -2366,7 +2387,6 @@ export type RepoRef = { perfEnabled: Scalars["Boolean"]["output"]; periodicBuilds?: Maybe>; prTestingEnabled: Scalars["Boolean"]["output"]; - private: Scalars["Boolean"]["output"]; remotePath: Scalars["String"]["output"]; repo: Scalars["String"]["output"]; repotrackerDisabled: Scalars["Boolean"]["output"]; @@ -2410,7 +2430,6 @@ export type RepoRefInput = { perfEnabled?: InputMaybe; periodicBuilds?: InputMaybe>; prTestingEnabled?: InputMaybe; - private?: InputMaybe; remotePath?: InputMaybe; repo?: InputMaybe; repotrackerDisabled?: InputMaybe; @@ -2553,7 +2572,6 @@ export type SleepSchedule = { __typename?: "SleepSchedule"; dailyStartTime: Scalars["String"]["output"]; dailyStopTime: Scalars["String"]["output"]; - isBetaTester?: Maybe; nextStartTime?: Maybe; nextStopTime?: Maybe; permanentlyExempt: Scalars["Boolean"]["output"]; @@ -2566,7 +2584,6 @@ export type SleepSchedule = { export type SleepScheduleInput = { dailyStartTime: Scalars["String"]["input"]; dailyStopTime: Scalars["String"]["input"]; - isBetaTester?: InputMaybe; permanentlyExempt: Scalars["Boolean"]["input"]; shouldKeepOff: Scalars["Boolean"]["input"]; temporarilyExemptUntil?: InputMaybe; @@ -3278,7 +3295,7 @@ export type Version = { errors: Array; externalLinksForMetadata: Array; finishTime?: Maybe; - generatedTaskCounts: Scalars["Map"]["output"]; + generatedTaskCounts: Array; gitTags?: Maybe>; id: Scalars["String"]["output"]; ignored: Scalars["Boolean"]["output"]; @@ -3374,6 +3391,41 @@ export type VolumeHost = { volumeId: Scalars["String"]["input"]; }; +export type Waterfall = { + __typename?: "Waterfall"; + buildVariants: Array; + versions: Array; +}; + +export type WaterfallBuild = { + __typename?: "WaterfallBuild"; + activated?: Maybe; + displayName: Scalars["String"]["output"]; + id: Scalars["String"]["output"]; + tasks: Array; + version: Scalars["String"]["output"]; +}; + +export type WaterfallBuildVariant = { + __typename?: "WaterfallBuildVariant"; + builds: Array; + displayName: Scalars["String"]["output"]; + id: Scalars["String"]["output"]; +}; + +export type WaterfallOptions = { + limit?: InputMaybe; + projectIdentifier: Scalars["String"]["input"]; + requesters?: InputMaybe>; +}; + +export type WaterfallTask = { + __typename?: "WaterfallTask"; + displayName: Scalars["String"]["output"]; + id: Scalars["String"]["output"]; + status: Scalars["String"]["output"]; +}; + export type Webhook = { __typename?: "Webhook"; endpoint: Scalars["String"]["output"]; diff --git a/apps/spruce/.eslintrc.cjs b/apps/spruce/.eslintrc.cjs index 28038c21c..8bc23b32e 100644 --- a/apps/spruce/.eslintrc.cjs +++ b/apps/spruce/.eslintrc.cjs @@ -7,15 +7,6 @@ const errorIfStrict = process.env.STRICT ? ERROR : WARN; module.exports = { root: true, extends: ["@evg-ui"], - overrides: [ - { - files: ["src/gql/**/*.graphql"], - extends: "plugin:@graphql-eslint/operations-recommended", - rules: { - "@graphql-eslint/selection-set-depth": OFF, - }, - }, - ], plugins: ["check-file"], rules: { "check-file/filename-naming-convention": [ diff --git a/apps/spruce/README.md b/apps/spruce/README.md index faffadaf7..e451d8627 100644 --- a/apps/spruce/README.md +++ b/apps/spruce/README.md @@ -215,11 +215,14 @@ Spruce has a minimal dependency on Logkeeper: it is used by Cypress tests on the Job Logs page. If you'd like to get set up to develop these tests, complete the following: -1. Clone the [Logkeeper repository](https://github.com/evergreen-ci/logkeeper) -2. Run `yarn bootstrap-logkeeper` within Spruce to download some sample resmoke - logs from S3. -3. Run the command output by the previous step to seed the env variables and - start the local logkeeper server at http://localhost:8080. +1. Clone the [Logkeeper Repository](https://github.com/evergreen-ci/logkeeper) +2. Run `yarn bootstrap-s3-logs` to download some sample resmoke logs from s3. +3. Run the command outputted by the previous step to seed the env variables and + start the local logkeeper server with the following command: + + ```bash + LK_CORS_ORIGINS=http:\/\/localhost:\\d+ LK_EVERGREEN_ORIGIN=http://localhost:8080 LK_PARSLEY_ORIGIN=http://localhost:5173 go run main/logkeeper.go --localPath {abs_path_to_spruce}/bin/_bucketdata + ``` ## Deployment diff --git a/apps/spruce/cypress/integration/commit_queue.ts b/apps/spruce/cypress/integration/commit_queue.ts deleted file mode 100644 index 24d51ad3c..000000000 --- a/apps/spruce/cypress/integration/commit_queue.ts +++ /dev/null @@ -1,83 +0,0 @@ -const commitQueue = { - id1: "mongodb-mongo-master", - id2: "mongodb-mongo-test", - id3: "non-existent-item", - id4: "evergreen", -}; -const COMMIT_QUEUE_ROUTE_1 = `/commit-queue/${commitQueue.id1}`; -const COMMIT_QUEUE_ROUTE_2 = `/commit-queue/${commitQueue.id2}`; -const INVALID_COMMIT_QUEUE_ROUTE = `/commit-queue/${commitQueue.id3}`; -const COMMIT_QUEUE_ROUTE_4 = `/commit-queue/${commitQueue.id4}`; - -describe("commit queue page", () => { - describe(COMMIT_QUEUE_ROUTE_1, () => { - beforeEach(() => { - cy.visit(COMMIT_QUEUE_ROUTE_1); - }); - - it("Should render the commit queue page with one card", () => { - cy.dataCy("commit-queue-card").should("have.length", 1); - }); - - it("Clicking on 'Total code changes' should show the code changes table", () => { - cy.dataCy("code-changes-table").should("not.be.visible"); - cy.dataCy("accordion-toggle").click(); - cy.dataCy("code-changes-table").should("be.visible"); - }); - - it("Should be able to remove a patch from the commit queue", () => { - cy.dataCy("commit-queue-card").should("exist"); - cy.dataCy("commit-queue-patch-button").should("exist"); - cy.dataCy("commit-queue-patch-button").click(); - cy.dataCy("commit-queue-confirmation-modal").should("be.visible"); - cy.dataCy("commit-queue-confirmation-modal").within(() => { - cy.contains("button", "Remove").click(); - }); - cy.dataCy("commit-queue-confirmation-modal").should("not.exist"); - cy.dataCy("commit-queue-card").should("not.exist"); - }); - }); - - describe(COMMIT_QUEUE_ROUTE_2, () => { - it("visiting a page with multiple sets of code changes should have multiple tables", () => { - cy.visit(COMMIT_QUEUE_ROUTE_2); - cy.dataCy("accordion-toggle").should("have.length", 4); - }); - }); - - describe(COMMIT_QUEUE_ROUTE_4, () => { - beforeEach(() => { - cy.visit(COMMIT_QUEUE_ROUTE_4); - }); - - it("should display the commit queue message if there is one", () => { - cy.dataCy("commit-queue-message").should("exist"); - cy.dataCy("commit-queue-message").should( - "contain.text", - "This is the commit queue", - ); - }); - - it("should display the commit description above each table", () => { - cy.dataCy("commit-name").each(($el, index) => - cy - .wrap($el) - .contains( - [ - "ramen is amazing", - "some other commit", - "crazy cool commit!!!", - "mega commit", - ][index], - ), - ); - }); - }); - - describe(INVALID_COMMIT_QUEUE_ROUTE, () => { - it("visiting a nonexistent commit queue page should display an error", () => { - cy.visit(INVALID_COMMIT_QUEUE_ROUTE); - cy.validateToast("error", "There was an error loading the commit queue"); - }); - }); -}); diff --git a/apps/spruce/cypress/integration/myPatches/patchCard/dropdown_menu.ts b/apps/spruce/cypress/integration/myPatches/patchCard/dropdown_menu.ts index 8bc95216e..477344181 100644 --- a/apps/spruce/cypress/integration/myPatches/patchCard/dropdown_menu.ts +++ b/apps/spruce/cypress/integration/myPatches/patchCard/dropdown_menu.ts @@ -2,8 +2,6 @@ import { INCLUDE_HIDDEN_PATCHES } from "constants/cookies"; const patchWithoutVersion = "test meee"; const patchWithVersion = "main: EVG-7823 add a commit queue message (#4048)"; -const patchWithVersionOnCommitQueue = - "'evergreen-ci/evergreen' pull request #3186 by bsamek: EVG-7425 Don't send ShouldExit to unprovisioned hosts (https://github.com/evergreen-ci/evergreen/pull/3186)"; const getPatchCardByDescription = (description: string) => cy.dataCy("patch-card").filter(`:contains(${description})`); @@ -40,8 +38,6 @@ describe("Dropdown Menu of Patch Actions", () => { cy.dataCy("schedule-patch").should("be.disabled"); }); - // We shouldn't actually unschedule patchWithVersion because patchWithVersionOnCommitQueue is a downstream project - // and other integration tests will be affected. it("'Unschedule' link opens popconfirm and unschedules patch", () => { getPatchCardByDescription(patchWithVersion).within(() => { cy.dataCy("patch-card-dropdown").click(); @@ -59,16 +55,15 @@ describe("Dropdown Menu of Patch Actions", () => { cy.dataCy("unschedule-patch").should("be.disabled"); }); - // This will generate a 'Will Run' status that is used in version/task_filters.ts it("'Restart' link shows restart patch modal", () => { - getPatchCardByDescription(patchWithVersionOnCommitQueue).within(() => { + getPatchCardByDescription(patchWithVersion).within(() => { cy.dataCy("patch-card-dropdown").click(); }); cy.dataCy("restart-version").click({ force: true }); cy.dataCy("variant-accordion").first().click(); cy.dataCy("task-status-checkbox").should("exist"); - cy.contains("generate-lint").click(); + cy.contains("asdf").click(); cy.dataCy("version-restart-modal").within(() => { cy.contains("Restart").click(); }); @@ -82,20 +77,6 @@ describe("Dropdown Menu of Patch Actions", () => { cy.dataCy("restart-version").should("be.disabled"); }); - it("'Add to commit queue' shows enqueue modal", () => { - getPatchCardByDescription(patchWithVersionOnCommitQueue).within(() => { - cy.dataCy("patch-card-dropdown").click(); - }); - cy.dataCy("enqueue-patch").should("exist"); - }); - - it("'Add to commit queue' is disabled for unfinalized patch", () => { - getPatchCardByDescription(patchWithoutVersion).within(() => { - cy.dataCy("patch-card-dropdown").click(); - }); - cy.dataCy("enqueue-patch").should("be.disabled"); - }); - it("Toggle patch visibility", () => { // "Include hidden" checkbox is not checked and patch is visible cy.getInputByLabel("Include hidden").should("not.be.checked"); diff --git a/apps/spruce/cypress/integration/projectSettings/attaching_to_repo.ts b/apps/spruce/cypress/integration/projectSettings/attaching_to_repo.ts index 9fc9f898b..674ed5f59 100644 --- a/apps/spruce/cypress/integration/projectSettings/attaching_to_repo.ts +++ b/apps/spruce/cypress/integration/projectSettings/attaching_to_repo.ts @@ -8,7 +8,7 @@ describe("Attaching Spruce to a repo", () => { cy.visit(origin); }); - it("Saves and attaches new repo and shows warnings on the Github/Commit Queue page", () => { + it("Saves and attaches new repo and shows warnings on the Github page", () => { cy.dataCy("repo-input").as("repoInput").clear(); cy.get("@repoInput").type("evergreen"); cy.dataCy("attach-repo-button").should( diff --git a/apps/spruce/cypress/integration/projectSettings/defaulting_to_repo.ts b/apps/spruce/cypress/integration/projectSettings/defaulting_to_repo.ts index cd20d82b7..7c356b831 100644 --- a/apps/spruce/cypress/integration/projectSettings/defaulting_to_repo.ts +++ b/apps/spruce/cypress/integration/projectSettings/defaulting_to_repo.ts @@ -134,7 +134,7 @@ describe("Project Settings when defaulting to repo", () => { }); }); - describe("GitHub/Commit Queue page", () => { + describe("GitHub page", () => { beforeEach(() => { cy.dataCy("navitem-github-commitqueue").click(); }); diff --git a/apps/spruce/cypress/integration/projectSettings/not_defaulting_to_repo.ts b/apps/spruce/cypress/integration/projectSettings/not_defaulting_to_repo.ts index 85c979936..a4a8f30f8 100644 --- a/apps/spruce/cypress/integration/projectSettings/not_defaulting_to_repo.ts +++ b/apps/spruce/cypress/integration/projectSettings/not_defaulting_to_repo.ts @@ -128,7 +128,7 @@ describe("Project Settings when not defaulting to repo", () => { }); }); - describe("GitHub/Commit Queue page", () => { + describe("GitHub page", () => { beforeEach(() => { cy.dataCy("navitem-github-commitqueue").click(); }); diff --git a/apps/spruce/cypress/integration/projectSettings/repo_settings.ts b/apps/spruce/cypress/integration/projectSettings/repo_settings.ts index aa552741f..7f27206ef 100644 --- a/apps/spruce/cypress/integration/projectSettings/repo_settings.ts +++ b/apps/spruce/cypress/integration/projectSettings/repo_settings.ts @@ -41,7 +41,7 @@ describe("Repo Settings", () => { }); }); - describe("GitHub/Commit Queue page", () => { + describe("GitHub page", () => { beforeEach(() => { cy.dataCy("navitem-github-commitqueue").click(); saveButtonEnabled(false); @@ -106,14 +106,14 @@ describe("Repo Settings", () => { }); }); - describe("Commit Queue section", () => { + describe("Merge Queue section", () => { beforeEach(() => { cy.dataCy("cq-enabled-radio-box") .contains("label", "Enabled") .as("enableCQButton") .scrollIntoView(); }); - it("Enabling commit queue shows hidden inputs and error banner", () => { + it("Enabling merge queue shows hidden inputs and error banner", () => { cy.dataCy("cq-card") .children() .as("cqCardFields") @@ -121,26 +121,26 @@ describe("Repo Settings", () => { cy.get("@enableCQButton").click(); cy.get("@cqCardFields").should("have.length", 2); - cy.contains("Commit Queue Patch Definitions").scrollIntoView(); + cy.contains("Merge Queue Patch Definitions").scrollIntoView(); cy.dataCy("error-banner") .contains( - "A Commit Queue Patch Definition must be specified for this feature to run.", + "A Merge Queue Patch Definition must be specified for this feature to run.", ) .should("be.visible"); }); - it("Does not show override buttons for commit queue patch definitions", () => { + it("Does not show override buttons for merge queue patch definitions", () => { cy.get("@enableCQButton").click(); cy.dataCy("cq-override-radio-box").should("not.exist"); }); - it("Saves a commit queue definition", () => { + it("Saves a merge queue definition", () => { cy.get("@enableCQButton").click(); cy.contains("button", "Add Patch Definition").click(); cy.dataCy("variant-tags-input").first().type("vtag"); cy.dataCy("task-tags-input").first().type("ttag"); saveButtonEnabled(false); - cy.contains("button", "Add Commit Queue Patch Definition").click(); + cy.contains("button", "Add merge queue patch definition").click(); cy.dataCy("variant-tags-input").last().type("cqvtag"); cy.dataCy("task-tags-input").last().type("cqttag"); cy.dataCy("warning-banner").should("not.exist"); @@ -193,7 +193,7 @@ describe("Repo Settings", () => { cy.dataCy("expandable-card").find("button").should("be.disabled"); }); - it("Saving a Patch Trigger Alias shows a success toast and updates the Github/Commit Queue page", () => { + it("Saving a Patch Trigger Alias shows a success toast and updates the Github page", () => { cy.dataCy("add-button") .contains("Add Patch Trigger Alias") .parent() @@ -228,7 +228,7 @@ describe("Repo Settings", () => { "false", ); saveButtonEnabled(false); - // Verify information on Github/Commit Queue page + // Verify information on Github page cy.dataCy("navitem-github-commitqueue").click(); cy.contains("GitHub Trigger Aliases").scrollIntoView(); cy.dataCy("pta-item").should("have.length", 1); diff --git a/apps/spruce/cypress/integration/spawn/host.ts b/apps/spruce/cypress/integration/spawn/host.ts index ff89bddf8..e4cc8b333 100644 --- a/apps/spruce/cypress/integration/spawn/host.ts +++ b/apps/spruce/cypress/integration/spawn/host.ts @@ -242,7 +242,25 @@ describe("Navigating to Spawn Host page", () => { cy.dataCy("edit-spawn-host-modal").should("be.visible"); cy.getInputByLabel("Temporary Sleep Schedule Exemption").click(); - cy.get("td[aria-current=true]").next().click(); + cy.get("td[aria-current=true]").as("currentDateCell"); + // Select a date in the future either this month or next month + // if the current date is the last day of the month select the first day of the next month + // if it is not select the next day + // We can determine if the current date is the last day of the month if the next cell is disabled + cy.get("@currentDateCell") + .next() + .then(($el) => { + if (!$el || $el.attr("aria-disabled") === "false") { + cy.get("@currentDateCell").next().click(); + } else { + cy.log("Current date is the last day of the month"); + cy.get('button[aria-label="Next month"]').click(); + cy.get('td[data-testid="lg-date_picker-calendar_cell"]') + .first() + .click(); + } + }); + cy.contains("button", "Save").should("have.attr", "aria-disabled", "false"); // LG Date Picker does not respond well to .clear() diff --git a/apps/spruce/cypress/integration/version/action_buttons.ts b/apps/spruce/cypress/integration/version/action_buttons.ts index 2a2e60325..35938a266 100644 --- a/apps/spruce/cypress/integration/version/action_buttons.ts +++ b/apps/spruce/cypress/integration/version/action_buttons.ts @@ -87,9 +87,6 @@ describe("Action Buttons", () => { "true", ); }); - it("Should not be able to enqueue the version", () => { - cy.dataCy("enqueue-patch").should("be.disabled"); - }); }); }); }); diff --git a/apps/spruce/cypress/integration/version/routes.ts b/apps/spruce/cypress/integration/version/routes.ts index 2b7aec448..bf738c9cb 100644 --- a/apps/spruce/cypress/integration/version/routes.ts +++ b/apps/spruce/cypress/integration/version/routes.ts @@ -3,33 +3,13 @@ const versions = { 1: "i-dont-exist", // non existent patch 2: "52a630633ff1227909000021", // patch 2 3: "5e6bb9e23066155a993e0f1a", // unconfigured patch - 4: "642de18d2a60edf48b34a8c7", // unactivated patch on commit queue - 5: "evergreen_33016573166a36bd5f46b4111151899d5c4e95b1", // basecommit for versions[0] - 6: "5e4ff3abe3c3317e352062e4", + 4: "evergreen_33016573166a36bd5f46b4111151899d5c4e95b1", // basecommit for versions[0] + 5: "5e4ff3abe3c3317e352062e4", }; const versionRoute = (id: string) => `/version/${id}`; describe("Version route", () => { - describe("Redirects", () => { - it("Redirects to configure patch page if patch is not activated", () => { - cy.visit(versionRoute(versions[3])); - cy.location().should((loc) => { - expect(loc.pathname).to.equal(`/patch/${versions[3]}/configure/tasks`); - }); - }); - it("Redirects to the commit queue page if a patch is on the commit queue and has not been activated", () => { - cy.visit(versionRoute(versions[4])); - cy.location().should((loc) => { - expect(loc.pathname).to.equal(`/commit-queue/mongodb-mongo-master`); - }); - }); - it("Throws a 404 if the version and patch doesn't exist", () => { - cy.visit(versionRoute(versions[1])); - cy.validateToast("error", "Unable to find patch or version i-dont-exist"); - }); - }); - describe("Metadata", () => { it("Shows patch parameters if they exist", () => { cy.visit(versionRoute(versions[0])); @@ -43,7 +23,7 @@ describe("Version route", () => { cy.visit(versionRoute(versions[0])); cy.dataCy("patch-base-commit") .should("have.attr", "href") - .and("include", `/version/${versions[5]}`); + .and("include", `/version/${versions[4]}`); }); it("Doesn't show patch parameters if they don't exist", () => { cy.visit(versionRoute(versions[2])); @@ -69,13 +49,11 @@ describe("Version route", () => { describe("Grouped Task Status Badge", () => { it("Shows tooltip with task's name on hover", () => { cy.dataCy("build-variants").within(() => { - cy.dataCy("grouped-task-status-badge") - .first() - .trigger("mouseover") - .within(($el) => { - // @ts-expect-error - expect($el.text()).to.contain("1Succeeded"); - }); + cy.dataCy("grouped-task-status-badge").first().as("statusBadge"); + cy.get("@statusBadge").trigger("mouseover"); + cy.get("@statusBadge").within(($el) => { + expect($el.text()).to.contain("1Succeeded"); + }); }); }); @@ -181,7 +159,7 @@ describe("Version route", () => { describe("Page title", () => { beforeEach(() => { - cy.visit(versionRoute(versions[6])); + cy.visit(versionRoute(versions[5])); }); it("Should include a link to Jira", () => { cy.dataCy("page-title") diff --git a/apps/spruce/cypress/integration/version/unscheduled_patch/configure_patch.ts b/apps/spruce/cypress/integration/version/unscheduled_patch/configure_patch.ts index a74282c3c..c3ac745cf 100644 --- a/apps/spruce/cypress/integration/version/unscheduled_patch/configure_patch.ts +++ b/apps/spruce/cypress/integration/version/unscheduled_patch/configure_patch.ts @@ -6,20 +6,8 @@ describe("Configure Patch Page", () => { const patchWithDisplayTasks = "5e6bb9e23066155a993e0f1b"; describe("Initial state reflects patch data", () => { - it("Should Redirect to configure page for unconfigured patches", () => { - cy.visit(`/version/${unactivatedPatchId}`); - cy.location().should((loc) => - expect(loc.pathname).to.eq( - `/patch/${unactivatedPatchId}/configure/tasks`, - ), - ); - }); - it("Patch name input field value is patch description", () => { - cy.visit(`/version/${unactivatedPatchId}`); - cy.dataCy("patch-name-input").should("have.value", "test meee"); - }); it("First build variant in list is selected by default", () => { - cy.visit(`/version/${unactivatedPatchId}`); + cy.visit(`/patch/${unactivatedPatchId}/configure/tasks`); cy.dataCy("build-variant-list-item") .first() .should("have.attr", "data-selected", "true"); @@ -33,6 +21,7 @@ describe("Configure Patch Page", () => { expect(loc.pathname).to.eq(`/version/5ecedafb562343215a7ff297/tasks`), ); }); + it("should not allow canceling an unconfigured patch", () => { cy.visit(`/patch/${unactivatedPatchId}/configure/tasks`); cy.dataCy("cancel-button").should("not.exist"); @@ -189,7 +178,7 @@ describe("Configure Patch Page", () => { describe("Task filter input", () => { it("Updating the task filter input filters tasks in view", () => { - cy.visit(`/version/${unactivatedPatchId}`); + cy.visit(`/patch/${unactivatedPatchId}/configure/tasks`); cy.contains("Ubuntu 16.04").click(); cy.dataCy("task-checkbox").should("have.length", 45); cy.dataCy("selected-task-disclaimer").contains( @@ -203,7 +192,7 @@ describe("Configure Patch Page", () => { ); }); it("The task filter input works across multiple build variants", () => { - cy.visit(`/version/${unactivatedPatchId}`); + cy.visit(`/patch/${unactivatedPatchId}/configure/tasks`); cy.get("body").type("{meta}", { release: false, }); @@ -489,7 +478,7 @@ describe("Configure Patch Page", () => { describe("Selecting a trigger alias", () => { beforeEach(() => { - cy.visit(`/version/${unactivatedPatchId}`); + cy.visit(`/patch/${unactivatedPatchId}/configure/tasks`); cy.dataCy("trigger-alias-list-item") .contains("logkeeper-alias") .click(); @@ -569,7 +558,7 @@ describe("Configure Patch Page", () => { describe("Scheduling a patch", () => { beforeEach(() => { - cy.visit(`/patch/${unactivatedPatchId}`); + cy.visit(`/patch/${unactivatedPatchId}/configure/tasks`); }); it("Clicking 'Schedule' button schedules patch and redirects to patch page", () => { const val = "hello world"; @@ -603,7 +592,6 @@ const mockedSuccessConfigureResponse = { status: "created", activated: true, alias: "", - commitQueuePosition: null, variantsTasks: [ { name: "ubuntu1604", diff --git a/apps/spruce/package.json b/apps/spruce/package.json index c75e0b16d..c8f207f44 100644 --- a/apps/spruce/package.json +++ b/apps/spruce/package.json @@ -1,10 +1,10 @@ { "name": "spruce", - "version": "4.1.78", + "version": "4.1.80", "private": true, "type": "module", "scripts": { - "bootstrap-logkeeper": "./scripts/bootstrap-logkeeper.sh", + "bootstrap-s3-logs": "../../scripts/bootstrap-s3-logs.sh", "build:beta": "env-cmd -e beta yarn build", "build:local": "env-cmd -e local -r .env-cmdrc.local.json yarn build", "build:prod": "env-cmd -e production yarn build", diff --git a/apps/spruce/scripts/bootstrap-logkeeper.sh b/apps/spruce/scripts/bootstrap-logkeeper.sh deleted file mode 100755 index 0b6f7f7a5..000000000 --- a/apps/spruce/scripts/bootstrap-logkeeper.sh +++ /dev/null @@ -1,53 +0,0 @@ -# Sourced from Parsley -# This file downloads a resmoke log for use with the local logkeeper db - - -RED='\033[0;31m' -NC='\033[0m' # No Color -YELLOW='\033[1;33m' -GREEN='\033[0;32m' - -SPRUCE_DIR=pwd - -# Check to see if we have a _bucketdata directory -if [ ! -d "bin/_bucketdata" ]; then - echo "${RED}No _bucketdata directory found!${NC}" - echo "Creating one now..." - mkdir bin/_bucketdata - # Use aws cli to download the bucket data - echo "Downloading bucket data..." - # Try to download the bucket data - aws s3 sync --content-encoding gzip s3://parsley-test/ ./bin - # Check to see if the download was successful - if [ $? -ne 0 ]; then - echo "${RED}Failed to download bucket data!${NC}" - echo "Please make sure you have the aws cli installed and configured." - echo "See https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html for more information." - echo "Cleaning up _bucketdata directory..." - rm -rf bin/_bucketdata - exit 1 - fi - # Uncompress the files in the _bucketdata directory - echo "Uncompressing bucket data..." - tar -xzf ./bin/_bucketdata.tar.gz -C ./bin/ - # Check to see if the uncompress was successful - if [ $? -ne 0 ]; then - echo "${RED}Failed to uncompress bucket data!${NC}" - echo "Cleaning up _bucketdata directory..." - rm -rf _bucketdata - exit 1 - fi - echo "Finished uncompressing files." - echo "Cleaning up _bucketdata directory..." - rm bin/_bucketdata.tar.gz - echo "Done!" - echo "${GREEN}Bucket data downloaded successfully!${NC}" - -else - echo "Found bin/_bucketdata directory, skipping download..." - echo "If you want to download the bucket data again, delete the _bucketdata directory and rerun this script." -fi - - -echo "Use the following command to start logkeeper:" -echo "${YELLOW}LK_CORS_ORIGINS=http:\/\/localhost:\\\d+ go run main/logkeeper.go --localPath $PWD/bin/_bucketdata${NC}" diff --git a/apps/spruce/src/analytics/navbar/useNavbarAnalytics.ts b/apps/spruce/src/analytics/navbar/useNavbarAnalytics.ts index dc1002f94..ec6d973eb 100644 --- a/apps/spruce/src/analytics/navbar/useNavbarAnalytics.ts +++ b/apps/spruce/src/analytics/navbar/useNavbarAnalytics.ts @@ -15,8 +15,7 @@ type Action = | { name: "Clicked EVG wiki link" } | { name: "Clicked preferences link" } | { name: "Clicked notifications link" } - | { name: "Clicked task queue link" } - | { name: "Clicked commit queue link" }; + | { name: "Clicked task queue link" }; export const useNavbarAnalytics = () => useAnalyticsRoot("Navbar"); diff --git a/apps/spruce/src/analytics/types.ts b/apps/spruce/src/analytics/types.ts index 59b593190..071c73c7c 100644 --- a/apps/spruce/src/analytics/types.ts +++ b/apps/spruce/src/analytics/types.ts @@ -3,7 +3,6 @@ export type AnalyticsIdentifier = | "Annotations" | "April Fools" | "Breadcrumb" - | "CommitQueue" | "Configure" | "DistroSettings" | "HostPage" diff --git a/apps/spruce/src/analytics/version/useVersionAnalytics.ts b/apps/spruce/src/analytics/version/useVersionAnalytics.ts index 8d2fcf494..2cbcc641f 100644 --- a/apps/spruce/src/analytics/version/useVersionAnalytics.ts +++ b/apps/spruce/src/analytics/version/useVersionAnalytics.ts @@ -27,7 +27,6 @@ type Action = | { name: "Clicked metadata project patches link" } | { name: "Clicked task table task link"; "task.id": string } | { name: "Deleted all filters" } - | { name: "Clicked enqueue tasks button" } | { name: "Filtered downstream tasks table"; "filter.by": string | string[] } | { name: "Filtered tasks table"; "filter.by": string | string[] } | { name: "Filtered task duration table"; "filter.by": string | string[] } diff --git a/apps/spruce/src/components/Content/index.tsx b/apps/spruce/src/components/Content/index.tsx index 17ed5932c..9d06fc291 100644 --- a/apps/spruce/src/components/Content/index.tsx +++ b/apps/spruce/src/components/Content/index.tsx @@ -11,7 +11,6 @@ import { showWaterfallPage, } from "constants/featureFlags"; import { redirectRoutes, routes, slugs } from "constants/routes"; -import { CommitQueue } from "pages/CommitQueue"; import { Commits } from "pages/Commits"; import { ConfigurePatch } from "pages/ConfigurePatch"; import { Container } from "pages/Container"; @@ -91,7 +90,6 @@ export const Content: React.FC = () => ( } path={`${routes.spawn}/*`}> - } path={routes.commitQueue} /> } path={routes.task}> diff --git a/apps/spruce/src/components/Header/AuxiliaryDropdown.tsx b/apps/spruce/src/components/Header/AuxiliaryDropdown.tsx index 5b5fc82b4..3f030d4cf 100644 --- a/apps/spruce/src/components/Header/AuxiliaryDropdown.tsx +++ b/apps/spruce/src/components/Header/AuxiliaryDropdown.tsx @@ -5,7 +5,6 @@ import { getProjectPatchesRoute, getProjectSettingsRoute, getTaskQueueRoute, - getCommitQueueRoute, } from "constants/routes"; import { useFirstDistro } from "hooks"; import { NavDropdown } from "./NavDropdown"; @@ -26,11 +25,6 @@ export const AuxiliaryDropdown: React.FC = ({ to: routes.hosts, onClick: () => sendEvent({ name: "Clicked all hosts link" }), }, - { - text: "Commit Queue", - to: getCommitQueueRoute(projectIdentifier), - onClick: () => sendEvent({ name: "Clicked commit queue link" }), - }, { text: "Task Queue", to: getTaskQueueRoute(""), diff --git a/apps/spruce/src/components/PatchActionButtons/EnqueuePatch.tsx b/apps/spruce/src/components/PatchActionButtons/EnqueuePatch.tsx deleted file mode 100644 index f08d96487..000000000 --- a/apps/spruce/src/components/PatchActionButtons/EnqueuePatch.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import { useState } from "react"; -import { DropdownItem } from "components/ButtonDropdown"; -import { EnqueuePatchModal } from "pages/version/index"; - -interface EnqueuePatchProps { - patchId: string; - commitMessage: string; - disabled: boolean; - refetchQueries?: string[]; - visibilityControl?: [boolean, React.Dispatch>]; -} - -export const EnqueuePatch: React.FC = ({ - commitMessage, - disabled, - patchId, - refetchQueries = [], - visibilityControl, -}) => { - const fallbackVisibilityControl = useState(false); - const [isVisible, setIsVisible] = - visibilityControl !== undefined - ? visibilityControl - : fallbackVisibilityControl; - - return ( - <> - setIsVisible(!isVisible)} - > - Add to commit queue - - setIsVisible(false)} - patchId={patchId} - refetchQueries={refetchQueries} - visible={isVisible} - /> - - ); -}; diff --git a/apps/spruce/src/components/PatchActionButtons/index.tsx b/apps/spruce/src/components/PatchActionButtons/index.tsx index 19b778550..f638fd183 100644 --- a/apps/spruce/src/components/PatchActionButtons/index.tsx +++ b/apps/spruce/src/components/PatchActionButtons/index.tsx @@ -1,6 +1,5 @@ export { UnscheduleTasks } from "./UnscheduleTasks"; export { RestartPatch } from "./RestartPatch"; -export { EnqueuePatch } from "./EnqueuePatch"; export { AddNotification } from "./AddNotification"; export { DisableTasks } from "./DisableTasks"; export { ScheduleTasks } from "./ScheduleTasks"; diff --git a/apps/spruce/src/components/PatchesPage/ListArea/PatchCard/DropdownMenu.tsx b/apps/spruce/src/components/PatchesPage/ListArea/PatchCard/DropdownMenu.tsx index 8dcd2912c..a798dc674 100644 --- a/apps/spruce/src/components/PatchesPage/ListArea/PatchCard/DropdownMenu.tsx +++ b/apps/spruce/src/components/PatchesPage/ListArea/PatchCard/DropdownMenu.tsx @@ -4,33 +4,24 @@ import { LinkToReconfigurePage } from "components/LinkToReconfigurePage"; import { UnscheduleTasks, RestartPatch, - EnqueuePatch, ScheduleTasks, SetPatchVisibility, } from "components/PatchActionButtons"; interface Props { - canEnqueueToCommitQueue: boolean; hasVersion: boolean; isPatchHidden: boolean; - isPatchOnCommitQueue: boolean; - patchDescription: string; patchId: string; } export const DropdownMenu: React.FC = ({ - canEnqueueToCommitQueue, hasVersion, isPatchHidden, - isPatchOnCommitQueue, - patchDescription, patchId, }) => { const restartModalVisibilityControl = useState(false); - const enqueueModalVisibilityControl = useState(false); const dropdownItems = [ , @@ -48,14 +39,6 @@ export const DropdownMenu: React.FC = ({ refetchQueries={refetchQueries} visibilityControl={restartModalVisibilityControl} />, - , = { argTypes: {}, args: { pageType: "project", - isPatchOnCommitQueue: false, patch: patchData, }, }; @@ -23,7 +22,6 @@ export const UserPatchCard: CustomStoryObj = { argTypes: {}, args: { pageType: "user", - isPatchOnCommitQueue: false, patch: patchData, }, }; diff --git a/apps/spruce/src/components/PatchesPage/ListArea/PatchCard/index.tsx b/apps/spruce/src/components/PatchesPage/ListArea/PatchCard/index.tsx index 0deef830a..76e4c0ad4 100644 --- a/apps/spruce/src/components/PatchesPage/ListArea/PatchCard/index.tsx +++ b/apps/spruce/src/components/PatchesPage/ListArea/PatchCard/index.tsx @@ -11,13 +11,13 @@ import { getProjectPatchesRoute, getVersionRoute, getUserPatchesRoute, + getPatchRoute, } from "constants/routes"; import { mapUmbrellaStatusToQueryParam } from "constants/task"; import { fontSize, size } from "constants/tokens"; import { PatchesPagePatchesFragment } from "gql/generated/types"; import { useDateFormat } from "hooks"; import { PatchStatus } from "types/patch"; -import { isPatchUnconfigured } from "utils/patch"; import { groupStatusesByUmbrellaStatus } from "utils/statuses"; import { DropdownMenu } from "./DropdownMenu"; @@ -26,15 +26,10 @@ const { gray } = palette; interface PatchCardProps { pageType: "project" | "user"; - isPatchOnCommitQueue: boolean; patch: PatchType; } -const PatchCard: React.FC = ({ - isPatchOnCommitQueue, - pageType, - patch, -}) => { +const PatchCard: React.FC = ({ pageType, patch }) => { const getDateCopy = useDateFormat(); const userPatchesAnalytics = useUserPatchesAnalytics(); const projectPatchesAnalytics = useProjectPatchesAnalytics(); @@ -42,10 +37,8 @@ const PatchCard: React.FC = ({ pageType === "project" ? projectPatchesAnalytics : userPatchesAnalytics; const { activated, - alias, author, authorDisplayName, - canEnqueueToCommitQueue, createTime, description, hidden, @@ -61,8 +54,7 @@ const PatchCard: React.FC = ({ const { stats } = groupStatusesByUmbrellaStatus( taskStatusStats?.counts ?? [], ); - // @ts-expect-error: FIXME. This comment was added by an automated script. - const isUnconfigured = isPatchUnconfigured({ alias, activated }); + let patchProject = null; if (pageType === "project") { patchProject = unlinkedPRUsers.has(author) ? ( @@ -106,7 +98,11 @@ const PatchCard: React.FC = ({ analytics.sendEvent({ name: "Clicked patch link" })} - to={getVersionRoute(id)} + to={ + activated + ? getVersionRoute(id) + : getPatchRoute(id, { configure: true }) + } > {description || "no description"} @@ -119,9 +115,9 @@ const PatchCard: React.FC = ({ @@ -130,11 +126,8 @@ const PatchCard: React.FC = ({ {hidden && Hidden} diff --git a/apps/spruce/src/components/PatchesPage/ListArea/index.tsx b/apps/spruce/src/components/PatchesPage/ListArea/index.tsx index c839236c0..d25efd769 100644 --- a/apps/spruce/src/components/PatchesPage/ListArea/index.tsx +++ b/apps/spruce/src/components/PatchesPage/ListArea/index.tsx @@ -17,12 +17,7 @@ const ListArea: React.FC = ({ loading, pageType, patches }) => { return ( <> {patches.map((p) => ( - + ))} ); diff --git a/apps/spruce/src/components/PatchesPage/ListArea/testData.ts b/apps/spruce/src/components/PatchesPage/ListArea/testData.ts index e44d8cd69..cd780d120 100644 --- a/apps/spruce/src/components/PatchesPage/ListArea/testData.ts +++ b/apps/spruce/src/components/PatchesPage/ListArea/testData.ts @@ -3,8 +3,6 @@ const patchData = { alias: "__github", author: "mohamed.khelif", authorDisplayName: "Mohamed Khelif", - canEnqueueToCommitQueue: false, - commitQueuePosition: null, createTime: new Date("2024-06-25T20:58:39.862Z"), description: "'evergreen-ci/ui' pull request #206 by khelif96: DEVPROD-8367 Update analytics event names for annotation actions (https://github.com/evergreen-ci/ui/pull/206)", diff --git a/apps/spruce/src/components/Redirects/PatchRedirect.tsx b/apps/spruce/src/components/Redirects/PatchRedirect.tsx index e3369b690..8a83b9817 100644 --- a/apps/spruce/src/components/Redirects/PatchRedirect.tsx +++ b/apps/spruce/src/components/Redirects/PatchRedirect.tsx @@ -1,7 +1,31 @@ +import { useQuery } from "@apollo/client"; import { useParams, Navigate } from "react-router-dom"; -import { getVersionRoute, slugs } from "constants/routes"; +import { PatchAndTaskFullPageLoad } from "components/Loading/PatchAndTaskFullPageLoad"; +import { getPatchRoute, getVersionRoute, slugs } from "constants/routes"; +import { HasVersionQuery, HasVersionQueryVariables } from "gql/generated/types"; +import { HAS_VERSION } from "gql/queries"; export const PatchRedirect: React.FC = () => { const { [slugs.versionId]: versionId } = useParams(); - return ; + + const { data, loading } = useQuery( + HAS_VERSION, + { + skip: !versionId, + variables: { id: versionId ?? "" }, + }, + ); + + if (loading) { + return ; + } + + return data?.hasVersion ? ( + + ) : ( + + ); }; diff --git a/apps/spruce/src/components/TasksTable/Columns.tsx b/apps/spruce/src/components/TasksTable/Columns.tsx index c933488ff..703646197 100644 --- a/apps/spruce/src/components/TasksTable/Columns.tsx +++ b/apps/spruce/src/components/TasksTable/Columns.tsx @@ -2,12 +2,10 @@ import { LGColumnDef } from "@leafygreen-ui/table"; import Tooltip from "@leafygreen-ui/tooltip"; import pluralize from "pluralize"; import { TaskStatus } from "@evg-ui/lib/types/task"; -import { ConditionalWrapper } from "components/ConditionalWrapper"; import { StyledRouterLink } from "components/styles"; import TaskStatusBadge from "components/TaskStatusBadge"; import { TreeDataEntry } from "components/TreeSelect"; import { getVariantHistoryRoute } from "constants/routes"; -import { mergeTaskVariant } from "constants/task"; import { zIndex } from "constants/tokens"; import { TaskSortCategory } from "gql/generated/types"; import { TaskLink } from "./TaskLink"; @@ -130,19 +128,12 @@ export const getColumnsTemplate = ({ original: { buildVariant, projectIdentifier }, }, }) => ( - ( - - {children} - - )} + {getValue() as string} - + ), meta: { search: { diff --git a/apps/spruce/src/components/TasksTable/index.tsx b/apps/spruce/src/components/TasksTable/index.tsx index c9a940f4f..04db6c96f 100644 --- a/apps/spruce/src/components/TasksTable/index.tsx +++ b/apps/spruce/src/components/TasksTable/index.tsx @@ -4,7 +4,6 @@ import { ColumnProps } from "antd/es/table"; import { SortOrder as antSortOrder } from "antd/lib/table/interface"; import pluralize from "pluralize"; import { TaskStatus } from "@evg-ui/lib/types/task"; -import { ConditionalWrapper } from "components/ConditionalWrapper"; import { StyledRouterLink } from "components/styles"; import { InputFilterProps, @@ -14,7 +13,6 @@ import { import TaskStatusBadge from "components/TaskStatusBadge"; import { TreeSelectProps } from "components/TreeSelect"; import { getVariantHistoryRoute } from "constants/routes"; -import { mergeTaskVariant } from "constants/task"; import { zIndex } from "constants/tokens"; import { Task, @@ -247,19 +245,12 @@ const getColumnDefs = ({ "data-cy": "variant-input", })), render: (displayName, { buildVariant, projectIdentifier }) => ( - ( - - {children} - - )} + {displayName} - + ), }, ]; diff --git a/apps/spruce/src/constants/externalResources.ts b/apps/spruce/src/constants/externalResources.ts index f45c22d45..a66b07d1b 100644 --- a/apps/spruce/src/constants/externalResources.ts +++ b/apps/spruce/src/constants/externalResources.ts @@ -29,7 +29,7 @@ export const patchAliasesDocumentationUrl = `${projectDistroSettingsDocumentatio export const pullRequestAliasesDocumentationUrl = `${projectDistroSettingsDocumentationUrl}#pr-aliases`; -export const commitQueueAliasesDocumentationUrl = `${projectDistroSettingsDocumentationUrl}#commit-queue-aliases`; +export const mergeQueueAliasesDocumentationUrl = `${projectDistroSettingsDocumentationUrl}#merge-queue-aliases`; export const gitTagAliasesDocumentationUrl = `${projectDistroSettingsDocumentationUrl}#git-tag-aliases`; diff --git a/apps/spruce/src/constants/fieldMaps.ts b/apps/spruce/src/constants/fieldMaps.ts index 6f6cac8b8..99b8cb2d3 100644 --- a/apps/spruce/src/constants/fieldMaps.ts +++ b/apps/spruce/src/constants/fieldMaps.ts @@ -208,7 +208,6 @@ export const notificationFields = { spawnHostOutcome: "Spawn host outcome", spawnHostExpiration: "Spawn host expiration", buildBreak: "Build break", - commitQueue: "Commit queue", }; export const days = [ diff --git a/apps/spruce/src/constants/patch.ts b/apps/spruce/src/constants/patch.ts index 2f5097859..0361aaefc 100644 --- a/apps/spruce/src/constants/patch.ts +++ b/apps/spruce/src/constants/patch.ts @@ -1,3 +1,3 @@ -export const commitQueueAlias = "__commit_queue"; +export const mergeQueueAlias = "__commit_queue"; export const githubMergeQueueUser = "github_merge_queue"; export const unlinkedPRUsers = new Set(["github_pull_request", "parent_patch"]); diff --git a/apps/spruce/src/constants/requesters.ts b/apps/spruce/src/constants/requesters.ts index cfafed6d3..c0369f6cc 100644 --- a/apps/spruce/src/constants/requesters.ts +++ b/apps/spruce/src/constants/requesters.ts @@ -1,8 +1,5 @@ import { PartialRecord } from "@evg-ui/lib/types/utils"; -// Not included in Requester enum because it will be deprecated. -const commitQueueRequester = "merge_test"; - enum Requester { AdHoc = "ad_hoc", GitHubMergeQueue = "github_merge_request", @@ -30,9 +27,4 @@ const requesterToDescription: PartialRecord = { [Requester.Trigger]: "Downstream trigger versions", }; -export { - Requester, - commitQueueRequester, - requesterToTitle, - requesterToDescription, -}; +export { Requester, requesterToTitle, requesterToDescription }; diff --git a/apps/spruce/src/constants/routes.test.ts b/apps/spruce/src/constants/routes.test.ts index 47966fd3a..1d205bb0e 100644 --- a/apps/spruce/src/constants/routes.test.ts +++ b/apps/spruce/src/constants/routes.test.ts @@ -8,7 +8,6 @@ import { getTaskHistoryRoute, getVariantHistoryRoute, getProjectPatchesRoute, - getCommitQueueRoute, getCommitsRoute, } from "./routes"; @@ -25,14 +24,6 @@ describe("getProjectPatchesRoute", () => { }); }); -describe("getCommitQueueRoute", () => { - it("escapes special characters projectIdentifier", () => { - expect(getCommitQueueRoute(identifierWithSpecialCharacters)).toBe( - `/commit-queue/${escapedIdentifier}`, - ); - }); -}); - describe("getCommitsRoute", () => { it("escapes special characters projectIdentifier", () => { expect(getCommitsRoute(identifierWithSpecialCharacters)).toBe( diff --git a/apps/spruce/src/constants/routes.ts b/apps/spruce/src/constants/routes.ts index 7d93a32d7..882abea2b 100644 --- a/apps/spruce/src/constants/routes.ts +++ b/apps/spruce/src/constants/routes.ts @@ -57,7 +57,6 @@ export enum DistroSettingsTabRoutes { } const paths = { - commitQueue: "/commit-queue", commits: "/commits", container: "/container", distro: "/distro", @@ -120,7 +119,6 @@ export const redirectRoutes = { }; export const routes = { - commitQueue: `${paths.commitQueue}/:${slugs.projectIdentifier}`, commits: paths.commits, configurePatch: `${paths.patch}/:${slugs.patchId}/configure`, container: `${paths.container}/:${slugs.podId}`, @@ -293,9 +291,6 @@ export const getDistroSettingsRoute = ( ? `${paths.distro}/${distroId}/${PageNames.Settings}/${tab}` : `${paths.distro}/${distroId}/${PageNames.Settings}/${DistroSettingsTabRoutes.General}`; -export const getCommitQueueRoute = (projectIdentifier: string) => - `${paths.commitQueue}/${encodeURIComponent(projectIdentifier)}`; - export const getCommitsRoute = (projectIdentifier: string = "") => `${paths.commits}/${encodeURIComponent(projectIdentifier)}`; diff --git a/apps/spruce/src/constants/task.ts b/apps/spruce/src/constants/task.ts index 3e8eba8d8..8a59698c3 100644 --- a/apps/spruce/src/constants/task.ts +++ b/apps/spruce/src/constants/task.ts @@ -279,7 +279,3 @@ export const finishedTaskStatuses = [ ...failedTaskStatuses, TaskStatus.Succeeded, ]; - -// Task name and build variant for the commit queue. Both are owned by Evergreen. -export const mergeTaskName = "merge-patch"; -export const mergeTaskVariant = "commit-queue-merge"; diff --git a/apps/spruce/src/constants/triggers.ts b/apps/spruce/src/constants/triggers.ts index 15c4083e2..e39334f99 100644 --- a/apps/spruce/src/constants/triggers.ts +++ b/apps/spruce/src/constants/triggers.ts @@ -57,7 +57,6 @@ export const requesterSubscriberOptions = { gitter_request: "Commit", patch_request: "Patch", github_pull_request: "Pull Request", - merge_test: "Commit Queue", ad_hoc: "Periodic Build", }; @@ -475,7 +474,6 @@ export const allowedSelectors = new Set([ export const resourceTypeToCopy = { [ResourceType.Build]: "Build", - [ResourceType.CommitQueue]: "Commit Queue", [ResourceType.Host]: "Host", [ResourceType.Patch]: "Patch", [ResourceType.Task]: "Task", diff --git a/apps/spruce/src/gql/fragments/basePatch.graphql b/apps/spruce/src/gql/fragments/basePatch.graphql index b903d107a..3600e2ea2 100644 --- a/apps/spruce/src/gql/fragments/basePatch.graphql +++ b/apps/spruce/src/gql/fragments/basePatch.graphql @@ -2,7 +2,6 @@ fragment BasePatch on Patch { activated alias author - commitQueuePosition description id parameters { diff --git a/apps/spruce/src/gql/fragments/patchesPage.graphql b/apps/spruce/src/gql/fragments/patchesPage.graphql index 7d72303bc..59a1f8fff 100644 --- a/apps/spruce/src/gql/fragments/patchesPage.graphql +++ b/apps/spruce/src/gql/fragments/patchesPage.graphql @@ -5,8 +5,6 @@ fragment PatchesPagePatches on Patches { alias author authorDisplayName - canEnqueueToCommitQueue - commitQueuePosition createTime description hidden diff --git a/apps/spruce/src/gql/generated/types.ts b/apps/spruce/src/gql/generated/types.ts index b66e2b73a..03918e2ce 100644 --- a/apps/spruce/src/gql/generated/types.ts +++ b/apps/spruce/src/gql/generated/types.ts @@ -633,6 +633,14 @@ export type GeneralSubscription = { triggerData?: Maybe; }; +export type GeneratedTaskCountResults = { + __typename?: "GeneratedTaskCountResults"; + buildVariantName?: Maybe; + estimatedTasks: Scalars["Int"]["output"]; + taskId?: Maybe; + taskName?: Maybe; +}; + export type GitHubDynamicTokenPermissionGroup = { __typename?: "GitHubDynamicTokenPermissionGroup"; name: Scalars["String"]["output"]; @@ -748,6 +756,8 @@ export type Host = { distro?: Maybe; distroId?: Maybe; elapsed?: Maybe; + /** events returns the event log entries for a given host. */ + events: HostEvents; expiration?: Maybe; homeVolume?: Maybe; homeVolumeID?: Maybe; @@ -770,6 +780,13 @@ export type Host = { volumes: Array; }; +/** Host models a host, which are used for things like running tasks or as virtual workstations. */ +export type HostEventsArgs = { + limit?: InputMaybe; + page?: InputMaybe; + sortDir?: InputMaybe; +}; + export type HostAllocatorSettings = { __typename?: "HostAllocatorSettings"; acceptableHostIdleTime: Scalars["Duration"]["output"]; @@ -1616,7 +1633,7 @@ export type Patch = { createTime?: Maybe; description: Scalars["String"]["output"]; duration?: Maybe; - generatedTaskCounts: Scalars["Map"]["output"]; + generatedTaskCounts: Array; githash: Scalars["String"]["output"]; hidden: Scalars["Boolean"]["output"]; id: Scalars["ID"]["output"]; @@ -1879,7 +1896,6 @@ export type Project = { perfEnabled?: Maybe; periodicBuilds?: Maybe>; prTestingEnabled?: Maybe; - private?: Maybe; projectHealthView: ProjectHealthView; remotePath: Scalars["String"]["output"]; repo: Scalars["String"]["output"]; @@ -2018,7 +2034,6 @@ export type ProjectInput = { perfEnabled?: InputMaybe; periodicBuilds?: InputMaybe>; prTestingEnabled?: InputMaybe; - private?: InputMaybe; projectHealthView?: InputMaybe; remotePath?: InputMaybe; repo?: InputMaybe; @@ -2150,6 +2165,7 @@ export type Query = { githubProjectConflicts: GithubProjectConflicts; hasVersion: Scalars["Boolean"]["output"]; host?: Maybe; + /** @deprecated Use host.events instead. */ hostEvents: HostEvents; hosts: HostsResponse; image?: Maybe; @@ -2180,6 +2196,7 @@ export type Query = { userSettings?: Maybe; version: Version; viewableProjectRefs: Array; + waterfall?: Maybe; }; export type QueryBbGetCreatedTicketsArgs = { @@ -2320,6 +2337,10 @@ export type QueryVersionArgs = { versionId: Scalars["String"]["input"]; }; +export type QueryWaterfallArgs = { + options: WaterfallOptions; +}; + export type RemoveFavoriteProjectInput = { projectIdentifier: Scalars["String"]["input"]; }; @@ -2366,7 +2387,6 @@ export type RepoRef = { perfEnabled: Scalars["Boolean"]["output"]; periodicBuilds?: Maybe>; prTestingEnabled: Scalars["Boolean"]["output"]; - private: Scalars["Boolean"]["output"]; remotePath: Scalars["String"]["output"]; repo: Scalars["String"]["output"]; repotrackerDisabled: Scalars["Boolean"]["output"]; @@ -2410,7 +2430,6 @@ export type RepoRefInput = { perfEnabled?: InputMaybe; periodicBuilds?: InputMaybe>; prTestingEnabled?: InputMaybe; - private?: InputMaybe; remotePath?: InputMaybe; repo?: InputMaybe; repotrackerDisabled?: InputMaybe; @@ -2553,7 +2572,6 @@ export type SleepSchedule = { __typename?: "SleepSchedule"; dailyStartTime: Scalars["String"]["output"]; dailyStopTime: Scalars["String"]["output"]; - isBetaTester?: Maybe; nextStartTime?: Maybe; nextStopTime?: Maybe; permanentlyExempt: Scalars["Boolean"]["output"]; @@ -2566,7 +2584,6 @@ export type SleepSchedule = { export type SleepScheduleInput = { dailyStartTime: Scalars["String"]["input"]; dailyStopTime: Scalars["String"]["input"]; - isBetaTester?: InputMaybe; permanentlyExempt: Scalars["Boolean"]["input"]; shouldKeepOff: Scalars["Boolean"]["input"]; temporarilyExemptUntil?: InputMaybe; @@ -3278,7 +3295,7 @@ export type Version = { errors: Array; externalLinksForMetadata: Array; finishTime?: Maybe; - generatedTaskCounts: Scalars["Map"]["output"]; + generatedTaskCounts: Array; gitTags?: Maybe>; id: Scalars["String"]["output"]; ignored: Scalars["Boolean"]["output"]; @@ -3374,6 +3391,41 @@ export type VolumeHost = { volumeId: Scalars["String"]["input"]; }; +export type Waterfall = { + __typename?: "Waterfall"; + buildVariants: Array; + versions: Array; +}; + +export type WaterfallBuild = { + __typename?: "WaterfallBuild"; + activated?: Maybe; + displayName: Scalars["String"]["output"]; + id: Scalars["String"]["output"]; + tasks: Array; + version: Scalars["String"]["output"]; +}; + +export type WaterfallBuildVariant = { + __typename?: "WaterfallBuildVariant"; + builds: Array; + displayName: Scalars["String"]["output"]; + id: Scalars["String"]["output"]; +}; + +export type WaterfallOptions = { + limit?: InputMaybe; + projectIdentifier: Scalars["String"]["input"]; + requesters?: InputMaybe>; +}; + +export type WaterfallTask = { + __typename?: "WaterfallTask"; + displayName: Scalars["String"]["output"]; + id: Scalars["String"]["output"]; + status: Scalars["String"]["output"]; +}; + export type Webhook = { __typename?: "Webhook"; endpoint: Scalars["String"]["output"]; @@ -3553,7 +3605,6 @@ export type BasePatchFragment = { activated: boolean; alias?: string | null; author: string; - commitQueuePosition?: number | null; description: string; id: string; status: string; @@ -3660,8 +3711,6 @@ export type PatchesPagePatchesFragment = { alias?: string | null; author: string; authorDisplayName: string; - canEnqueueToCommitQueue: boolean; - commitQueuePosition?: number | null; createTime?: Date | null; description: string; hidden: boolean; @@ -5088,16 +5137,6 @@ export type EditSpawnHostMutation = { }; }; -export type EnqueuePatchMutationVariables = Exact<{ - patchId: Scalars["String"]["input"]; - commitMessage?: InputMaybe; -}>; - -export type EnqueuePatchMutation = { - __typename?: "Mutation"; - enqueuePatch: { __typename?: "Patch"; id: string }; -}; - export type BuildBaronCreateTicketMutationVariables = Exact<{ taskId: Scalars["String"]["input"]; execution?: InputMaybe; @@ -5192,16 +5231,6 @@ export type RemoveFavoriteProjectMutation = { }; }; -export type RemoveItemFromCommitQueueMutationVariables = Exact<{ - commitQueueId: Scalars["String"]["input"]; - issue: Scalars["String"]["input"]; -}>; - -export type RemoveItemFromCommitQueueMutation = { - __typename?: "Mutation"; - removeItemFromCommitQueue?: string | null; -}; - export type RemovePublicKeyMutationVariables = Exact<{ keyName: Scalars["String"]["input"]; }>; @@ -5356,7 +5385,6 @@ export type SchedulePatchMutation = { activated: boolean; alias?: string | null; author: string; - commitQueuePosition?: number | null; description: string; id: string; status: string; @@ -5515,7 +5543,6 @@ export type UpdatePatchDescriptionMutation = { activated: boolean; alias?: string | null; author: string; - commitQueuePosition?: number | null; description: string; id: string; status: string; @@ -5822,48 +5849,6 @@ export type CodeChangesQuery = { }; }; -export type CommitQueueQueryVariables = Exact<{ - projectIdentifier: Scalars["String"]["input"]; -}>; - -export type CommitQueueQuery = { - __typename?: "Query"; - commitQueue: { - __typename?: "CommitQueue"; - message?: string | null; - owner?: string | null; - projectId?: string | null; - repo?: string | null; - queue?: Array<{ - __typename?: "CommitQueueItem"; - enqueueTime?: Date | null; - issue?: string | null; - patch?: { - __typename?: "Patch"; - activated: boolean; - author: string; - description: string; - id: string; - moduleCodeChanges: Array<{ - __typename?: "ModuleCodeChange"; - branchName: string; - htmlLink: string; - rawLink: string; - fileDiffs: Array<{ - __typename?: "FileDiff"; - additions: number; - deletions: number; - description: string; - diffLink: string; - fileName: string; - }>; - }>; - versionFull?: { __typename?: "Version"; id: string } | null; - } | null; - }> | null; - }; -}; - export type CreatedTicketsQueryVariables = Exact<{ taskId: Scalars["String"]["input"]; }>; @@ -6362,21 +6347,6 @@ export type InstanceTypesQuery = { instanceTypes: Array; }; -export type IsPatchConfiguredQueryVariables = Exact<{ - id: Scalars["String"]["input"]; -}>; - -export type IsPatchConfiguredQuery = { - __typename?: "Query"; - patch: { - __typename?: "Patch"; - activated: boolean; - alias?: string | null; - id: string; - projectID: string; - }; -}; - export type CustomCreatedIssuesQueryVariables = Exact<{ taskId: Scalars["String"]["input"]; execution?: InputMaybe; @@ -6823,7 +6793,6 @@ export type ConfigurePatchQuery = { activated: boolean; alias?: string | null; author: string; - commitQueuePosition?: number | null; description: string; id: string; status: string; @@ -6901,7 +6870,6 @@ export type PatchQuery = { activated: boolean; alias?: string | null; author: string; - commitQueuePosition?: number | null; description: string; id: string; status: string; @@ -7491,8 +7459,6 @@ export type ProjectPatchesQuery = { alias?: string | null; author: string; authorDisplayName: string; - canEnqueueToCommitQueue: boolean; - commitQueuePosition?: number | null; createTime?: Date | null; description: string; hidden: boolean; @@ -9081,8 +9047,6 @@ export type UserPatchesQuery = { alias?: string | null; author: string; authorDisplayName: string; - canEnqueueToCommitQueue: boolean; - commitQueuePosition?: number | null; createTime?: Date | null; description: string; hidden: boolean; @@ -9149,7 +9113,6 @@ export type UserSettingsQuery = { notifications?: { __typename?: "Notifications"; buildBreak?: string | null; - commitQueue?: string | null; patchFinish?: string | null; patchFirstFailure?: string | null; spawnHostExpiration?: string | null; @@ -9201,7 +9164,6 @@ export type UserSubscriptionsQuery = { notifications?: { __typename?: "Notifications"; buildBreakId?: string | null; - commitQueueId?: string | null; patchFinishId?: string | null; patchFirstFailureId?: string | null; spawnHostExpirationId?: string | null; @@ -9366,8 +9328,6 @@ export type VersionQuery = { patch?: { __typename?: "Patch"; alias?: string | null; - canEnqueueToCommitQueue: boolean; - commitQueuePosition?: number | null; id: string; patchNumber: number; childPatches?: Array<{ diff --git a/apps/spruce/src/gql/mocks/getSpruceConfig.ts b/apps/spruce/src/gql/mocks/getSpruceConfig.ts index b74043b41..0d8c68365 100644 --- a/apps/spruce/src/gql/mocks/getSpruceConfig.ts +++ b/apps/spruce/src/gql/mocks/getSpruceConfig.ts @@ -82,7 +82,6 @@ export const getUserSettingsMock: ApolloMock< notifications: { __typename: "Notifications", buildBreak: "", - commitQueue: "", patchFinish: "", patchFirstFailure: "", spawnHostExpiration: "", diff --git a/apps/spruce/src/gql/mutations/enqueue-patch.graphql b/apps/spruce/src/gql/mutations/enqueue-patch.graphql deleted file mode 100644 index 45802bc2b..000000000 --- a/apps/spruce/src/gql/mutations/enqueue-patch.graphql +++ /dev/null @@ -1,5 +0,0 @@ -mutation EnqueuePatch($patchId: String!, $commitMessage: String) { - enqueuePatch(patchId: $patchId, commitMessage: $commitMessage) { - id - } -} diff --git a/apps/spruce/src/gql/mutations/index.ts b/apps/spruce/src/gql/mutations/index.ts index 46f61ad51..764803e7f 100644 --- a/apps/spruce/src/gql/mutations/index.ts +++ b/apps/spruce/src/gql/mutations/index.ts @@ -20,7 +20,6 @@ import DETACH_PROJECT_FROM_REPO from "./detach-project-from-repo.graphql"; import DETACH_VOLUME from "./detach-volume.graphql"; import EDIT_ANNOTATION_NOTE from "./edit-annotation-note.graphql"; import EDIT_SPAWN_HOST from "./edit-spawn-host.graphql"; -import ENQUEUE_PATCH from "./enqueue-patch.graphql"; import FILE_JIRA_TICKET from "./file-jira-ticket.graphql"; import FORCE_REPOTRACKER_RUN from "./force-repotracker-run.graphql"; import MIGRATE_VOLUME from "./migrate-volume.graphql"; @@ -29,7 +28,6 @@ import OVERRIDE_TASK_DEPENDENCIES from "./override-task-dependencies.graphql"; import PROMOTE_VARS_TO_REPO from "./promote-vars-to-repo.graphql"; import REMOVE_ANNOTATION from "./remove-annotation.graphql"; import REMOVE_FAVORITE_PROJECT from "./remove-favorite-project.graphql"; -import REMOVE_ITEM_FROM_COMMIT_QUEUE from "./remove-item-from-commit-queue.graphql"; import REMOVE_PUBLIC_KEY from "./remove-public-key.graphql"; import REMOVE_VOLUME from "./remove-volume.graphql"; import REPROVISION_TO_NEW from "./reprovision-to-new.graphql"; @@ -81,7 +79,6 @@ export { DETACH_VOLUME, EDIT_ANNOTATION_NOTE, EDIT_SPAWN_HOST, - ENQUEUE_PATCH, FILE_JIRA_TICKET, FORCE_REPOTRACKER_RUN, MIGRATE_VOLUME, @@ -90,7 +87,6 @@ export { PROMOTE_VARS_TO_REPO, REMOVE_ANNOTATION, REMOVE_FAVORITE_PROJECT, - REMOVE_ITEM_FROM_COMMIT_QUEUE, REMOVE_PUBLIC_KEY, REMOVE_VOLUME, REPROVISION_TO_NEW, diff --git a/apps/spruce/src/gql/mutations/remove-item-from-commit-queue.graphql b/apps/spruce/src/gql/mutations/remove-item-from-commit-queue.graphql deleted file mode 100644 index 9de353a0f..000000000 --- a/apps/spruce/src/gql/mutations/remove-item-from-commit-queue.graphql +++ /dev/null @@ -1,3 +0,0 @@ -mutation RemoveItemFromCommitQueue($commitQueueId: String!, $issue: String!) { - removeItemFromCommitQueue(commitQueueId: $commitQueueId, issue: $issue) -} diff --git a/apps/spruce/src/gql/queries/commit-queue.graphql b/apps/spruce/src/gql/queries/commit-queue.graphql deleted file mode 100644 index 17125dde1..000000000 --- a/apps/spruce/src/gql/queries/commit-queue.graphql +++ /dev/null @@ -1,26 +0,0 @@ -#import "../fragments/moduleCodeChanges.graphql" - -query CommitQueue($projectIdentifier: String!) { - commitQueue(projectIdentifier: $projectIdentifier) { - message - owner - projectId - queue { - enqueueTime - issue - patch { - activated - author - description - id - moduleCodeChanges { - ...ModuleCodeChange - } - versionFull { - id - } - } - } - repo - } -} diff --git a/apps/spruce/src/gql/queries/index.ts b/apps/spruce/src/gql/queries/index.ts index e2c4ce09b..8f9f8224a 100644 --- a/apps/spruce/src/gql/queries/index.ts +++ b/apps/spruce/src/gql/queries/index.ts @@ -9,7 +9,6 @@ import BUILD_VARIANTS_FOR_TASK_NAME from "./build-variants-for-task-name.graphql import BUILD_VARIANTS_WITH_CHILDREN from "./build-variants-with-children.graphql"; import CLIENT_CONFIG from "./client-config.graphql"; import CODE_CHANGES from "./code-changes.graphql"; -import COMMIT_QUEUE from "./commit-queue.graphql"; import CREATED_TICKETS from "./created-tickets.graphql"; import DISPLAY_TASK from "./display-task.graphql"; import DISTRO_EVENTS from "./distro-events.graphql"; @@ -30,7 +29,6 @@ import IMAGE_PACKAGES from "./image-packages.graphql"; import IMAGE_TOOLCHAINS from "./image-toolchains.graphql"; import IMAGES from "./images.graphql"; import INSTANCE_TYPES from "./instance-types.graphql"; -import IS_PATCH_CONFIGURED from "./is-patch-configured.graphql"; import JIRA_CUSTOM_CREATED_ISSUES from "./jira-custom-created-issues.graphql"; import JIRA_ISSUES from "./jira-issues.graphql"; import JIRA_SUSPECTED_ISSUES from "./jira-suspected-issues.graphql"; @@ -99,7 +97,6 @@ export { BUILD_VARIANTS_WITH_CHILDREN, CLIENT_CONFIG, CODE_CHANGES, - COMMIT_QUEUE, CREATED_TICKETS, DISPLAY_TASK, DISTRO_EVENTS, @@ -120,7 +117,6 @@ export { IMAGE_TOOLCHAINS, IMAGES, INSTANCE_TYPES, - IS_PATCH_CONFIGURED, JIRA_CUSTOM_CREATED_ISSUES, JIRA_ISSUES, JIRA_SUSPECTED_ISSUES, diff --git a/apps/spruce/src/gql/queries/is-patch-configured.graphql b/apps/spruce/src/gql/queries/is-patch-configured.graphql deleted file mode 100644 index 3ff217a81..000000000 --- a/apps/spruce/src/gql/queries/is-patch-configured.graphql +++ /dev/null @@ -1,8 +0,0 @@ -query IsPatchConfigured($id: String!) { - patch(patchId: $id) { - activated - alias - id - projectID - } -} diff --git a/apps/spruce/src/gql/queries/user-settings.graphql b/apps/spruce/src/gql/queries/user-settings.graphql index bacf7059e..942952cf3 100644 --- a/apps/spruce/src/gql/queries/user-settings.graphql +++ b/apps/spruce/src/gql/queries/user-settings.graphql @@ -6,7 +6,6 @@ query UserSettings { } notifications { buildBreak - commitQueue patchFinish patchFirstFailure spawnHostExpiration diff --git a/apps/spruce/src/gql/queries/user-subscriptions.graphql b/apps/spruce/src/gql/queries/user-subscriptions.graphql index 1db084cac..0ddd35238 100644 --- a/apps/spruce/src/gql/queries/user-subscriptions.graphql +++ b/apps/spruce/src/gql/queries/user-subscriptions.graphql @@ -28,7 +28,6 @@ query UserSubscriptions { userSettings { notifications { buildBreakId - commitQueueId patchFinishId patchFirstFailureId spawnHostExpirationId diff --git a/apps/spruce/src/gql/queries/version.graphql b/apps/spruce/src/gql/queries/version.graphql index 1858ca7f6..918987558 100644 --- a/apps/spruce/src/gql/queries/version.graphql +++ b/apps/spruce/src/gql/queries/version.graphql @@ -39,7 +39,6 @@ query Version($id: String!) { } patch { alias - canEnqueueToCommitQueue childPatches { githash id @@ -58,7 +57,6 @@ query Version($id: String!) { status } } - commitQueuePosition id patchNumber } diff --git a/apps/spruce/src/pages/CommitQueue.tsx b/apps/spruce/src/pages/CommitQueue.tsx deleted file mode 100644 index 3d7b07524..000000000 --- a/apps/spruce/src/pages/CommitQueue.tsx +++ /dev/null @@ -1,134 +0,0 @@ -import { useQuery } from "@apollo/client"; -import styled from "@emotion/styled"; -import Badge from "@leafygreen-ui/badge"; -import Banner from "@leafygreen-ui/banner"; -import { palette } from "@leafygreen-ui/palette"; -import { Body } from "@leafygreen-ui/typography"; -import { useParams } from "react-router-dom"; -import PageTitle from "components/PageTitle"; -import { ProjectSelect } from "components/ProjectSelect"; -import { PageWrapper } from "components/styles"; -import { getCommitQueueRoute, slugs } from "constants/routes"; -import { useToastContext } from "context/toast"; -import { - CommitQueueQuery, - CommitQueueQueryVariables, -} from "gql/generated/types"; -import { COMMIT_QUEUE } from "gql/queries"; -import { formatZeroIndexForDisplay } from "utils/numbers"; -import { CommitQueueCard } from "./commitqueue/CommitQueueCard"; - -const { gray } = palette; - -export const CommitQueue: React.FC = () => { - const { [slugs.projectIdentifier]: projectIdentifier } = useParams(); - const dispatchToast = useToastContext(); - const { data, loading } = useQuery< - CommitQueueQuery, - CommitQueueQueryVariables - >(COMMIT_QUEUE, { - // @ts-expect-error: FIXME. This comment was added by an automated script. - variables: { projectIdentifier }, - fetchPolicy: "cache-and-network", - onError: (err) => { - dispatchToast.error( - `There was an error loading the commit queue: ${err.message}`, - ); - }, - }); - - const { commitQueue } = data || {}; - const { queue } = commitQueue || {}; - - return ( - - - - - {buildBadgeString(queue ? queue.length : 0)} - - } - loading={loading} - pageTitle={`Commit Queue - ${projectIdentifier}`} - size="large" - title="Commit Queue" - /> - - - - - - {commitQueue?.message && ( - {commitQueue.message} - )} - -
- {queue ? ( - queue.map(({ enqueueTime, issue, patch }, i) => ( - - )) - ) : ( - There are no items in this queue. - )} -
- ); -}; - -const HR = styled("hr")` - background-color: ${gray.light2}; - border: 0; - height: 3px; -`; - -const buildBadgeString = (queueLength: number): string => { - if (queueLength !== 1) { - return `${queueLength} Items`; - } - return `${queueLength} Item`; -}; - -const PageHeader = styled.div` - display: flex; - justify-content: space-between; -`; - -const Column = styled.div` - display: flex; - flex-direction: column; -`; - -const ProjectSelectWrapper = styled.div` - width: 30%; -`; diff --git a/apps/spruce/src/pages/ProjectPatches.tsx b/apps/spruce/src/pages/ProjectPatches.tsx index 7cde92222..40aee9b8d 100644 --- a/apps/spruce/src/pages/ProjectPatches.tsx +++ b/apps/spruce/src/pages/ProjectPatches.tsx @@ -30,7 +30,7 @@ export const ProjectPatches = () => { isGitHubMergeQueueCheckboxChecked, setIsGitHubMergeQueueCheckboxChecked, ] = useQueryParam( - PatchPageQueryParams.CommitQueue, + PatchPageQueryParams.MergeQueue, Cookies.get(INCLUDE_COMMIT_QUEUE_PROJECT_PATCHES) === "true", ); diff --git a/apps/spruce/src/pages/Version.tsx b/apps/spruce/src/pages/Version.tsx index d0f6e22e9..248168307 100644 --- a/apps/spruce/src/pages/Version.tsx +++ b/apps/spruce/src/pages/Version.tsx @@ -1,6 +1,5 @@ -import { useState, useEffect } from "react"; -import { useLazyQuery, useQuery } from "@apollo/client"; -import { useParams, Navigate } from "react-router-dom"; +import { useQuery } from "@apollo/client"; +import { useParams } from "react-router-dom"; import { ProjectBanner } from "components/Banners"; import { PatchAndTaskFullPageLoad } from "components/Loading/PatchAndTaskFullPageLoad"; import PageTitle from "components/PageTitle"; @@ -11,21 +10,12 @@ import { PageLayout, PageSider, } from "components/styles"; -import { commitQueueAlias } from "constants/patch"; -import { getCommitQueueRoute, getPatchRoute, slugs } from "constants/routes"; +import { slugs } from "constants/routes"; import { useToastContext } from "context/toast"; -import { - VersionQuery, - VersionQueryVariables, - IsPatchConfiguredQuery, - IsPatchConfiguredQueryVariables, - HasVersionQuery, - HasVersionQueryVariables, -} from "gql/generated/types"; -import { VERSION, IS_PATCH_CONFIGURED, HAS_VERSION } from "gql/queries"; +import { VersionQuery, VersionQueryVariables } from "gql/generated/types"; +import { VERSION } from "gql/queries"; import { useSpruceConfig } from "hooks"; import { PageDoesNotExist } from "pages/NotFound"; -import { isPatchUnconfigured } from "utils/patch"; import { shortenGithash, githubPRLinkify } from "utils/string"; import { jiraLinkify } from "utils/string/jiraLinkify"; import { WarningBanner, ErrorBanner, IgnoredBanner } from "./version/Banners"; @@ -34,21 +24,17 @@ import BuildVariantCard from "./version/BuildVariantCard"; import { ActionButtons, Metadata, VersionTabs } from "./version/index"; import { NameChangeModal } from "./version/NameChangeModal"; -// IMPORTANT: If you make any changes to the state logic in this file, please make sure to update the ADR: -// docs/decisions/2023-12-13_version_page_logic.md export const VersionPage: React.FC = () => { const spruceConfig = useSpruceConfig(); const { [slugs.versionId]: versionId } = useParams(); const dispatchToast = useToastContext(); - const [redirectURL, setRedirectURL] = useState(undefined); - const [isLoadingData, setIsLoadingData] = useState(true); - // This query is used to fetch the version data. - const [getVersion, { data: versionData, error: versionError }] = useLazyQuery< - VersionQuery, - VersionQueryVariables - >(VERSION, { + const { + data: versionData, + error: versionError, + loading: versionLoading, + } = useQuery(VERSION, { // @ts-expect-error: FIXME. This comment was added by an automated script. variables: { id: versionId }, fetchPolicy: "cache-and-network", @@ -56,82 +42,14 @@ export const VersionPage: React.FC = () => { dispatchToast.error( `There was an error loading the version: ${error.message}`, ); - setIsLoadingData(false); - }, - }); - - // If the version is a patch, we need to check if it's been configured. - const [getPatch, { data: patchData, error: patchError }] = useLazyQuery< - IsPatchConfiguredQuery, - IsPatchConfiguredQueryVariables - >(IS_PATCH_CONFIGURED, { - // @ts-expect-error: FIXME. This comment was added by an automated script. - variables: { id: versionId }, - onError: (error) => { - dispatchToast.error( - `There was an error loading this patch: ${error.message}`, - ); - setIsLoadingData(false); - }, - }); - - // This query checks if the provided id has a configured version. - const { error: hasVersionError } = useQuery< - HasVersionQuery, - HasVersionQueryVariables - >(HAS_VERSION, { - // @ts-expect-error: FIXME. This comment was added by an automated script. - variables: { id: versionId }, - onCompleted: ({ hasVersion }) => { - setIsLoadingData(true); - if (hasVersion) { - // @ts-expect-error: FIXME. This comment was added by an automated script. - getVersion({ variables: { id: versionId } }); - } else { - // @ts-expect-error: FIXME. This comment was added by an automated script. - getPatch({ variables: { id: versionId } }); - } - }, - onError: (error) => { - dispatchToast.error(error.message); - setIsLoadingData(false); }, }); - // Decide where to redirect the user based off of whether or not the patch has been activated. - // If the patch is activated and not on the commit queue, we can safely fetch the associated version. - useEffect(() => { - if (patchData) { - const { patch } = patchData; - const { activated, alias, projectID } = patch; - // @ts-expect-error: FIXME. This comment was added by an automated script. - if (isPatchUnconfigured({ alias, activated })) { - // @ts-expect-error: FIXME. This comment was added by an automated script. - setRedirectURL(getPatchRoute(versionId, { configure: true })); - setIsLoadingData(false); - } else if (!activated && alias === commitQueueAlias) { - // @ts-expect-error: FIXME. This comment was added by an automated script. - setRedirectURL(getCommitQueueRoute(projectID)); - setIsLoadingData(false); - } else { - // @ts-expect-error: FIXME. This comment was added by an automated script. - getVersion({ variables: { id: versionId } }); - } - } - }, [patchData, getVersion, versionId]); - - // If we have successfully loaded a version, we can show the page. - useEffect(() => { - if (versionData) { - setIsLoadingData(false); - } - }, [versionData]); - - if (isLoadingData) { + if (versionLoading) { return ; } - if (hasVersionError || patchError || versionError) { + if (versionError) { return ( @@ -139,12 +57,6 @@ export const VersionPage: React.FC = () => { ); } - // If it's a patch, redirect to the proper page. - if (redirectURL) { - return ; - } - - // If it's a version, proceed with loading the version page. const { version } = versionData || {}; const { errors, @@ -158,12 +70,7 @@ export const VersionPage: React.FC = () => { status, warnings, } = version || {}; - const { - canEnqueueToCommitQueue, - commitQueuePosition = null, - patchNumber, - } = patch || {}; - const isPatchOnCommitQueue = commitQueuePosition !== null; + const { patchNumber } = patch || {}; // @ts-expect-error: FIXME. This comment was added by an automated script. const versionText = shortenGithash(revision || versionId); @@ -197,14 +104,9 @@ export const VersionPage: React.FC = () => { buttons={ diff --git a/apps/spruce/src/pages/commitqueue/CodeChangesModule.tsx b/apps/spruce/src/pages/commitqueue/CodeChangesModule.tsx deleted file mode 100644 index 82da1f707..000000000 --- a/apps/spruce/src/pages/commitqueue/CodeChangesModule.tsx +++ /dev/null @@ -1,75 +0,0 @@ -import styled from "@emotion/styled"; -import { Body, BodyProps } from "@leafygreen-ui/typography"; -import { Accordion } from "components/Accordion"; -import { CodeChangesBadge } from "components/CodeChangesBadge"; -import { CodeChangesTable } from "components/CodeChangesTable"; -import { size, fontSize } from "constants/tokens"; -import { - FileDiffsFragment, - ModuleCodeChangeFragment, -} from "gql/generated/types"; -import { commits } from "utils"; - -const { bucketByCommit } = commits; - -const totalFileDiffs = ( - fileDiffs: FileDiffsFragment[], -): { additions: number; deletions: number } => { - let additions = 0; - let deletions = 0; - fileDiffs.forEach((fileDiff) => { - additions += fileDiff.additions; - deletions += fileDiff.deletions; - }); - return { additions, deletions }; -}; - -export const CodeChangeModule: React.FC<{ - moduleCodeChange: ModuleCodeChangeFragment; -}> = ({ moduleCodeChange }) => { - const { fileDiffs } = moduleCodeChange; - - return ( - <> - {bucketByCommit(fileDiffs).map((commitDiffs) => { - const { description } = commitDiffs[0] ?? {}; - return ( - - {description && ( - {description} - )} - - Total code changes - - - } - > - - - - - - ); - })} - - ); -}; - -const CodeChangeModuleContainer = styled.div` - padding-bottom: ${size.l}; -`; - -const DropDownTextStyle = styled("span")` - margin-right: ${size.m}; -`; - -const CommitName = styled(Body)` - font-size: ${fontSize.l}; - padding-bottom: ${size.xs}; -`; - -const TableWrapper = styled.div` - margin-top: ${size.xs}; -`; diff --git a/apps/spruce/src/pages/commitqueue/CommitQueueCard.test.tsx b/apps/spruce/src/pages/commitqueue/CommitQueueCard.test.tsx deleted file mode 100644 index 93a9b54d1..000000000 --- a/apps/spruce/src/pages/commitqueue/CommitQueueCard.test.tsx +++ /dev/null @@ -1,196 +0,0 @@ -import { MockedProvider } from "@apollo/client/testing"; -import { RenderFakeToastContext } from "context/toast/__mocks__"; -import { renderWithRouterMatch as render, screen, within } from "test_utils"; -import { CommitQueueCard } from "./CommitQueueCard"; - -const titleWithPullRequestURL = - "'evergreen-ci/spruce' commit queue merge (PR #1000) by github_pull_request: EVG-17230: Show multiple links in commit queue card title (https://github.com/evergreen-ci/spruce/pull/1000)"; -const titleWithoutPullRequestURL = - "'evergreen-ci/spruce' commit queue merge (PR #1000) by github_pull_request: EVG-17230: Show multiple links in commit queue card title"; - -const baseProps = { - index: 0, - author: "user", - commitTime: new Date("2020-08-21T18:00:07Z"), - patchId: "123", - owner: "evergreen-ci", - repo: "spruce", - moduleCodeChanges: [], - commitQueueId: "789", -}; - -describe("commit queue entry title", () => { - describe("entries with with a version", () => { - it("renders two links for a title that includes a GitHub link", () => { - const { Component } = RenderFakeToastContext( - , - ); - render( - - - , - ); - - const title = screen.getByDataCy("commit-queue-card-title"); - const links = within(title).getAllByRole("link"); - expect(links).toHaveLength(2); - expect(links[0]).toHaveTextContent( - "'evergreen-ci/spruce' commit queue merge (PR #1000) by github_pull_request", - ); - expect(links[0]).toHaveAttribute("href", "/version/123/tasks"); - expect(links[1]).toHaveTextContent( - "https://github.com/evergreen-ci/spruce/pull/1000", - ); - expect(links[1]).toHaveAttribute( - "href", - "https://github.com/evergreen-ci/spruce/pull/1000", - ); - }); - - it("links to the version for an item with no issue or GitHub URL", () => { - const { Component } = RenderFakeToastContext( - , - ); - render( - - - , - ); - - const title = screen.getByDataCy("commit-queue-card-title"); - const links = within(title).getAllByRole("link"); - expect(links).toHaveLength(1); - expect(links[0]).toHaveTextContent(titleWithoutPullRequestURL); - expect(links[0]).toHaveAttribute("href", "/version/123/tasks"); - }); - - it("linkifies the GitHub URL for an unactivated version", () => { - const { Component } = RenderFakeToastContext( - , - ); - render( - - - , - ); - - const title = screen.getByDataCy("commit-queue-card-title"); - const links = within(title).getAllByRole("link"); - expect(links).toHaveLength(1); - expect(links[0]).toHaveTextContent( - "https://github.com/evergreen-ci/spruce/pull/1000", - ); - expect(links[0]).toHaveAttribute( - "href", - "https://github.com/evergreen-ci/spruce/pull/1000", - ); - }); - }); - - describe("entries without a version", () => { - it("linkifies the GitHub URL", () => { - const { Component } = RenderFakeToastContext( - , - ); - render( - - - , - ); - - const title = screen.getByDataCy("commit-queue-card-title"); - const links = within(title).getAllByRole("link"); - expect(links).toHaveLength(1); - expect(links[0]).toHaveTextContent( - "https://github.com/evergreen-ci/spruce/pull/1000", - ); - expect(links[0]).toHaveAttribute( - "href", - "https://github.com/evergreen-ci/spruce/pull/1000", - ); - }); - - it("constructs a GitHub URL for an item with no URL in its title", () => { - const { Component } = RenderFakeToastContext( - , - ); - render( - - - , - ); - - const title = screen.getByDataCy("commit-queue-card-title"); - const links = within(title).getAllByRole("link"); - expect(links).toHaveLength(1); - expect(links[0]).toHaveTextContent(titleWithoutPullRequestURL); - expect(links[0]).toHaveAttribute( - "href", - "https://github.com/evergreen-ci/spruce/pull/1000", - ); - }); - }); - - describe("entries without a patch ID", () => { - it("links to the pull request", () => { - const { Component } = RenderFakeToastContext( - , - ); - render( - - - , - ); - - const title = screen.getByDataCy("commit-queue-card-title"); - const links = within(title).getAllByRole("link"); - expect(links).toHaveLength(1); - expect(links[0]).toHaveTextContent("Pull Request #1000"); - expect(links[0]).toHaveAttribute( - "href", - "https://github.com/evergreen-ci/spruce/pull/1000", - ); - }); - }); -}); diff --git a/apps/spruce/src/pages/commitqueue/CommitQueueCard.tsx b/apps/spruce/src/pages/commitqueue/CommitQueueCard.tsx deleted file mode 100644 index cdeb65ee8..000000000 --- a/apps/spruce/src/pages/commitqueue/CommitQueueCard.tsx +++ /dev/null @@ -1,214 +0,0 @@ -import { useMutation } from "@apollo/client"; -import styled from "@emotion/styled"; -import { palette } from "@leafygreen-ui/palette"; -import { Subtitle, Body, BodyProps } from "@leafygreen-ui/typography"; -import reactStringReplace from "react-string-replace"; -import { StyledLink, StyledRouterLink } from "components/styles"; -import { getGithubPullRequestUrl } from "constants/externalResources"; -import { getVersionRoute } from "constants/routes"; -import { size, fontSize } from "constants/tokens"; -import { useToastContext } from "context/toast"; -import { - ModuleCodeChangeFragment, - RemoveItemFromCommitQueueMutation, - RemoveItemFromCommitQueueMutationVariables, -} from "gql/generated/types"; -import { REMOVE_ITEM_FROM_COMMIT_QUEUE } from "gql/mutations"; -import { useDateFormat } from "hooks"; -import { string } from "utils"; -import { CodeChangeModule } from "./CodeChangesModule"; -import { ConfirmPatchButton } from "./ConfirmPatchButton"; - -const { githubPRLinkify } = string; - -interface Props { - issue: string; - index: number; - title: string; - author: string; - commitTime: Date; - patchId: string; - versionId: string; - owner: string; - repo: string; - moduleCodeChanges: ModuleCodeChangeFragment[]; - commitQueueId: string; - activated: boolean; -} -const { gray } = palette; - -export const CommitQueueCard: React.FC = ({ - activated, - author, - commitQueueId, - commitTime, - index, - issue, - moduleCodeChanges, - owner, - patchId, - repo, - title, - versionId, -}) => { - const dispatchToast = useToastContext(); - const getDateCopy = useDateFormat(); - const [removeItemFromCommitQueue, { loading }] = useMutation< - RemoveItemFromCommitQueueMutation, - RemoveItemFromCommitQueueMutationVariables - >(REMOVE_ITEM_FROM_COMMIT_QUEUE, { - onCompleted: () => { - dispatchToast.success("Successfully removed item from commit queue"); - }, - onError: (err) => { - dispatchToast.error(`Error removing item from commit queue ${err}`); - }, - }); - - const handleEnroll = () => { - removeItemFromCommitQueue({ - variables: { issue, commitQueueId }, - refetchQueries: ["CommitQueue"], - }); - }; - - // Linkify any GitHub URLs that appear in the title text. - // If no GitHub link was found, wrap all text in a link to the version. - // If a GitHub link was identified, wrap all text that appears before the first : with the version link. - const versionLinkify = () => { - const githubTitle = githubPRLinkify(title); - - if (!activated) { - return githubTitle; - } - - if (githubTitle.length === 1 || typeof githubTitle[0] !== "string") { - return ( - - {githubTitle} - - ); - } - - // Only replace the string that occurs before the link. We don't want to run this operation on the trailing parentheses. - const [versionString, ...rest] = githubTitle; - const versionLink = reactStringReplace( - versionString, - /(^[^:]*)/g, - (match, i) => ( - - {match} - - ), - ); - - return ( - <> - {versionLink} - {rest} - - ); - }; - - const noVersionLinkify = () => { - const githubTitle = githubPRLinkify(title); - - // If a URL wasn't found in the text, construct a link to wrap the entire title - if (githubTitle.length === 1) { - return ( - - {title} - - ); - } - return githubTitle; - }; - - return ( - - {index}. - - {patchId ? ( - - - {!!versionId || issue === "" || Number.isNaN(Number(issue)) ? ( - <>{versionLinkify()} - ) : ( - <>{noVersionLinkify()} - )} - - - By {author} on {getDateCopy(commitTime)} - - - {moduleCodeChanges?.map((moduleCodeChange) => ( - - ))} - - - ) : ( - // should only get here for pull requests not processed yet (ie. added in the past minute) - - - - Pull Request #{issue} - - - - )} - - - - - - ); -}; - -const Card = styled.div` - display: flex; - margin-top: ${size.s}; - width: 100%; -`; - -const CardTitle = styled.span` - margin-bottom: ${size.s}; - font-size: ${fontSize.l}; - font-weight: bold; -`; - -const CommitInfo = styled.div` - display: flex; - flex-direction: column; - grid-area: 1 / 1 / 2 / 2; - margin-left: ${size.s}; - margin-bottom: ${size.m}; - width: 100%; -`; -const CardMetaData = styled(Body)` - color: ${gray.dark2}; -`; - -const CommitQueueCardGrid = styled.div` - border-bottom: 1px solid ${gray.light2}; - display: grid; - grid-template-columns: 4fr repeat(2, 1fr); - grid-template-rows: 1fr; - grid-column-gap: 0px; - grid-row-gap: 0px; - width: 100%; -`; - -const CommitQueueCardActions = styled.div` - grid-area: 1 / 3 / 2 / 4; -`; - -const Container = styled.div` - padding-top: ${size.m}; -`; diff --git a/apps/spruce/src/pages/commitqueue/ConfirmPatchButton.tsx b/apps/spruce/src/pages/commitqueue/ConfirmPatchButton.tsx deleted file mode 100644 index f77d7e567..000000000 --- a/apps/spruce/src/pages/commitqueue/ConfirmPatchButton.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import { useState } from "react"; -import styled from "@emotion/styled"; -import Button from "@leafygreen-ui/button"; -import ConfirmationModal, { Variant } from "@leafygreen-ui/confirmation-modal"; - -interface ConfirmPatchButtonProps { - disabled: boolean; - onConfirm: () => void; - commitTitle: string; -} -export const ConfirmPatchButton: React.FC = ({ - commitTitle, - disabled, - onConfirm, -}) => { - const [open, setOpen] = useState(false); - - return ( - <> - setOpen(!open)} - > - Remove Patch From Queue - - setOpen(false)} - onConfirm={() => { - onConfirm(); - setOpen(false); - }} - open={open} - title="Are you sure you want to remove this patch from the commit queue?" - variant={Variant.Danger} - > - {commitTitle} - - - ); -}; - -const StyledButton = styled(Button)` - // Without this the button stretches and the text overflows - font-size: 12px; -`; diff --git a/apps/spruce/src/pages/configurePatch/index.tsx b/apps/spruce/src/pages/configurePatch/index.tsx index 3a5b9b374..b181e5ca7 100644 --- a/apps/spruce/src/pages/configurePatch/index.tsx +++ b/apps/spruce/src/pages/configurePatch/index.tsx @@ -3,7 +3,7 @@ import { useParams, Navigate } from "react-router-dom"; import { ProjectBanner } from "components/Banners"; import { PatchAndTaskFullPageLoad } from "components/Loading/PatchAndTaskFullPageLoad"; import { PageWrapper } from "components/styles"; -import { commitQueueAlias } from "constants/patch"; +import { mergeQueueAlias } from "constants/patch"; import { getVersionRoute, slugs } from "constants/routes"; import { useToastContext } from "context/toast"; import { @@ -48,7 +48,7 @@ const ConfigurePatch: React.FC = () => { } // @ts-expect-error: FIXME. This comment was added by an automated script. - if (patch.alias === commitQueueAlias) { + if (patch.alias === mergeQueueAlias) { // @ts-expect-error: FIXME. This comment was added by an automated script. return ; } diff --git a/apps/spruce/src/pages/preferences/preferencesTabs/notificationTab/NotificationField.tsx b/apps/spruce/src/pages/preferences/preferencesTabs/notificationTab/NotificationField.tsx index 99ac53994..a8e0466f7 100644 --- a/apps/spruce/src/pages/preferences/preferencesTabs/notificationTab/NotificationField.tsx +++ b/apps/spruce/src/pages/preferences/preferencesTabs/notificationTab/NotificationField.tsx @@ -52,7 +52,7 @@ export const NotificationField: React.FC = ({ const GridContainer = styled.div` display: grid; grid-template-columns: repeat(2, 1fr); - grid-template-rows: repeat(7, 1fr); + grid-template-rows: repeat(6, 1fr); margin-bottom: ${size.s}; width: 350px; `; diff --git a/apps/spruce/src/pages/preferences/preferencesTabs/notificationTab/useSubscriptionData.tsx b/apps/spruce/src/pages/preferences/preferencesTabs/notificationTab/useSubscriptionData.tsx index 5a845cbfe..d9bebe65f 100644 --- a/apps/spruce/src/pages/preferences/preferencesTabs/notificationTab/useSubscriptionData.tsx +++ b/apps/spruce/src/pages/preferences/preferencesTabs/notificationTab/useSubscriptionData.tsx @@ -21,7 +21,6 @@ export const useSubscriptionData = () => { const globalSubscriptionIds = useMemo(() => { const { buildBreakId, - commitQueueId, patchFinishId, patchFirstFailureId, spawnHostExpirationId, @@ -29,7 +28,6 @@ export const useSubscriptionData = () => { } = data?.userSettings?.notifications ?? {}; return new Set([ buildBreakId, - commitQueueId, patchFinishId, patchFirstFailureId, spawnHostExpirationId, diff --git a/apps/spruce/src/pages/projectSettings/tabs/GithubCommitQueueTab/GithubCommitQueueTab.tsx b/apps/spruce/src/pages/projectSettings/tabs/GithubCommitQueueTab/GithubCommitQueueTab.tsx index 952ad7e4c..539e205bc 100644 --- a/apps/spruce/src/pages/projectSettings/tabs/GithubCommitQueueTab/GithubCommitQueueTab.tsx +++ b/apps/spruce/src/pages/projectSettings/tabs/GithubCommitQueueTab/GithubCommitQueueTab.tsx @@ -113,7 +113,6 @@ const validate = ( ) => ((formData, errors) => { const { - commitQueue: { enabled, patchDefinitions }, github: { gitTagVersionsEnabled, gitTags, @@ -122,6 +121,7 @@ const validate = ( prTesting, prTestingEnabled, }, + mergeQueue: { enabled, patchDefinitions }, } = formData; // getVersionControlError is a curried function, so save its partial application here to avoid repetition @@ -169,12 +169,12 @@ const validate = ( getAliasError( // @ts-expect-error: FIXME. This comment was added by an automated script. enabled, - patchDefinitions?.commitQueueAliasesOverride, - patchDefinitions?.commitQueueAliases, - repoData?.commitQueue?.patchDefinitions?.commitQueueAliases, + patchDefinitions?.mergeQueueAliasesOverride, + patchDefinitions?.mergeQueueAliases, + repoData?.mergeQueue?.patchDefinitions?.mergeQueueAliases, ) === ErrorType.Error ) { - errors.github.prTesting.addError("Missing Commit Queue Patch Definition"); + errors.github.prTesting.addError("Missing Merge Queue Patch Definition"); } return errors; diff --git a/apps/spruce/src/pages/projectSettings/tabs/GithubCommitQueueTab/getFormSchema.tsx b/apps/spruce/src/pages/projectSettings/tabs/GithubCommitQueueTab/getFormSchema.tsx index f48ab5a38..67830ff7c 100644 --- a/apps/spruce/src/pages/projectSettings/tabs/GithubCommitQueueTab/getFormSchema.tsx +++ b/apps/spruce/src/pages/projectSettings/tabs/GithubCommitQueueTab/getFormSchema.tsx @@ -4,7 +4,7 @@ import { CardFieldTemplate } from "components/SpruceForm/FieldTemplates"; import widgets from "components/SpruceForm/Widgets"; import { StyledRouterLink, StyledLink } from "components/styles"; import { - commitQueueAliasesDocumentationUrl, + mergeQueueAliasesDocumentationUrl, pullRequestAliasesDocumentationUrl, gitTagAliasesDocumentationUrl, githubChecksAliasesDocumentationUrl, @@ -193,7 +193,7 @@ export const getFormSchema = ( }, }, }, - commitQueue: { + mergeQueue: { type: "object" as "object", title: "Merge Queue", properties: { @@ -202,7 +202,7 @@ export const getFormSchema = ( oneOf: radioBoxOptions( ["Enabled", "Disabled"], // @ts-expect-error: FIXME. This comment was added by an automated script. - repoData?.commitQueue?.enabled, + repoData?.mergeQueue?.enabled, ), }, }, @@ -223,9 +223,9 @@ export const getFormSchema = ( }, patchDefinitions: { type: "object" as "object", - title: "Commit Queue Patch Definitions", + title: "Merge Queue Patch Definitions", ...overrideRadioBox( - "commitQueueAliases", + "mergeQueueAliases", [ "Override Repo Patch Definition", "Default to Repo Patch Definition", @@ -449,7 +449,7 @@ export const getFormSchema = ( }, }, }, - commitQueue: { + mergeQueue: { "ui:ObjectFieldTemplate": CardFieldTemplate, "ui:data-cy": "cq-card", enabled: { @@ -459,33 +459,33 @@ export const getFormSchema = ( ...githubConflictErrorStyling( // @ts-expect-error: FIXME. This comment was added by an automated script. githubProjectConflicts?.commitQueueIdentifiers, - formData?.commitQueue?.enabled, - repoData?.commitQueue?.enabled, - "the Commit Queue", + formData?.mergeQueue?.enabled, + repoData?.mergeQueue?.enabled, + "the Merge Queue", ), }, patchDefinitions: { ...errorStyling( // @ts-expect-error: FIXME. This comment was added by an automated script. - formData?.commitQueue?.enabled, - formData?.commitQueue?.patchDefinitions?.commitQueueAliasesOverride, - formData?.commitQueue?.patchDefinitions?.commitQueueAliases, - repoData?.commitQueue?.patchDefinitions?.commitQueueAliases, - "Commit Queue Patch Definition", + formData?.mergeQueue?.enabled, + formData?.mergeQueue?.patchDefinitions?.mergeQueueAliasesOverride, + formData?.mergeQueue?.patchDefinitions?.mergeQueueAliases, + repoData?.mergeQueue?.patchDefinitions?.mergeQueueAliases, + "Merge Queue Patch Definition", ), - commitQueueAliasesOverride: { + mergeQueueAliasesOverride: { "ui:data-cy": "cq-override-radio-box", ...overrideStyling, }, - "ui:description": CommitQueueAliasesDescription, - commitQueueAliases: { + "ui:description": MergeQueueAliasesDescription, + mergeQueueAliases: { ...aliasRowUiSchema({ - addButtonText: "Add Commit Queue Patch Definition", + addButtonText: "Add merge queue patch definition", numberedTitle: "Patch Definition", }), }, repoData: { - commitQueueAliases: { + mergeQueueAliases: { ...aliasRowUiSchema({ numberedTitle: "Repo Patch Definition", isRepo: true, @@ -567,11 +567,11 @@ const PRAliasesDescription = ( ); -const CommitQueueAliasesDescription = ( +const MergeQueueAliasesDescription = ( <> - Changes on the Commit Queue are tested with all variants and tasks that - match each variant and task regex pair. These aliases{" "} - + Changes on the Merge Queue are tested with all variants and tasks that match + each variant and task regex pair. These aliases{" "} + may be defined {" "} in this project’s config YAML instead if Version Control is enabled diff --git a/apps/spruce/src/pages/projectSettings/tabs/GithubCommitQueueTab/transformers.test.ts b/apps/spruce/src/pages/projectSettings/tabs/GithubCommitQueueTab/transformers.test.ts index 225dbe2c8..115fbad41 100644 --- a/apps/spruce/src/pages/projectSettings/tabs/GithubCommitQueueTab/transformers.test.ts +++ b/apps/spruce/src/pages/projectSettings/tabs/GithubCommitQueueTab/transformers.test.ts @@ -106,11 +106,11 @@ const projectForm: GCQFormState = { ], }, }, - commitQueue: { + mergeQueue: { enabled: null, patchDefinitions: { - commitQueueAliasesOverride: true, - commitQueueAliases: [ + mergeQueueAliasesOverride: true, + mergeQueueAliases: [ { id: "3", alias: "__commit_queue", @@ -259,11 +259,11 @@ const repoForm: GCQFormState = { gitTagAliases: [], }, }, - commitQueue: { + mergeQueue: { enabled: true, patchDefinitions: { - commitQueueAliasesOverride: true, - commitQueueAliases: [], + mergeQueueAliasesOverride: true, + mergeQueueAliases: [], }, }, }; @@ -408,11 +408,11 @@ const mergedForm: GCQFormState = { }, }, }, - commitQueue: { + mergeQueue: { enabled: null, patchDefinitions: { - commitQueueAliasesOverride: true, - commitQueueAliases: [ + mergeQueueAliasesOverride: true, + mergeQueueAliases: [ { id: "3", alias: "__commit_queue", @@ -433,8 +433,8 @@ const mergedForm: GCQFormState = { }, ], repoData: { - commitQueueAliasesOverride: true, - commitQueueAliases: [], + mergeQueueAliasesOverride: true, + mergeQueueAliases: [], }, }, }, diff --git a/apps/spruce/src/pages/projectSettings/tabs/GithubCommitQueueTab/transformers.ts b/apps/spruce/src/pages/projectSettings/tabs/GithubCommitQueueTab/transformers.ts index ebdd7de8d..c6d4e334b 100644 --- a/apps/spruce/src/pages/projectSettings/tabs/GithubCommitQueueTab/transformers.ts +++ b/apps/spruce/src/pages/projectSettings/tabs/GithubCommitQueueTab/transformers.ts @@ -14,8 +14,8 @@ export const mergeProjectRepo = ( ): GCQFormState => { // Merge project and repo objects so that repo config can be displayed on project pages const { - commitQueue: { patchDefinitions }, github: { gitTags, githubChecks, prTesting, teams, users }, + mergeQueue: { patchDefinitions }, } = repoData; const mergedObject: GCQFormState = projectData; mergedObject.github.prTesting.repoData = prTesting; @@ -23,7 +23,7 @@ export const mergeProjectRepo = ( mergedObject.github.users.repoData = users; mergedObject.github.teams.repoData = teams; mergedObject.github.gitTags.repoData = gitTags; - mergedObject.commitQueue.patchDefinitions.repoData = patchDefinitions; + mergedObject.mergeQueue.patchDefinitions.repoData = patchDefinitions; return mergedObject; }; @@ -54,10 +54,10 @@ export const gqlToForm = ((data, options) => { } = projectRef; const { - commitQueueAliases, gitTagAliases, githubCheckAliases, githubPrAliases, + mergeQueueAliases, // @ts-expect-error: FIXME. This comment was added by an automated script. } = sortAliases(aliases); @@ -106,11 +106,11 @@ export const gqlToForm = ((data, options) => { gitTagAliases, }, }, - commitQueue: { + mergeQueue: { enabled: commitQueue.enabled, patchDefinitions: { - commitQueueAliasesOverride: override(commitQueueAliases), - commitQueueAliases, + mergeQueueAliasesOverride: override(mergeQueueAliases), + mergeQueueAliases, }, }, }; @@ -119,7 +119,6 @@ export const gqlToForm = ((data, options) => { export const formToGql = (( { - commitQueue: { enabled, patchDefinitions }, github: { gitTagVersionsEnabled, gitTags, @@ -132,6 +131,7 @@ export const formToGql = (( teams: { gitTagAuthorizedTeams, gitTagAuthorizedTeamsOverride }, users: { gitTagAuthorizedUsers, gitTagAuthorizedUsersOverride }, }, + mergeQueue: { enabled, patchDefinitions }, }, isRepo, id, @@ -173,17 +173,17 @@ export const formToGql = (( AliasNames.GitTag, ); - const commitQueueAliases = transformAliases( - patchDefinitions.commitQueueAliases, - patchDefinitions.commitQueueAliasesOverride, - AliasNames.CommitQueue, + const mergeQueueAliases = transformAliases( + patchDefinitions.mergeQueueAliases, + patchDefinitions.mergeQueueAliasesOverride, + AliasNames.MergeQueue, ); const aliases = [ ...githubPrAliases, ...githubCheckAliases, ...gitTagAliases, - ...commitQueueAliases, + ...mergeQueueAliases, ]; return { diff --git a/apps/spruce/src/pages/projectSettings/tabs/GithubCommitQueueTab/types.ts b/apps/spruce/src/pages/projectSettings/tabs/GithubCommitQueueTab/types.ts index 0918b9c75..750c1323d 100644 --- a/apps/spruce/src/pages/projectSettings/tabs/GithubCommitQueueTab/types.ts +++ b/apps/spruce/src/pages/projectSettings/tabs/GithubCommitQueueTab/types.ts @@ -50,14 +50,14 @@ export interface GCQFormState { }; }; }; - commitQueue: { + mergeQueue: { enabled: boolean | null; patchDefinitions: { - commitQueueAliasesOverride: boolean; - commitQueueAliases: Array; + mergeQueueAliasesOverride: boolean; + mergeQueueAliases: Array; repoData?: { - commitQueueAliasesOverride: boolean; - commitQueueAliases: Array; + mergeQueueAliasesOverride: boolean; + mergeQueueAliases: Array; }; }; }; diff --git a/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/getFormSchema.tsx b/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/getFormSchema.tsx index b19bb00b3..abfb21501 100644 --- a/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/getFormSchema.tsx +++ b/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/getFormSchema.tsx @@ -21,10 +21,6 @@ const requesters = [ label: "GitHub Pull Requests", value: "github_pull_request", }, - { - label: "Commit Queue Merge", - value: "merge_test", - }, { label: "Periodic Builds", value: "ad_hoc", diff --git a/apps/spruce/src/pages/projectSettings/tabs/utils/alias.test.ts b/apps/spruce/src/pages/projectSettings/tabs/utils/alias.test.ts index ec793e03e..5d5f617bd 100644 --- a/apps/spruce/src/pages/projectSettings/tabs/utils/alias.test.ts +++ b/apps/spruce/src/pages/projectSettings/tabs/utils/alias.test.ts @@ -79,7 +79,7 @@ describe("transformAliases", () => { } as AliasFormType, ], true, - AliasNames.CommitQueue, + AliasNames.MergeQueue, ), ).toStrictEqual([ { diff --git a/apps/spruce/src/pages/projectSettings/tabs/utils/alias.ts b/apps/spruce/src/pages/projectSettings/tabs/utils/alias.ts index 74eec70ad..7bb14c105 100644 --- a/apps/spruce/src/pages/projectSettings/tabs/utils/alias.ts +++ b/apps/spruce/src/pages/projectSettings/tabs/utils/alias.ts @@ -13,7 +13,7 @@ const textAreaCSS = css` `; export enum AliasNames { - CommitQueue = "__commit_queue", + MergeQueue = "__commit_queue", GithubPr = "__github", GithubCheck = "__github_checks", GitTag = "__git_tag", @@ -108,9 +108,9 @@ export const sortAliases = ( } else if (a.alias === AliasNames.GitTag) { // @ts-expect-error: FIXME. This comment was added by an automated script. o.gitTagAliases.push(transformedAlias); - } else if (a.alias === AliasNames.CommitQueue) { + } else if (a.alias === AliasNames.MergeQueue) { // @ts-expect-error: FIXME. This comment was added by an automated script. - o.commitQueueAliases.push(transformedAlias); + o.mergeQueueAliases.push(transformedAlias); } else { // @ts-expect-error: FIXME. This comment was added by an automated script. o.patchAliases.push(transformedAlias); @@ -118,7 +118,7 @@ export const sortAliases = ( return o; }, { - commitQueueAliases: [], + mergeQueueAliases: [], githubPrAliases: [], githubCheckAliases: [], gitTagAliases: [], diff --git a/apps/spruce/src/pages/task/ActionButtons.tsx b/apps/spruce/src/pages/task/ActionButtons.tsx index 368b75932..d58e0b953 100644 --- a/apps/spruce/src/pages/task/ActionButtons.tsx +++ b/apps/spruce/src/pages/task/ActionButtons.tsx @@ -9,9 +9,7 @@ import { DropdownItem, ButtonDropdown } from "components/ButtonDropdown"; import { LoadingButton } from "components/Buttons"; import SetPriority from "components/SetPriority"; import { PageButtonRow } from "components/styles"; -import { commitQueueRequester } from "constants/requesters"; import { getTaskHistoryRoute, slugs } from "constants/routes"; -import { mergeTaskName } from "constants/task"; import { useToastContext } from "context/toast"; import { SetTaskPriorityMutation, @@ -66,13 +64,11 @@ export const ActionButtons: React.FC = ({ displayName, executionTasksFull, project, - requester, versionMetadata, } = task || {}; const { id: versionId, isPatch, order } = versionMetadata || {}; const { identifier: projectIdentifier } = project || {}; - const isPatchOnCommitQueue = requester === commitQueueRequester; const allExecutionTasksSucceeded = executionTasksFull?.every((t) => t.status === TaskStatus.Succeeded) ?? false; @@ -268,7 +264,6 @@ export const ActionButtons: React.FC = ({ key="task-history" as={HistoryLink} data-cy="task-history" - disabled={displayName === mergeTaskName} onClick={() => { taskAnalytics.sendEvent({ name: "Clicked see history link" }); }} @@ -281,7 +276,7 @@ export const ActionButtons: React.FC = ({ { scheduleTask(); @@ -296,7 +291,7 @@ export const ActionButtons: React.FC = ({ trigger={ @@ -335,7 +330,7 @@ export const ActionButtons: React.FC = ({ { // @ts-expect-error: FIXME. This comment was added by an automated script. diff --git a/apps/spruce/src/pages/task/metadata/Metadata.stories.tsx b/apps/spruce/src/pages/task/metadata/Metadata.stories.tsx index 13fb1ebf9..f77ffb48e 100644 --- a/apps/spruce/src/pages/task/metadata/Metadata.stories.tsx +++ b/apps/spruce/src/pages/task/metadata/Metadata.stories.tsx @@ -154,7 +154,7 @@ const Container = styled.div` const abortInfoMap: Record = { NoUser: { - buildVariantDisplayName: "~ Commit Queue", + buildVariantDisplayName: "~ Merge Queue", newVersion: "", prClosed: false, taskDisplayName: "api-task-server", @@ -162,7 +162,7 @@ const abortInfoMap: Record = { user: "", }, AbortedBecauseOfFailingTask: { - buildVariantDisplayName: "~ Commit Queue", + buildVariantDisplayName: "~ Merge Queue", newVersion: "", prClosed: false, taskDisplayName: "api-task-server", diff --git a/apps/spruce/src/pages/version/ActionButtons.tsx b/apps/spruce/src/pages/version/ActionButtons.tsx index 5cd80394a..d7eb45488 100644 --- a/apps/spruce/src/pages/version/ActionButtons.tsx +++ b/apps/spruce/src/pages/version/ActionButtons.tsx @@ -4,7 +4,6 @@ import { ScheduleTasks, RestartPatch, UnscheduleTasks, - EnqueuePatch, AddNotification, DisableTasks, ScheduleUndispatchedBaseTasks, @@ -13,20 +12,14 @@ import SetPriority from "components/SetPriority"; import { PageButtonRow } from "components/styles"; interface ActionButtonProps { - canEnqueueToCommitQueue: boolean; canReconfigure: boolean; isPatch: boolean; - isPatchOnCommitQueue: boolean; - patchDescription: string; versionId: string; } export const ActionButtons: React.FC = ({ - canEnqueueToCommitQueue, canReconfigure, isPatch, - isPatchOnCommitQueue, - patchDescription, versionId, }) => { const dropdownItems = [ @@ -43,23 +36,12 @@ export const ActionButtons: React.FC = ({ versionId={versionId} />, , - , ]; return ( - + void; - refetchQueries: string[]; -} -export const EnqueuePatchModal: React.FC = ({ - commitMessage, - onFinished, - patchId, - refetchQueries, - visible, -}) => { - const dispatchToast = useToastContext(); - const { sendEvent } = useVersionAnalytics(patchId); - const [commitMessageValue, setCommitMessageValue] = useState( - commitMessage || "", - ); - - const { data, previousData } = useQuery< - CodeChangesQuery, - CodeChangesQueryVariables - >(CODE_CHANGES, { - variables: { id: patchId }, - skip: !visible, - }); - const { patch } = data ?? previousData ?? {}; - const { moduleCodeChanges = [] } = patch ?? {}; - const preserveCommits = moduleCodeChanges.length - ? shouldPreserveCommits(moduleCodeChanges[0].fileDiffs) - : false; - - const [enqueuePatch, { loading: loadingEnqueuePatch }] = useMutation< - EnqueuePatchMutation, - EnqueuePatchMutationVariables - >(ENQUEUE_PATCH, { - onCompleted: () => { - dispatchToast.success(`Enqueued patch`); - }, - onError: (err) => { - dispatchToast.error(`Error enqueueing patch: ${err.message}`); - }, - refetchQueries, - }); - - const onConfirm = () => { - enqueuePatch({ - variables: { patchId, commitMessage: commitMessageValue }, - }); - sendEvent({ name: "Clicked enqueue tasks button" }); - onFinished(); - }; - - return ( - - {preserveCommits ? ( - - This patch was created with the{" "} - --preserve-commits option. All commits will - be preserved when merging. - - ) : ( - setCommitMessageValue(e.target.value)} - value={commitMessageValue} - /> - )} - - ); -}; - -const StyledTextArea = styled(TextArea)` - & p { - margin-bottom: ${size.s}; - } -`; - -const COMMIT_MESSAGE_ID = "commit-message-input"; diff --git a/apps/spruce/src/pages/version/index.ts b/apps/spruce/src/pages/version/index.ts index b196038a0..8e9a69558 100644 --- a/apps/spruce/src/pages/version/index.ts +++ b/apps/spruce/src/pages/version/index.ts @@ -1,6 +1,5 @@ import { ActionButtons } from "./ActionButtons"; -import { EnqueuePatchModal } from "./EnqueueModal"; import { Metadata } from "./Metadata"; import { VersionTabs } from "./VersionTabs"; -export { ActionButtons, Metadata, VersionTabs, EnqueuePatchModal }; +export { ActionButtons, Metadata, VersionTabs }; diff --git a/apps/spruce/src/types/patch.ts b/apps/spruce/src/types/patch.ts index 8aec3a15c..178c2c609 100644 --- a/apps/spruce/src/types/patch.ts +++ b/apps/spruce/src/types/patch.ts @@ -1,5 +1,5 @@ export enum PatchPageQueryParams { - CommitQueue = "commitQueue", + MergeQueue = "mergeQueue", PatchName = "patchName", Statuses = "statuses", Page = "page", diff --git a/apps/spruce/src/types/triggers.ts b/apps/spruce/src/types/triggers.ts index 439fe6bfe..b0c49a541 100644 --- a/apps/spruce/src/types/triggers.ts +++ b/apps/spruce/src/types/triggers.ts @@ -2,7 +2,6 @@ import { StringMap } from "@evg-ui/lib/types/utils"; export enum ResourceType { Build = "BUILD", - CommitQueue = "COMMIT_QUEUE", Host = "HOST", Patch = "PATCH", Task = "TASK", diff --git a/apps/spruce/src/utils/patch/index.ts b/apps/spruce/src/utils/patch/index.ts deleted file mode 100644 index 2f8cb7c58..000000000 --- a/apps/spruce/src/utils/patch/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { commitQueueAlias } from "constants/patch"; - -interface IsPatchUnconfiguredParams { - alias: string; - activated: boolean; -} - -/** - * `isPatchUnconfigured` returns true if the patch is not activated and the patch is not on the commit queue. - * @param param - The alias and activated status of the patch. - * @param param.alias - The alias of the patch. - * @param param.activated - The activated status of the patch. - * @returns - Whether or not the patch is unconfigured. - */ -export const isPatchUnconfigured = ({ - activated, - alias, -}: IsPatchUnconfiguredParams): boolean => - !activated && alias !== commitQueueAlias; diff --git a/apps/spruce/src/utils/patch/patch.test.ts b/apps/spruce/src/utils/patch/patch.test.ts deleted file mode 100644 index 317e845b0..000000000 --- a/apps/spruce/src/utils/patch/patch.test.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { commitQueueAlias } from "constants/patch"; -import { isPatchUnconfigured } from "."; - -describe("isPatchUnconfigured", () => { - it("returns false for an unactivated commit queue patch", () => { - expect( - isPatchUnconfigured({ alias: commitQueueAlias, activated: false }), - ).toBe(false); - }); - it("returns false for an activated commit queue patch", () => { - expect( - isPatchUnconfigured({ alias: commitQueueAlias, activated: true }), - ).toBe(false); - }); - it("returns true for an unactivated non-commit queue patch", () => { - expect( - isPatchUnconfigured({ alias: "not-commitQueueAlias", activated: false }), - ).toBe(true); - }); - it("returns false for an activated non-commit queue patch", () => { - expect( - isPatchUnconfigured({ alias: "not-commitQueueAlias", activated: true }), - ).toBe(false); - }); -}); diff --git a/packages/eslint-config/index.js b/packages/eslint-config/index.js index f56b011c9..92b22af5e 100644 --- a/packages/eslint-config/index.js +++ b/packages/eslint-config/index.js @@ -111,6 +111,7 @@ module.exports = { { selections: ["OperationDefinition", "FragmentDefinition"] }, ], "@graphql-eslint/no-deprecated": WARN, + "@graphql-eslint/selection-set-depth": [WARN, { maxDepth: 8 }], // Following rule can possibly be removed after ESLint updates. "spaced-comment": OFF, }, diff --git a/apps/parsley/scripts/bootstrap-logkeeper.sh b/scripts/bootstrap-s3-logs.sh similarity index 100% rename from apps/parsley/scripts/bootstrap-logkeeper.sh rename to scripts/bootstrap-s3-logs.sh