Skip to content

Commit 5100bd8

Browse files
committed
feat(replay): add prioritySeconds to ReplayForm and related services
1 parent 1859fd0 commit 5100bd8

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

apps/webapp/app/components/runs/v3/ReplayRunDialog.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ function ReplayForm({
201201
tags,
202202
version,
203203
machine,
204+
prioritySeconds,
204205
},
205206
] = useForm({
206207
id: "replay-task",
@@ -499,6 +500,12 @@ function ReplayForm({
499500
<Hint>Delays run by a specific duration.</Hint>
500501
<FormError id={delaySeconds.errorId}>{delaySeconds.error}</FormError>
501502
</InputGroup>
503+
<InputGroup>
504+
<Label variant="small">Priority</Label>
505+
<DurationPicker name={prioritySeconds.name} id={prioritySeconds.id} />
506+
<Hint>Sets the priority of the run. Higher values mean higher priority.</Hint>
507+
<FormError id={prioritySeconds.errorId}>{prioritySeconds.error}</FormError>
508+
</InputGroup>
502509
<InputGroup>
503510
<Label variant="small">TTL</Label>
504511
<DurationPicker

apps/webapp/app/routes/resources.taskruns.$runParam.replay.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ export const action: ActionFunction = async ({ request, params }) => {
199199
idempotencyKeyTTLSeconds: submission.value.idempotencyKeyTTLSeconds,
200200
ttlSeconds: submission.value.ttlSeconds,
201201
version: submission.value.version,
202+
prioritySeconds: submission.value.prioritySeconds,
202203
});
203204

204205
if (!newRun) {

apps/webapp/app/v3/services/replayTaskRun.server.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ export class ReplayTaskRunService extends BaseService {
110110
overrideOptions.version === "latest" ? undefined : overrideOptions.version,
111111
bulkActionId: overrideOptions?.bulkActionId,
112112
region,
113+
priority: overrideOptions.prioritySeconds,
113114
},
114115
},
115116
{

apps/webapp/app/v3/testTask.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ export const RunOptionsData = z.object({
4646
message: "Each tag must be at most 128 characters long",
4747
}),
4848
version: z.string().optional(),
49+
prioritySeconds: z
50+
.number()
51+
.min(0)
52+
.optional()
53+
.transform((val) => (val === 0 ? undefined : val)),
4954
});
5055

5156
export type RunOptionsData = z.infer<typeof RunOptionsData>;

0 commit comments

Comments
 (0)