-
-
Notifications
You must be signed in to change notification settings - Fork 933
fix: inject environment variables at dequeue time for self-hosted deployments #2793
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
base: main
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
|
|
@@ -36,6 +36,11 @@ export function fromFriendlyId(friendlyId: string, expectedEntityName?: string): | |
|
|
||
| const parts = friendlyId.split("_"); | ||
|
|
||
| // If there's no underscore, assume it's already an internal ID | ||
| if (parts.length === 1) { | ||
| return friendlyId; | ||
| } | ||
|
Comment on lines
+39
to
+42
Contributor
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. Entity name validation is bypassed when input lacks an underscore. When For example: fromFriendlyId("someInternalId", "worker")
// Returns "someInternalId" without verifying it came from a "worker_" friendly IDIf callers rely on 🔎 Proposed fix to validate entity name before early return const parts = friendlyId.split("_");
// If there's no underscore, assume it's already an internal ID
if (parts.length === 1) {
+ if (expectedEntityName) {
+ throw new Error(
+ `Cannot validate entity name for internal ID without prefix. Expected: ${expectedEntityName}`
+ );
+ }
return friendlyId;
}Alternatively, if single-part inputs should always be accepted regardless of 🤖 Prompt for AI Agents |
||
|
|
||
| if (parts.length !== 2) { | ||
| throw new Error("Invalid friendly ID format"); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing
taskEventStoreparameter ingetEnvVarscall.The
getEnvVarsmethod expects an optionaltaskEventStoreparameter (line 582), which is used to setOTEL_RESOURCE_ATTRIBUTESfor observability (lines 599-610). ThestartRunAttemptmethod correctly passes this parameter (line 481), but the dequeue enrichment does not.Apply this diff to include the taskEventStore parameter:
const envVars = environment ? await this.getEnvVars( environment, message.run.id, message.run.machine ?? defaultMachinePreset, - environment.parentEnvironment ?? undefined + environment.parentEnvironment ?? undefined, + message.run.taskEventStore ?? undefined ) : {};📝 Committable suggestion
🤖 Prompt for AI Agents