Skip to content

Commit 630e955

Browse files
matt-aitkensamejr
andauthored
Bulk actions 2.0 (and switch all run listing to ClickHouse) (#2264)
* useSearchParams has * useSearchParams has * useSearchParams has * Consistent way to get the run filters * Consistent way to get the run filters * Consistent way to get the run filters * Initial work on the new bulk actions * Initial work on the new bulk actions * Initial work on the new bulk actions * WIP actions and filtering * WIP actions and filtering * WIP actions and filtering * Empty filter arrays are set to undefined * Empty filter arrays are set to undefined * Empty filter arrays are set to undefined * WIP prisma schema Removed extra runtimeEnvironmentId * WIP prisma schema Removed extra runtimeEnvironmentId * WIP prisma schema Removed extra runtimeEnvironmentId * Migrations * Migrations * Migrations * BulkActionGroup changed some columns around * BulkActionGroup changed some columns around * BulkActionGroup changed some columns around * New badge variant, removed unused ones * New badge variant, removed unused ones * New badge variant, removed unused ones * Bulk action button * Bulk action button * Bulk action button * Make the next runs page the default now * Make the next runs page the default now * Make the next runs page the default now * Improved the RadioButton style * Improved the RadioButton style * Improved the RadioButton style * Remove the old bulk action bar * Remove the old bulk action bar * Remove the old bulk action bar * More UI progress * More UI progress * More UI progress * Lots of UI changes to the Runs page * Lots of UI changes to the Runs page * Lots of UI changes to the Runs page * Fixed period filter resetting everything * Fixed period filter resetting everything * Fixed period filter resetting everything * Improved the Switch secondary style * Improved the Switch secondary style * Improved the Switch secondary style * Buggy filter fixes * Buggy filter fixes * Buggy filter fixes * Improved the filter display and fixed a bug with search param from object * Improved the filter display and fixed a bug with search param from object * Improved the filter display and fixed a bug with search param from object * Clear button is minimal * Clear button is minimal * Clear button is minimal * Using a presenter now * Using a presenter now * Using a presenter now * Bulk actions are created, but not actually processed (yet) * Bulk actions are created, but not actually processed (yet) * Bulk actions are created, but not actually processed (yet) * Bulk replay/cancel is working * Bulk replay/cancel is working * Bulk replay/cancel is working * Multiple fixes, added bulk column to PG * Multiple fixes, added bulk column to PG * Multiple fixes, added bulk column to PG * Bulk action run filtering working using CH * Bulk action run filtering working using CH * Bulk action run filtering working using CH * Replay setting the bulk id on the runs * Replay setting the bulk id on the runs * Replay setting the bulk id on the runs * Properly cap the time when doing a bulk action * Properly cap the time when doing a bulk action * Properly cap the time when doing a bulk action * If the bulk action isn't recent, add it to the dropdown anyway * If the bulk action isn't recent, add it to the dropdown anyway * If the bulk action isn't recent, add it to the dropdown anyway * Blank version of the bulk actions page * Blank version of the bulk actions page * Blank version of the bulk actions page * Individually selected runs working * Individually selected runs working * Individually selected runs working * Use selected mode if runs are checked * Use selected mode if runs are checked * Use selected mode if runs are checked * Added the modal * Added the modal * Added the modal * Marked the old bulk actions stuff as deprecated * Marked the old bulk actions stuff as deprecated * Marked the old bulk actions stuff as deprecated * Renamed bulk action file * Renamed bulk action file * Renamed bulk action file * Bulk run filter with the name and a default * Bulk run filter with the name and a default * Bulk run filter with the name and a default * WIP on bulk actions page * WIP on bulk actions page * WIP on bulk actions page * Updated panel, added new truncated id component * Updated panel, added new truncated id component * Updated panel, added new truncated id component * Style improvements to the radio buttons * Style improvements to the radio buttons * Style improvements to the radio buttons * Added an option action completion email * Added an option action completion email * Added an option action completion email * Adds a blank state for the bulk actions page * Adds a blank state for the bulk actions page * Adds a blank state for the bulk actions page * Nicer completed email * Nicer completed email * Nicer completed email * Don't open the bulk action panel if there are no runs * Don't open the bulk action panel if there are no runs * Don't open the bulk action panel if there are no runs * Runs blank state and bulk action accordion * Runs blank state and bulk action accordion * Runs blank state and bulk action accordion * Updates secondary/small switch style * Updates secondary/small switch style * Updates secondary/small switch style * Pagination buttons no longer split in twain (WIP) * Pagination buttons no longer split in twain (WIP) * Pagination buttons no longer split in twain (WIP) * Aborting working * Aborting working * Aborting working * Bulk action live reloading * Bulk action live reloading * Bulk action live reloading * ListPagination works correctly in all states * ListPagination works correctly in all states * ListPagination works correctly in all states * Run page, show friendlyId instead of number * Run page, show friendlyId instead of number * Run page, show friendlyId instead of number * Bulk action help open by default if you have none * Bulk action help open by default if you have none * Bulk action help open by default if you have none * Extra status filtering step because of replication delay * Extra status filtering step because of replication delay * Extra status filtering step because of replication delay * Wider bulk action onboarding * Wider bulk action onboarding * Wider bulk action onboarding * More sensible widths on the bulk action side panel * More sensible widths on the bulk action side panel * More sensible widths on the bulk action side panel * Border color tweak to the RadioButton * Border color tweak to the RadioButton * Border color tweak to the RadioButton * Improved the accordion component hover states * Improved the accordion component hover states * Improved the accordion component hover states * Updates the bulk action blank state images to the latest UI * Updates the bulk action blank state images to the latest UI * Updates the bulk action blank state images to the latest UI * Added R and C shortcuts back in * Added R and C shortcuts back in * Added R and C shortcuts back in * Fix for selecting a single run * Fix for selecting a single run * Fix for selecting a single run * Improved exit icon, added shortcut to modal * Improved exit icon, added shortcut to modal * Improved exit icon, added shortcut to modal * Tidy imports * Tidy imports * Tidy imports * Tidy imports * Tidy imports * Tidy imports * Tidy imports * Tidy imports * Tidy imports * Tidy imports * Fix for grid layout when 1 page of bulk actions visible * Fix for grid layout when 1 page of bulk actions visible * Fix for grid layout when 1 page of bulk actions visible * Removed the ... on the abort button * Removed the ... on the abort button * Removed the ... on the abort button * Removed the ... on the abort button * Animate the progress bar * Set TZ="UTC" in the env example * Filter summary in the bulk inspector * Improves the pagination styling * Improves the pagination styling * Delete old bulk action routes * Removed old Postgres RunListPresenter * Retry any replication error where the message contains "timeout" * Increase wait to make test less flaky * The test was using run id instead of friendly id * Safer array access * Remove error log if there's a bad status * Nicer frontend type safety with the bulk action and mode * Switched a log to a debug log * Retry replication unless the error is a known non-retry error Flip the strategy to retry by default * Make ClickHouse required * Backfill run replication admin API endpoint * Set a CLICKHOUSE_URL for unit tests --------- Co-authored-by: James Ritchie <[email protected]>
1 parent 6db1b71 commit 630e955

File tree

88 files changed

+3914
-2120
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+3914
-2120
lines changed

.env.example

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ APP_ORIGIN=http://localhost:3030
1313
ELECTRIC_ORIGIN=http://localhost:3060
1414
NODE_ENV=development
1515

16+
# Set this to UTC because Node.js uses the system timezone
17+
TZ="UTC"
18+
1619
# Redis is used for the v3 queuing and v2 concurrency control
1720
REDIS_HOST="localhost"
1821
REDIS_PORT="6379"
@@ -77,4 +80,4 @@ POSTHOG_PROJECT_KEY=
7780
# These control the server-side internal telemetry
7881
# INTERNAL_OTEL_TRACE_EXPORTER_URL=<URL to send traces to>
7982
# INTERNAL_OTEL_TRACE_LOGGING_ENABLED=1
80-
# INTERNAL_OTEL_TRACE_INSTRUMENT_PRISMA_ENABLED=0,
83+
# INTERNAL_OTEL_TRACE_INSTRUMENT_PRISMA_ENABLED=0,

.github/workflows/unit-tests-webapp.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ jobs:
8787
MAGIC_LINK_SECRET: "secret"
8888
ENCRYPTION_KEY: "secret"
8989
DEPLOY_REGISTRY_HOST: "docker.io"
90+
CLICKHOUSE_URL: "http://default:password@localhost:8123"
9091

9192
- name: Gather all reports
9293
if: ${{ !cancelled() }}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
export function ListCheckedIcon({ className }: { className?: string }) {
2+
return (
3+
<svg className={className} viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
4+
<path
5+
d="M2.85001 3.82759L4.09139 5.06897L6.16035 3"
6+
stroke="currentColor"
7+
strokeWidth="1.65517"
8+
strokeLinecap="round"
9+
strokeLinejoin="round"
10+
/>
11+
<path
12+
d="M2.85001 8.82759L4.09139 10.069L6.16035 8"
13+
stroke="currentColor"
14+
strokeWidth="1.65517"
15+
strokeLinecap="round"
16+
strokeLinejoin="round"
17+
/>
18+
<path
19+
d="M2.85001 13.8276L4.09139 15.069L6.16035 13"
20+
stroke="currentColor"
21+
strokeWidth="1.65517"
22+
strokeLinecap="round"
23+
strokeLinejoin="round"
24+
/>
25+
<path
26+
d="M9 4H15"
27+
stroke="currentColor"
28+
strokeWidth="2"
29+
strokeLinecap="round"
30+
strokeLinejoin="round"
31+
/>
32+
<path
33+
d="M9 9H15"
34+
stroke="currentColor"
35+
strokeWidth="2"
36+
strokeLinecap="round"
37+
strokeLinejoin="round"
38+
/>
39+
<path
40+
d="M9 14H15"
41+
stroke="currentColor"
42+
strokeWidth="2"
43+
strokeLinecap="round"
44+
strokeLinejoin="round"
45+
/>
46+
</svg>
47+
);
48+
}
2.84 KB
Loading
6.08 KB
Loading
6.3 KB
Loading

apps/webapp/app/components/BlankStatePanels.tsx

Lines changed: 61 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,22 @@ import {
1111
Squares2X2Icon,
1212
} from "@heroicons/react/20/solid";
1313
import { useLocation } from "react-use";
14+
import { BranchEnvironmentIconSmall } from "~/assets/icons/EnvironmentIcons";
1415
import { TaskIcon } from "~/assets/icons/TaskIcon";
16+
import { WaitpointTokenIcon } from "~/assets/icons/WaitpointTokenIcon";
17+
import openBulkActionsPanel from "~/assets/images/open-bulk-actions-panel.png";
18+
import selectRunsIndividually from "~/assets/images/select-runs-individually.png";
19+
import selectRunsUsingFilters from "~/assets/images/select-runs-using-filters.png";
1520
import { useEnvironment } from "~/hooks/useEnvironment";
21+
import { useFeatures } from "~/hooks/useFeatures";
1622
import { useOrganization } from "~/hooks/useOrganizations";
1723
import { useProject } from "~/hooks/useProject";
1824
import { type MinimumEnvironment } from "~/presenters/SelectBestEnvironmentPresenter.server";
25+
import { NewBranchPanel } from "~/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.branches/route";
1926
import {
2027
docsPath,
2128
v3BillingPath,
29+
v3CreateBulkActionPath,
2230
v3EnvironmentPath,
2331
v3EnvironmentVariablesPath,
2432
v3NewProjectAlertPath,
@@ -36,12 +44,7 @@ import { StepNumber } from "./primitives/StepNumber";
3644
import { TextLink } from "./primitives/TextLink";
3745
import { InitCommandV3, PackageManagerProvider, TriggerDevStepV3 } from "./SetupCommands";
3846
import { StepContentContainer } from "./StepContentContainer";
39-
import { WaitpointTokenIcon } from "~/assets/icons/WaitpointTokenIcon";
40-
import { BranchEnvironmentIconSmall } from "~/assets/icons/EnvironmentIcons";
41-
import { useFeatures } from "~/hooks/useFeatures";
42-
import { DialogContent, DialogTrigger, Dialog } from "./primitives/Dialog";
4347
import { V4Badge } from "./V4Badge";
44-
import { NewBranchPanel } from "~/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.branches/route";
4548

4649
export function HasNoTasksDev() {
4750
return (
@@ -569,3 +572,56 @@ export function SwitcherPanel({ title = "Switch to a deployed environment" }: {
569572
</div>
570573
);
571574
}
575+
576+
export function BulkActionsNone() {
577+
const organization = useOrganization();
578+
const project = useProject();
579+
const environment = useEnvironment();
580+
581+
return (
582+
<div>
583+
<div className="mb-6 flex items-center justify-between border-b pb-0.5">
584+
<Header1 spacing>Create a bulk action</Header1>
585+
<div className="flex items-center gap-2">
586+
<LinkButton
587+
variant="primary/small"
588+
LeadingIcon={PlusIcon}
589+
to={v3CreateBulkActionPath(organization, project, environment)}
590+
>
591+
New bulk action
592+
</LinkButton>
593+
</div>
594+
</div>
595+
<StepNumber stepNumber="1" title="Select runs individually" />
596+
<StepContentContainer className="mb-4 flex flex-col gap-4">
597+
<Paragraph>Select runs from the runs page individually.</Paragraph>
598+
<div>
599+
<img src={selectRunsIndividually} alt="Select runs individually" />
600+
</div>
601+
</StepContentContainer>
602+
<div className="mb-5 ml-9 flex items-center gap-2">
603+
<div className="h-px w-full bg-grid-bright" />
604+
<Paragraph variant="extra-small" className="text-text-dimmed">
605+
OR
606+
</Paragraph>
607+
<div className="h-px w-full bg-grid-bright" />
608+
</div>
609+
<StepNumber stepNumber="2" title="Select runs using filters" />
610+
<StepContentContainer className="flex flex-col gap-4">
611+
<Paragraph>
612+
Use the filter menu on the runs page to select just the runs you want to bulk action.
613+
</Paragraph>
614+
<div>
615+
<img src={selectRunsUsingFilters} alt="Select runs using filters" />
616+
</div>
617+
</StepContentContainer>
618+
<StepNumber stepNumber="3" title="Open the bulk action panel" />
619+
<StepContentContainer className="flex flex-col gap-4">
620+
<Paragraph>Click the “Bulk actions” button in the top right of the runs page.</Paragraph>
621+
<div>
622+
<img src={openBulkActionsPanel} alt="Open the bulk action panel" />
623+
</div>
624+
</StepContentContainer>
625+
</div>
626+
);
627+
}

0 commit comments

Comments
 (0)