Skip to content

Commit 4d9e4cf

Browse files
MariefayTrigger.dev RepoOps
authored andcommitted
chore(webapp): remove the queue archiving flag
Archiving unused queues from the Concurrency page is now available on every deployment, without a feature flag. Mono-RevId: 8352bd5d489920407d4d26716a92ee743f5e5c9b
1 parent 5bdc937 commit 4d9e4cf

8 files changed

Lines changed: 43 additions & 170 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: improvement
4+
---
5+
6+
Archiving unused queues from the Concurrency page is now available on all instances, including self-hosted.

‎apps/webapp/app/models/queueMutation.server.ts‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
} from "~/v3/services/concurrencySystem.server";
1111
import { ArchiveQueueService, archiveQueueErrorMessage } from "~/v3/services/archiveQueue.server";
1212
import { PauseQueueService } from "~/v3/services/pauseQueue.server";
13-
import { queueArchivingEnabled } from "~/v3/services/queueArchivingEnabled.server";
1413

1514
/**
1615
* Handles the per-queue mutating form actions (pause/resume/override/remove-override/archive/
@@ -294,18 +293,6 @@ export async function handleQueueMutationAction({
294293
return redirectWithErrorMessage(redirectPath, request, "Queue ID is required");
295294
}
296295

297-
// Unarchiving stays allowed so queues archived before the flag was turned off can come back.
298-
if (
299-
action === "queue-archive" &&
300-
!(await queueArchivingEnabled(environment.organizationId))
301-
) {
302-
return redirectWithErrorMessage(
303-
redirectPath,
304-
request,
305-
"Queue archiving isn't enabled for this organization"
306-
);
307-
}
308-
309296
const service = new ArchiveQueueService();
310297
const result =
311298
action === "queue-archive"

‎apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.concurrency/route.tsx‎

Lines changed: 35 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ import { queuesAgentPageContext } from "~/components/dashboard-agent/suggested-p
100100
import { WhenAgentUnavailable } from "~/components/dashboard-agent/WhenAgentUnavailable";
101101
import { PauseEnvironmentService } from "~/v3/services/pauseEnvironment.server";
102102
import { handleQueueMutationAction } from "~/models/queueMutation.server";
103-
import { queueArchivingEnabled } from "~/v3/services/queueArchivingEnabled.server";
104103
import {
105104
QueueArchiveButton,
106105
QueueOverrideConcurrencyButton,
@@ -191,9 +190,6 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
191190
projectId: project.id,
192191
});
193192
const canWriteTasks = auth.ok && auth.ability.can("write", { type: "tasks" });
194-
const archivingEnabled = await queueArchivingEnabled(environment.organizationId, {
195-
orgFeatureFlags: project.organization.featureFlags,
196-
});
197193

198194
// Per-org gate for the metrics UI. When off, this org gets the classic Queues page and
199195
// no metrics query fires.
@@ -218,8 +214,8 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
218214
query,
219215
page,
220216
includeLimits: true,
221-
archived: archivingEnabled && showArchived !== "true" ? "exclude" : "include",
222-
detectArchivedActivity: archivingEnabled,
217+
archived: showArchived === "true" ? "include" : "exclude",
218+
detectArchivedActivity: true,
223219
// Relevance ordering rides the metrics pipeline, so it is part of the gated UI.
224220
sort: queueMetricsUiEnabled ? (sort ?? "busiest") : "name",
225221
});
@@ -290,10 +286,7 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
290286
let allocation: Awaited<ReturnType<QueueAllocationPresenter["call"]>> | null = null;
291287
if (queueMetricsUiEnabled) {
292288
try {
293-
allocation = await new QueueAllocationPresenter().call({
294-
environment,
295-
excludeArchived: archivingEnabled,
296-
});
289+
allocation = await new QueueAllocationPresenter().call({ environment });
297290
} catch (error) {
298291
logger.warn("Queue allocation summary unavailable, rendering without it", {
299292
error,
@@ -313,7 +306,6 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
313306
maxPeriodDays,
314307
canWriteTasks,
315308
alertsEnabled,
316-
archivingEnabled,
317309
});
318310
} catch (error) {
319311
console.error(error);
@@ -465,7 +457,6 @@ function QueuesWithMetricsView() {
465457
maxPeriodDays,
466458
canWriteTasks,
467459
alertsEnabled,
468-
archivingEnabled,
469460
} = useTypedLoaderData<typeof loader>();
470461

471462
const metricsByQueue = metrics?.byQueue ?? {};
@@ -661,11 +652,7 @@ function QueuesWithMetricsView() {
661652
Allocated
662653
{allocation ? (
663654
<InfoIconTooltip
664-
content={`The sum of every queue's concurrency limit. It can go over 100% of the environment limit, which is normal: it lets one queue burst while others are quiet. The environment limit still caps total running work, so queues share it when the environment is busy.${
665-
archivingEnabled
666-
? " Archived queues aren't counted, even if they still have runs."
667-
: ""
668-
}`}
655+
content={`The sum of every queue's concurrency limit. It can go over 100% of the environment limit, which is normal: it lets one queue burst while others are quiet. The environment limit still caps total running work, so queues share it when the environment is busy. Archived queues aren't counted, even if they still have runs.`}
669656
contentClassName="max-w-xs"
670657
/>
671658
) : null}
@@ -767,7 +754,7 @@ function QueuesWithMetricsView() {
767754
above. Same left/right split as the classic view's bar. */
768755
toolbar={
769756
<>
770-
<QueueFilters showArchivedToggle={archivingEnabled} />
757+
<QueueFilters />
771758
<PaginationControls
772759
currentPage={pagination.currentPage}
773760
totalPages={pagination.mode === "unfiltered" ? pagination.totalPages : 1}
@@ -944,14 +931,12 @@ function QueuesWithMetricsView() {
944931
})}
945932
/>
946933
) : null}
947-
{archivingEnabled || queue.archivedAt ? (
948-
<QueueArchiveButton
949-
queue={queue}
950-
disabled={!canWriteTasks}
951-
lastOnPage={queues.length === 1 && pagination.currentPage > 1}
952-
onDone={close}
953-
/>
954-
) : null}
934+
<QueueArchiveButton
935+
queue={queue}
936+
disabled={!canWriteTasks}
937+
lastOnPage={queues.length === 1 && pagination.currentPage > 1}
938+
onDone={close}
939+
/>
955940
</div>
956941
);
957942

@@ -1025,12 +1010,10 @@ function QueuesWithMetricsView() {
10251010
Paused
10261011
</Badge>
10271012
) : null}
1028-
{archivingEnabled ? (
1029-
<QueueArchivedBadge
1030-
queue={queue}
1031-
hasActiveRuns={activeArchivedIds.has(queue.id)}
1032-
/>
1033-
) : null}
1013+
<QueueArchivedBadge
1014+
queue={queue}
1015+
hasActiveRuns={activeArchivedIds.has(queue.id)}
1016+
/>
10341017
{isAtQueueLimit ? (
10351018
<Badge variant="extra-small" className="text-error">
10361019
At queue limit
@@ -1422,22 +1405,20 @@ export function isEnvironmentPauseResumeFormSubmission(
14221405
);
14231406
}
14241407

1425-
export function QueueFilters({ showArchivedToggle = false }: { showArchivedToggle?: boolean }) {
1408+
export function QueueFilters() {
14261409
const { value, replace } = useSearchParams();
14271410

14281411
return (
14291412
<div className="flex items-center gap-2">
14301413
<SearchInput placeholder="Search queues…" paramName="query" resetParams={["page"]} />
1431-
{showArchivedToggle ? (
1432-
<Switch
1433-
checked={value("showArchived") === "true"}
1434-
onCheckedChange={(checked) =>
1435-
replace({ showArchived: checked ? "true" : undefined, page: undefined })
1436-
}
1437-
label="Show archived"
1438-
variant="secondary/small"
1439-
/>
1440-
) : null}
1414+
<Switch
1415+
checked={value("showArchived") === "true"}
1416+
onCheckedChange={(checked) =>
1417+
replace({ showArchived: checked ? "true" : undefined, page: undefined })
1418+
}
1419+
label="Show archived"
1420+
variant="secondary/small"
1421+
/>
14411422
</div>
14421423
);
14431424
}
@@ -1980,7 +1961,6 @@ function ClassicQueuesView() {
19801961
hasFilters,
19811962
autoReloadPollIntervalMs,
19821963
canWriteTasks,
1983-
archivingEnabled,
19841964
alertsEnabled,
19851965
} = useTypedLoaderData<typeof loader>();
19861966
const activeArchivedIds = new Set(activeArchivedQueues?.map((q) => q.id));
@@ -2124,7 +2104,7 @@ function ClassicQueuesView() {
21242104

21252105
<div className="grid max-h-full min-h-full grid-rows-[auto_1fr] overflow-x-auto">
21262106
<div className="flex items-center justify-between gap-2 border-t border-grid-dimmed px-1.5 py-1.5">
2127-
<QueueFilters showArchivedToggle={archivingEnabled} />
2107+
<QueueFilters />
21282108
<PaginationControls
21292109
currentPage={pagination.currentPage}
21302110
totalPages={pagination.mode === "unfiltered" ? pagination.totalPages : 1}
@@ -2292,14 +2272,12 @@ function ClassicQueuesView() {
22922272
})}
22932273
/>
22942274
) : null}
2295-
{archivingEnabled || queue.archivedAt ? (
2296-
<QueueArchiveButton
2297-
queue={queue}
2298-
disabled={!canWriteTasks}
2299-
lastOnPage={queues.length === 1 && pagination.currentPage > 1}
2300-
onDone={close}
2301-
/>
2302-
) : null}
2275+
<QueueArchiveButton
2276+
queue={queue}
2277+
disabled={!canWriteTasks}
2278+
lastOnPage={queues.length === 1 && pagination.currentPage > 1}
2279+
onDone={close}
2280+
/>
23032281
</div>
23042282
);
23052283

@@ -2326,12 +2304,10 @@ function ClassicQueuesView() {
23262304
Paused
23272305
</Badge>
23282306
) : null}
2329-
{archivingEnabled ? (
2330-
<QueueArchivedBadge
2331-
queue={queue}
2332-
hasActiveRuns={activeArchivedIds.has(queue.id)}
2333-
/>
2334-
) : null}
2307+
<QueueArchivedBadge
2308+
queue={queue}
2309+
hasActiveRuns={activeArchivedIds.has(queue.id)}
2310+
/>
23352311
{isAtQueueLimit ? (
23362312
<Badge variant="extra-small" className="text-error">
23372313
At queue limit

‎apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.concurrency_.$queueParam/route.tsx‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ import { formatNumberCompact } from "~/utils/numberFormatter";
7878
import { cn } from "~/utils/cn";
7979
import { redirectWithErrorMessage } from "~/models/message.server";
8080
import { handleQueueMutationAction } from "~/models/queueMutation.server";
81-
import { queueArchivingEnabled } from "~/v3/services/queueArchivingEnabled.server";
8281
import {
8382
QueueArchiveButton,
8483
QueueOverrideConcurrencyButton,
@@ -146,7 +145,6 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
146145
projectId: project.id,
147146
});
148147
const canWriteTasks = auth.ok && auth.ability.can("write", { type: "tasks" });
149-
const archivingEnabled = await queueArchivingEnabled(environment.organizationId);
150148

151149
const retrieve = await new QueueRetrievePresenter().call({
152150
environment,
@@ -193,7 +191,6 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
193191
maxPeriodDays,
194192
canWriteTasks,
195193
alertsEnabled,
196-
archivingEnabled,
197194
ids: {
198195
organizationId: environment.organizationId,
199196
projectId: environment.projectId,
@@ -295,7 +292,6 @@ export default function Page() {
295292
maxPeriodDays,
296293
canWriteTasks,
297294
alertsEnabled,
298-
archivingEnabled,
299295
} = useTypedLoaderData<typeof loader>();
300296

301297
const organization = useOrganization();
@@ -353,7 +349,7 @@ export default function Page() {
353349
<AnimatedOrgBannerBar show={queue.paused} variant="warning">
354350
{`"${queue.name}" queue paused. No new runs will be dequeued and executed.`}
355351
</AnimatedOrgBannerBar>
356-
<AnimatedOrgBannerBar show={archivingEnabled && queue.archivedAt !== null} variant="warning">
352+
<AnimatedOrgBannerBar show={queue.archivedAt !== null} variant="warning">
357353
{`"${queue.name}" queue archived. It's hidden from the Concurrency list, but its runs are unaffected.`}
358354
</AnimatedOrgBannerBar>
359355
<MetricsLayout.Root>
@@ -455,9 +451,7 @@ export default function Page() {
455451
withQueueName
456452
disabled={!canWriteTasks}
457453
/>
458-
{archivingEnabled || queue.archivedAt ? (
459-
<QueueArchiveButton queue={queue} trigger="button" disabled={!canWriteTasks} />
460-
) : null}
454+
<QueueArchiveButton queue={queue} trigger="button" disabled={!canWriteTasks} />
461455
</div>
462456
</MetricsLayout.Filters>
463457

‎apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.queues.$queueParam.archive-check.ts‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { resolveProjectAuthScope } from "~/services/projectAuthScope.server";
77
import { dashboardLoader } from "~/services/routeBuilders/dashboardBuilder";
88
import { EnvironmentParamSchema } from "~/utils/pathBuilder";
99
import { ArchiveQueueService, archiveQueueErrorMessage } from "~/v3/services/archiveQueue.server";
10-
import { queueArchivingEnabled } from "~/v3/services/queueArchivingEnabled.server";
1110

1211
const ParamsSchema = EnvironmentParamSchema.extend({ queueParam: z.string() });
1312

@@ -36,13 +35,6 @@ export const loader = dashboardLoader(
3635
throw new Response(undefined, { status: 404, statusText: "Environment not found" });
3736
}
3837

39-
if (!(await queueArchivingEnabled(environment.organizationId))) {
40-
return json<ArchiveCheckResult>({
41-
archivable: false,
42-
reason: "Queue archiving isn't enabled for this organization.",
43-
});
44-
}
45-
4638
const result = await new ArchiveQueueService().check(environment, params.queueParam);
4739

4840
if (result.isErr()) {

‎apps/webapp/app/v3/featureFlags.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ export const FEATURE_FLAG = {
5757
freeScheduleMinimumWindowEnabled: "freeScheduleMinimumWindowEnabled",
5858
deployNowEnabled: "deployNowEnabled",
5959
apiRateLimitMetricsEnabled: "apiRateLimitMetricsEnabled",
60-
queueArchivingEnabled: "queueArchivingEnabled",
6160
supportAccessSettingsEnabled: "supportAccessSettingsEnabled",
6261
runTokenInjection: "runTokenInjection",
6362
sessionTraceEnabled: "sessionTraceEnabled",
@@ -230,7 +229,6 @@ export const FeatureFlagCatalog = {
230229
// Strict z.boolean() (not z.coerce.boolean()): coercion reads the string
231230
// "false" as true, which would enable an off-by-default gate.
232231
[FEATURE_FLAG.deployNowEnabled]: z.boolean(),
233-
[FEATURE_FLAG.queueArchivingEnabled]: z.boolean(),
234232
// Shows the org Support Access settings page. Off until every webapp enforces the setting;
235233
// the org override wins over the global value.
236234
[FEATURE_FLAG.supportAccessSettingsEnabled]: z.boolean(),

‎apps/webapp/app/v3/services/queueArchivingEnabled.server.test.ts‎

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)