Skip to content

Commit afcde6a

Browse files
committed
chore: remove workspace_actions experiment
1 parent 4ab5276 commit afcde6a

File tree

11 files changed

+13
-62
lines changed

11 files changed

+13
-62
lines changed

codersdk/deployment.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,9 +1958,6 @@ const (
19581958
// feature is not yet complete in functionality.
19591959
ExperimentMoons Experiment = "moons"
19601960

1961-
// https://github.com/coder/coder/milestone/19
1962-
ExperimentWorkspaceActions Experiment = "workspace_actions"
1963-
19641961
// ExperimentTailnetPGCoordinator enables the PGCoord in favor of the pubsub-
19651962
// only Coordinator
19661963
ExperimentTailnetPGCoordinator Experiment = "tailnet_pg_coordinator"

site/src/components/Dashboard/DashboardProvider.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,10 @@ export const useDashboard = (): DashboardProviderValue => {
112112
};
113113

114114
export const useIsWorkspaceActionsEnabled = (): boolean => {
115-
const { entitlements, experiments } = useDashboard();
115+
const { entitlements } = useDashboard();
116116
const allowAdvancedScheduling =
117117
entitlements.features["advanced_template_scheduling"].enabled;
118118
// This check can be removed when https://github.com/coder/coder/milestone/19
119119
// is merged up
120-
const allowWorkspaceActions = experiments.includes("workspace_actions");
121-
return allowWorkspaceActions && allowAdvancedScheduling;
120+
return allowAdvancedScheduling;
122121
};

site/src/components/WorkspaceDeletion/DormantDeletionStat.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,8 @@ export const DormantDeletionStat: FC<DormantDeletionStatProps> = ({
1717
const { entitlements, experiments } = useDashboard();
1818
const allowAdvancedScheduling =
1919
entitlements.features["advanced_template_scheduling"].enabled;
20-
// This check can be removed when https://github.com/coder/coder/milestone/19
21-
// is merged up
22-
const allowWorkspaceActions = experiments.includes("workspace_actions");
2320

24-
if (
25-
!displayDormantDeletion(
26-
workspace,
27-
allowAdvancedScheduling,
28-
allowWorkspaceActions,
29-
)
30-
) {
21+
if (!displayDormantDeletion(workspace, allowAdvancedScheduling)) {
3122
return null;
3223
}
3324

site/src/components/WorkspaceDeletion/DormantDeletionText.tsx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,11 @@ export const DormantDeletionText = ({
99
}: {
1010
workspace: Workspace;
1111
}): JSX.Element | null => {
12-
const { entitlements, experiments } = useDashboard();
12+
const { entitlements } = useDashboard();
1313
const allowAdvancedScheduling =
1414
entitlements.features["advanced_template_scheduling"].enabled;
15-
// This check can be removed when https://github.com/coder/coder/milestone/19
16-
// is merged up
17-
const allowWorkspaceActions = experiments.includes("workspace_actions");
1815

19-
if (
20-
!displayDormantDeletion(
21-
workspace,
22-
allowAdvancedScheduling,
23-
allowWorkspaceActions,
24-
)
25-
) {
16+
if (!displayDormantDeletion(workspace, allowAdvancedScheduling)) {
2617
return null;
2718
}
2819
return <StyledSpan role="status">Impending deletion</StyledSpan>;

site/src/components/WorkspaceDeletion/utils.test.ts

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,14 @@ describe("displayDormantDeletion", () => {
3434
[new Date().toISOString(), true, false, false], // Workspace Actions off
3535
])(
3636
`deleting_at=%p, allowAdvancedScheduling=%p, AllowWorkspaceActions=%p, shouldDisplay=%p`,
37-
(
38-
deleting_at,
39-
allowAdvancedScheduling,
40-
allowWorkspaceActions,
41-
shouldDisplay,
42-
) => {
37+
(deleting_at, allowAdvancedScheduling, shouldDisplay) => {
4338
const workspace: TypesGen.Workspace = {
4439
...Mocks.MockWorkspace,
4540
deleting_at,
4641
};
47-
expect(
48-
displayDormantDeletion(
49-
workspace,
50-
allowAdvancedScheduling,
51-
allowWorkspaceActions,
52-
),
53-
).toBe(shouldDisplay);
42+
expect(displayDormantDeletion(workspace, allowAdvancedScheduling)).toBe(
43+
shouldDisplay,
44+
);
5445
},
5546
);
5647
});

site/src/components/WorkspaceDeletion/utils.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,9 @@ const IMPENDING_DELETION_DISPLAY_THRESHOLD = 14; // 14 days
1414
export const displayDormantDeletion = (
1515
workspace: Workspace,
1616
allowAdvancedScheduling: boolean,
17-
allowWorkspaceActions: boolean,
1817
) => {
1918
const today = new Date();
20-
if (
21-
!workspace.deleting_at ||
22-
!allowAdvancedScheduling ||
23-
!allowWorkspaceActions
24-
) {
19+
if (!workspace.deleting_at || !allowAdvancedScheduling) {
2520
return false;
2621
}
2722
return (

site/src/pages/TemplateSettingsPage/TemplateSchedulePage/TemplateScheduleForm.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ export interface TemplateScheduleForm {
5050
isSubmitting: boolean;
5151
error?: unknown;
5252
allowAdvancedScheduling: boolean;
53-
allowWorkspaceActions: boolean;
5453
allowAutostopRequirement: boolean;
5554
// Helpful to show field errors on Storybook
5655
initialTouched?: FormikTouched<UpdateTemplateMeta>;
@@ -62,7 +61,6 @@ export const TemplateScheduleForm: FC<TemplateScheduleForm> = ({
6261
onCancel,
6362
error,
6463
allowAdvancedScheduling,
65-
allowWorkspaceActions,
6664
allowAutostopRequirement,
6765
isSubmitting,
6866
initialTouched,
@@ -459,7 +457,7 @@ export const TemplateScheduleForm: FC<TemplateScheduleForm> = ({
459457
</Stack>
460458
</Stack>
461459
</FormSection>
462-
{allowAdvancedScheduling && allowWorkspaceActions && (
460+
{allowAdvancedScheduling && (
463461
<>
464462
<FormSection
465463
title="Failure Cleanup"

site/src/pages/TemplateSettingsPage/TemplateSchedulePage/TemplateSchedulePage.test.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,6 @@ describe("TemplateSchedulePage", () => {
123123
jest
124124
.spyOn(API, "getEntitlements")
125125
.mockResolvedValue(MockEntitlementsWithScheduling);
126-
127-
// remove when https://github.com/coder/coder/milestone/19 is completed.
128-
jest.spyOn(API, "getExperiments").mockResolvedValue(["workspace_actions"]);
129126
});
130127

131128
it("Calls the API when user fills in and submits a form", async () => {

site/src/pages/TemplateSettingsPage/TemplateSchedulePage/TemplateSchedulePage.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ const TemplateSchedulePage: FC = () => {
1818
const queryClient = useQueryClient();
1919
const orgId = useOrganizationId();
2020
const { template } = useTemplateSettings();
21-
const { entitlements, experiments } = useDashboard();
21+
const { entitlements } = useDashboard();
2222
const allowAdvancedScheduling =
2323
entitlements.features["advanced_template_scheduling"].enabled;
2424
// This check can be removed when https://github.com/coder/coder/milestone/19
2525
// is merged up
26-
const allowWorkspaceActions = experiments.includes("workspace_actions");
2726
const allowAutostopRequirement =
2827
entitlements.features["template_autostop_requirement"].enabled;
2928
const { clearLocal } = useLocalStorage();
@@ -54,7 +53,6 @@ const TemplateSchedulePage: FC = () => {
5453
</Helmet>
5554
<TemplateSchedulePageView
5655
allowAdvancedScheduling={allowAdvancedScheduling}
57-
allowWorkspaceActions={allowWorkspaceActions}
5856
allowAutostopRequirement={allowAutostopRequirement}
5957
isSubmitting={isSubmitting}
6058
template={template}

site/src/pages/TemplateSettingsPage/TemplateSchedulePage/TemplateSchedulePageView.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export interface TemplateSchedulePageViewProps {
1414
typeof TemplateScheduleForm
1515
>["initialTouched"];
1616
allowAdvancedScheduling: boolean;
17-
allowWorkspaceActions: boolean;
1817
allowAutostopRequirement: boolean;
1918
}
2019

@@ -24,7 +23,6 @@ export const TemplateSchedulePageView: FC<TemplateSchedulePageViewProps> = ({
2423
onSubmit,
2524
isSubmitting,
2625
allowAdvancedScheduling,
27-
allowWorkspaceActions,
2826
allowAutostopRequirement,
2927
submitError,
3028
initialTouched,
@@ -39,7 +37,6 @@ export const TemplateSchedulePageView: FC<TemplateSchedulePageViewProps> = ({
3937

4038
<TemplateScheduleForm
4139
allowAdvancedScheduling={allowAdvancedScheduling}
42-
allowWorkspaceActions={allowWorkspaceActions}
4340
allowAutostopRequirement={allowAutostopRequirement}
4441
initialTouched={initialTouched}
4542
isSubmitting={isSubmitting}

site/src/testHelpers/entities.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1924,10 +1924,7 @@ export const MockEntitlementsWithScheduling: TypesGen.Entitlements = {
19241924
}),
19251925
};
19261926

1927-
export const MockExperiments: TypesGen.Experiment[] = [
1928-
"workspace_actions",
1929-
"moons",
1930-
];
1927+
export const MockExperiments: TypesGen.Experiment[] = ["moons"];
19311928

19321929
export const MockAuditLog: TypesGen.AuditLog = {
19331930
id: "fbd2116a-8961-4954-87ae-e4575bd29ce0",

0 commit comments

Comments
 (0)