Skip to content

Commit 03f13a7

Browse files
authored
Merge branch 'main' into feat/tri-6733-reset-an-idempotencykey
2 parents 0210604 + 28a66ac commit 03f13a7

File tree

42 files changed

+487
-343
lines changed

Some content is hidden

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

42 files changed

+487
-343
lines changed

.changeset/fluffy-weeks-sleep.md

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

.changeset/fuzzy-ghosts-admire.md

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

.changeset/great-pillows-look.md

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

.changeset/ninety-cougars-remember.md

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

.github/workflows/typecheck.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ jobs:
3535

3636
- name: 🔎 Type check
3737
run: pnpm run typecheck
38+
env:
39+
NODE_OPTIONS: --max-old-space-size=8192
3840

3941
- name: 🔎 Check exports
4042
run: pnpm run check-exports

apps/supervisor/src/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,12 @@ class ManagedSupervisor {
244244
}
245245

246246
try {
247+
if (!message.deployment.friendlyId) {
248+
// mostly a type guard, deployments always exists for deployed environments
249+
// a proper fix would be to use a discriminated union schema to differentiate between dequeued runs in dev and in deployed environments.
250+
throw new Error("Deployment is missing");
251+
}
252+
247253
await this.workloadManager.create({
248254
dequeuedAt: message.dequeuedAt,
249255
envId: message.environment.id,
@@ -252,6 +258,8 @@ class ManagedSupervisor {
252258
machine: message.run.machine,
253259
orgId: message.organization.id,
254260
projectId: message.project.id,
261+
deploymentFriendlyId: message.deployment.friendlyId,
262+
deploymentVersion: message.backgroundWorker.version,
255263
runId: message.run.id,
256264
runFriendlyId: message.run.friendlyId,
257265
version: message.version,

apps/supervisor/src/workloadManager/docker.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ export class DockerWorkloadManager implements WorkloadManager {
7272
`TRIGGER_DEQUEUED_AT_MS=${opts.dequeuedAt.getTime()}`,
7373
`TRIGGER_POD_SCHEDULED_AT_MS=${Date.now()}`,
7474
`TRIGGER_ENV_ID=${opts.envId}`,
75+
`TRIGGER_DEPLOYMENT_ID=${opts.deploymentFriendlyId}`,
76+
`TRIGGER_DEPLOYMENT_VERSION=${opts.deploymentVersion}`,
7577
`TRIGGER_RUN_ID=${opts.runFriendlyId}`,
7678
`TRIGGER_SNAPSHOT_ID=${opts.snapshotFriendlyId}`,
7779
`TRIGGER_SUPERVISOR_API_PROTOCOL=${this.opts.workloadApiProtocol}`,

apps/supervisor/src/workloadManager/kubernetes.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,14 @@ export class KubernetesWorkloadManager implements WorkloadManager {
123123
name: "TRIGGER_ENV_ID",
124124
value: opts.envId,
125125
},
126+
{
127+
name: "TRIGGER_DEPLOYMENT_ID",
128+
value: opts.deploymentFriendlyId,
129+
},
130+
{
131+
name: "TRIGGER_DEPLOYMENT_VERSION",
132+
value: opts.deploymentVersion,
133+
},
126134
{
127135
name: "TRIGGER_SNAPSHOT_ID",
128136
value: opts.snapshotFriendlyId,

apps/supervisor/src/workloadManager/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ export interface WorkloadManagerCreateOptions {
2929
envType: EnvironmentType;
3030
orgId: string;
3131
projectId: string;
32+
deploymentFriendlyId: string;
33+
deploymentVersion: string;
3234
runId: string;
3335
runFriendlyId: string;
3436
snapshotId: string;

apps/webapp/app/components/primitives/Buttons.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ export const Button = forwardRef<HTMLButtonElement, ButtonPropsType>(
331331
type LinkPropsType = Pick<
332332
LinkProps,
333333
"to" | "target" | "onClick" | "onMouseDown" | "onMouseEnter" | "onMouseLeave" | "download"
334-
> & { disabled?: boolean } & React.ComponentProps<typeof ButtonContent>;
334+
> & { disabled?: boolean; replace?: boolean } & React.ComponentProps<typeof ButtonContent>;
335335
export const LinkButton = ({
336336
to,
337337
onClick,
@@ -340,6 +340,7 @@ export const LinkButton = ({
340340
onMouseLeave,
341341
download,
342342
disabled = false,
343+
replace,
343344
...props
344345
}: LinkPropsType) => {
345346
const innerRef = useRef<HTMLAnchorElement>(null);
@@ -387,6 +388,7 @@ export const LinkButton = ({
387388
<Link
388389
to={to}
389390
ref={innerRef}
391+
replace={replace}
390392
className={cn("group/button block focus-custom", props.fullWidth ? "w-full" : "")}
391393
onClick={onClick}
392394
onMouseDown={onMouseDown}

0 commit comments

Comments
 (0)