-
-
Notifications
You must be signed in to change notification settings - Fork 642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run Engine 2.0 (alpha) #1575
base: main
Are you sure you want to change the base?
Run Engine 2.0 (alpha) #1575
Changes from 250 commits
e4cb7fd
7f7644f
7c0befe
33fbc2e
51c4434
d203c3e
1bf37c9
5747417
a2dd5e3
12f4fbb
766c4ac
f6208de
0799938
77b7d0f
04dc85f
808a6f9
c71ac30
6c3c9f0
81188eb
5e2f70a
e3d729c
f6047d5
862339a
31993c4
a9db8c3
4f3c51d
683ceb4
8f87206
4d5f9c0
5423968
3276d2b
dc3a2c1
b3d42d6
65f471c
f084df1
9003b18
d11612e
99a33e8
ac7076b
66edfe2
f25a971
26a72dd
ffcd387
9187996
da74e88
768fc9b
66a0ff9
d95a750
a06e270
78a3d35
5da5a61
bb824df
0a605b6
68a7e33
3058cdd
3070a9d
5a79e10
a73a3eb
515641e
3e26ea4
ff20023
a1b545b
bed6677
8973ccb
6a91584
676496a
0631b22
f595ae4
f1b4861
7913e39
1cc0284
cd0347f
b42db7b
d9db268
b9c9c75
71f04cf
3fe3c39
2635c58
fb6c33d
7653c22
ff369f3
fcb4e3b
fd58ce6
d7a9e2b
b95dd63
d434746
eb69641
8262320
05b7e30
a6d5ec4
d4a638e
4d41221
d707a94
3cee74c
b4739b7
c9a51f1
9da544e
ff79a77
03c9899
c84b506
160e219
086c1bf
e1177f7
b57e913
ab9e268
872cea3
93d2501
f572c0f
fb56932
e01288d
4c9e024
f020acf
f1e2736
fb433de
1238ef7
2490882
a24644b
3df8158
677a2d6
62c03bf
0b37539
da41728
d3a3951
476b20f
e155aad
23e8d37
fb5b2e7
f94154a
23f3400
5f07ff2
46c79e0
accf9f7
0b0b7da
fa8bfc9
958c439
c8f460e
082644e
95a7155
610c95f
b1604fb
079bd5c
14250d5
56979e6
ae6a473
482a98d
d3386e2
7d382ac
a759bf7
927edea
3d21147
4f954b2
3d4068a
0642c9c
fdf0bf6
d6e8743
9d24fc1
446a94f
ca82d75
3c67350
f961a75
3e2687e
45a829e
a254602
bc38276
1d6fb48
a76ef98
5cf7c52
994ac3e
70abb63
f319d3a
74dd91f
8704e77
4f8ce0b
b8cb8dc
b12b617
c8b835a
e742e8b
e942c04
68813bb
a37b528
46e0698
41cfaa4
6ff1893
35ab2bd
05c0ee9
6b8bd66
8aa07e7
9da8029
5f95a7b
54d297f
7733a72
e936cea
39fa134
5002ad8
3e21ad5
acdb65a
b9b1679
b77a8d3
87bbeac
d88310a
76d4cb0
40223c0
45d1b12
57be5d0
88b30d7
9bc223a
06db938
dbfa1bd
de05bda
e1ad2c1
426259a
f85d8ee
4744ba0
bd7479b
d89d5f1
a8a3b20
117bc4d
66d392c
8317e80
da0d4a0
b7e3801
8144140
323cfce
adeb113
881986c
19693fa
84c590b
8da1e6b
864fa1b
2580b3a
eee6a4d
837ba73
d995cf0
6a5f228
684b72b
f016857
ef970cd
b7f4959
5cb706c
b19498c
1d882d7
cb24953
87e8e89
a0216b9
4e27563
a2f36b6
6bfc246
d8e4c43
6088c27
8ec03c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
"@trigger.dev/react-hooks": patch | ||
"@trigger.dev/sdk": patch | ||
"trigger.dev": patch | ||
"@trigger.dev/build": patch | ||
"@trigger.dev/core": patch | ||
"@trigger.dev/rsc": patch | ||
--- | ||
|
||
Run Engine 2.0 (alpha) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
link-workspace-packages=false | ||
public-hoist-pattern[]=*prisma* | ||
prefer-workspace-packages=true | ||
prefer-workspace-packages=true | ||
update-notifier=false |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
export function TaskCachedIcon({ className }: { className?: string }) { | ||
return ( | ||
<svg | ||
className={className} | ||
width="16" | ||
height="16" | ||
viewBox="0 0 16 16" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<g clipPath="url(#clip0_15584_76102)"> | ||
<path | ||
d="M0.5 3.5L0.5 2.5C0.5 1.39543 1.39543 0.5 2.5 0.5H3.5" | ||
stroke="#3B82F6" | ||
strokeLinecap="square" | ||
strokeLinejoin="round" | ||
/> | ||
<path | ||
d="M15.5 12.5L15.5 13.5C15.5 14.6046 14.6046 15.5 13.5 15.5L12.5 15.5" | ||
stroke="#3B82F6" | ||
strokeLinecap="square" | ||
strokeLinejoin="round" | ||
/> | ||
<path | ||
d="M12.5 0.5L13.5 0.5C14.6046 0.5 15.5 1.39543 15.5 2.5L15.5 3.5" | ||
stroke="#3B82F6" | ||
strokeLinecap="square" | ||
strokeLinejoin="round" | ||
/> | ||
<path | ||
d="M3.5 15.5L2.5 15.5C1.39543 15.5 0.5 14.6046 0.5 13.5L0.5 12.5" | ||
stroke="#3B82F6" | ||
strokeLinecap="square" | ||
strokeLinejoin="round" | ||
/> | ||
<path d="M11.1799 4.19V5.598H8.8479V12H7.1649V5.598H4.8219V4.19H11.1799Z" fill="#3B82F6" /> | ||
<line x1="6" y1="15.5" x2="10" y2="15.5" stroke="#3B82F6" /> | ||
<line x1="6" y1="0.5" x2="10" y2="0.5" stroke="#3B82F6" /> | ||
<line x1="15.5" y1="6" x2="15.5" y2="10" stroke="#3B82F6" /> | ||
<line x1="0.5" y1="6" x2="0.5" y2="10" stroke="#3B82F6" /> | ||
</g> | ||
<defs> | ||
<clipPath id="clip0_15584_76102"> | ||
<rect width="16" height="16" fill="white" /> | ||
</clipPath> | ||
</defs> | ||
</svg> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -3,6 +3,7 @@ | |||||||||||||||||||||||||||||||||||||||||||||||
import * as React from "react"; | ||||||||||||||||||||||||||||||||||||||||||||||||
import * as SwitchPrimitives from "@radix-ui/react-switch"; | ||||||||||||||||||||||||||||||||||||||||||||||||
import { cn } from "~/utils/cn"; | ||||||||||||||||||||||||||||||||||||||||||||||||
import { ShortcutDefinition, useShortcutKeys } from "~/hooks/useShortcutKeys"; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
const variations = { | ||||||||||||||||||||||||||||||||||||||||||||||||
large: { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -23,14 +24,34 @@ const variations = { | |||||||||||||||||||||||||||||||||||||||||||||||
type SwitchProps = React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root> & { | ||||||||||||||||||||||||||||||||||||||||||||||||
label?: React.ReactNode; | ||||||||||||||||||||||||||||||||||||||||||||||||
variant: keyof typeof variations; | ||||||||||||||||||||||||||||||||||||||||||||||||
shortcut?: ShortcutDefinition; | ||||||||||||||||||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
export const Switch = React.forwardRef<React.ElementRef<typeof SwitchPrimitives.Root>, SwitchProps>( | ||||||||||||||||||||||||||||||||||||||||||||||||
({ className, variant, label, ...props }, ref) => { | ||||||||||||||||||||||||||||||||||||||||||||||||
const innerRef = React.useRef<HTMLButtonElement>(null); | ||||||||||||||||||||||||||||||||||||||||||||||||
React.useImperativeHandle(ref, () => innerRef.current as HTMLButtonElement); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
const { container, root, thumb, text } = variations[variant]; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
if (props.shortcut) { | ||||||||||||||||||||||||||||||||||||||||||||||||
useShortcutKeys({ | ||||||||||||||||||||||||||||||||||||||||||||||||
shortcut: props.shortcut, | ||||||||||||||||||||||||||||||||||||||||||||||||
action: () => { | ||||||||||||||||||||||||||||||||||||||||||||||||
if (innerRef.current) { | ||||||||||||||||||||||||||||||||||||||||||||||||
innerRef.current.click(); | ||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||
disabled: props.disabled, | ||||||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+37
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move shortcut action outside render function and avoid conditional hook. The current implementation has two issues:
Apply this diff to fix both issues: + const handleShortcutAction = React.useCallback(() => {
+ if (innerRef.current) {
+ innerRef.current.click();
+ }
+ }, []);
+
+ useShortcutKeys({
+ shortcut: props.shortcut,
+ action: handleShortcutAction,
+ disabled: props.disabled,
+ enabled: !!props.shortcut,
+ });
- if (props.shortcut) {
- useShortcutKeys({
- shortcut: props.shortcut,
- action: () => {
- if (innerRef.current) {
- innerRef.current.click();
- }
- },
- disabled: props.disabled,
- });
- } 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
return ( | ||||||||||||||||||||||||||||||||||||||||||||||||
<SwitchPrimitives.Root className={cn("group", container, className)} {...props} ref={ref}> | ||||||||||||||||||||||||||||||||||||||||||||||||
<SwitchPrimitives.Root | ||||||||||||||||||||||||||||||||||||||||||||||||
className={cn("group", container, className)} | ||||||||||||||||||||||||||||||||||||||||||||||||
{...props} | ||||||||||||||||||||||||||||||||||||||||||||||||
ref={innerRef} | ||||||||||||||||||||||||||||||||||||||||||||||||
> | ||||||||||||||||||||||||||||||||||||||||||||||||
{label ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||
<label className={cn("whitespace-nowrap", text)}> | ||||||||||||||||||||||||||||||||||||||||||||||||
{typeof label === "string" ? <span>{label}</span> : label} | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -359,8 +359,8 @@ function BatchIdDropdown({ | |
if (batchId) { | ||
if (!batchId.startsWith("batch_")) { | ||
error = "Batch IDs start with 'batch_'"; | ||
} else if (batchId.length !== 27) { | ||
error = "Batch IDs are 27 characters long"; | ||
} else if (batchId.length !== 27 && batchId.length !== 31) { | ||
error = "Batch IDs are 27/32 characters long"; | ||
Comment on lines
+362
to
+363
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainInconsistency in batch ID length validation. The error message states "27/32 characters" but the validation checks for "27/31 characters". This mismatch could confuse users. Apply this diff to fix the error message: - error = "Batch IDs are 27/32 characters long";
+ error = "Batch IDs are 27/31 characters long"; Additionally, there's an inconsistency with the validation in Run the following script to verify the batch ID validation across the codebase: 🏁 Script executed: #!/bin/bash
# Description: Search for batch ID validation logic to ensure consistency.
# Test: Search for batch ID length validation. Expect: Only occurrences of the new validation.
rg -A 5 'batch.*length.*27' Length of output: 896 Batch ID Validation Inconsistency Found
|
||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -763,8 +763,8 @@ function RunIdDropdown({ | |||||||||
if (runId) { | ||||||||||
if (!runId.startsWith("run_")) { | ||||||||||
error = "Run IDs start with 'run_'"; | ||||||||||
} else if (runId.length !== 25) { | ||||||||||
error = "Run IDs are 25 characters long"; | ||||||||||
} else if (runId.length !== 25 && runId.length !== 29) { | ||||||||||
error = "Run IDs are 25/30 characters long"; | ||||||||||
Comment on lines
+766
to
+767
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistency in run ID length error message. The error message states "25/30 characters" but the validation checks for "25/29 characters". This mismatch could confuse users. Apply this diff to fix the error message: - error = "Run IDs are 25/30 characters long";
+ error = "Run IDs are 25/29 characters long"; 📝 Committable suggestion
Suggested change
|
||||||||||
} | ||||||||||
} | ||||||||||
|
||||||||||
|
Check warning
Code scanning / CodeQL
Unpinned tag for a non-immutable Action in workflow Medium