Skip to content

Commit 81932bc

Browse files
committed
Replay now supports branches
1 parent 236f3ff commit 81932bc

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,12 @@ function ReplayForm({
131131
dropdownIcon
132132
variant="tertiary/medium"
133133
className="w-fit pl-1"
134+
filter={{
135+
keys: [
136+
(item) => item.type.replace(/\//g, " ").replace(/_/g, " "),
137+
(item) => item.branchName?.replace(/\//g, " ").replace(/_/g, " ") ?? "",
138+
],
139+
}}
134140
text={(value) => {
135141
const env = environments.find((env) => env.id === value)!;
136142
return (

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,15 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
3232
id: true,
3333
type: true,
3434
slug: true,
35+
branchName: true,
3536
orgMember: {
3637
select: {
3738
user: true,
3839
},
3940
},
4041
},
4142
where: {
43+
archivedAt: null,
4244
OR: [
4345
{
4446
type: {
@@ -72,10 +74,21 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
7274
return typedjson({
7375
payload: await prettyPrintPacket(run.payload, run.payloadType),
7476
payloadType: run.payloadType,
75-
environment: displayableEnvironment(environment, userId),
77+
environment: {
78+
...displayableEnvironment(environment, userId),
79+
branchName: environment.branchName ?? undefined,
80+
},
7681
environments: sortEnvironments(
77-
run.project.environments.map((environment) => displayableEnvironment(environment, userId))
78-
),
82+
run.project.environments.map((environment) => {
83+
return {
84+
...displayableEnvironment(environment, userId),
85+
branchName: environment.branchName ?? undefined,
86+
};
87+
})
88+
).filter((env) => {
89+
if (env.type === "PREVIEW" && !env.branchName) return false;
90+
return true;
91+
}),
7992
});
8093
}
8194

0 commit comments

Comments
 (0)