Skip to content

Commit

Permalink
Rename requestId to executionContext in json (#23879)
Browse files Browse the repository at this point in the history
Rename the name of the field in the json seriealization. Make the change  forwards/backwards compatible.

GitOrigin-RevId: fdcf8e4d9232306ef8fe54896afa0565baa28c35
  • Loading branch information
Preslav Le authored and Convex, Inc. committed Mar 26, 2024
1 parent 54dd497 commit 831f54f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 3 additions & 4 deletions crates/node_executor/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,10 +519,9 @@ impl TryFrom<ExecutorRequest> for JsonValue {
"userIdentity": r.user_identity.map(JsonValue::try_from).transpose()?,
"environmentVariables": JsonValue::Array(environment_variables),
"npmVersion": npm_version.map(|v| v.to_string()),
// TODO(CX-5733): Migrate and remove.
"parentScheduledJob": r.context.parent_scheduled_job.map(|id| id.to_string()),
// TODO(presley): Rename this to executionContext
"requestContext": JsonValue::from(r.context),
// TODO(presley): Remove `requestContext` after a backend push.
"requestContext": JsonValue::from(r.context.clone()),
"executionContext": JsonValue::from(r.context),
})
},
ExecutorRequest::Analyze(r) => {
Expand Down
5 changes: 3 additions & 2 deletions npm-packages/node-executor/src/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ export type ExecuteRequest = {
environmentVariables: EnvironmentVariable[];
timeoutSecs: number;
npmVersion: string | null;
// TODO(presley): Rename this to executionContext
// TODO(presley): Remove requestContext and make executionContext non-optional.
requestContext: ExecutionContext;
executionContext: ExecutionContext | null;
};

export type ExecutionContext = {
Expand Down Expand Up @@ -182,7 +183,7 @@ export async function execute(
request.backendCallbackToken,
request.authHeader,
request.userIdentity,
request.requestContext,
request.executionContext ?? request.requestContext,
);

let innerResult: ExecuteResponseInner;
Expand Down

0 comments on commit 831f54f

Please sign in to comment.