Skip to content

Make TRIGGER_REALTIME_STREAM_VERSION overridable by the project env vars #1543

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

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -662,12 +662,25 @@ export async function resolveVariablesForEnvironment(runtimeEnvironment: Runtime
runtimeEnvironment.id
);

const overridableTriggerVariables = await resolveOverridableTriggerVariables(runtimeEnvironment);

const builtInVariables =
runtimeEnvironment.type === "DEVELOPMENT"
? await resolveBuiltInDevVariables(runtimeEnvironment)
: await resolveBuiltInProdVariables(runtimeEnvironment);

return [...projectSecrets, ...builtInVariables];
return [...overridableTriggerVariables, ...projectSecrets, ...builtInVariables];
}

async function resolveOverridableTriggerVariables(runtimeEnvironment: RuntimeEnvironment) {
let result: Array<EnvironmentVariable> = [
{
key: "TRIGGER_REALTIME_STREAM_VERSION",
value: env.REALTIME_STREAM_VERSION,
},
];

return result;
}

async function resolveBuiltInDevVariables(runtimeEnvironment: RuntimeEnvironment) {
Expand All @@ -684,10 +697,6 @@ async function resolveBuiltInDevVariables(runtimeEnvironment: RuntimeEnvironment
key: "TRIGGER_STREAM_URL",
value: env.STREAM_ORIGIN ?? env.API_ORIGIN ?? env.APP_ORIGIN,
},
{
key: "TRIGGER_REALTIME_STREAM_VERSION",
value: env.REALTIME_STREAM_VERSION,
},
];

if (env.DEV_OTEL_BATCH_PROCESSING_ENABLED === "1") {
Expand Down Expand Up @@ -758,10 +767,6 @@ async function resolveBuiltInProdVariables(runtimeEnvironment: RuntimeEnvironmen
key: "TRIGGER_ORG_ID",
value: runtimeEnvironment.organizationId,
},
{
key: "TRIGGER_REALTIME_STREAM_VERSION",
value: env.REALTIME_STREAM_VERSION,
},
];

if (env.PROD_OTEL_BATCH_PROCESSING_ENABLED === "1") {
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/v3/runMetadata/metadataStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export class MetadataStream<T> {
private initializeServerStream(): Promise<void | Response> {
const serverIterator = this.serverIterator;

// TODO: Why is this only sending stuff to the server at the end of the run?
const serverStream = new ReadableStream({
async pull(controller) {
try {
Expand Down
Loading