Skip to content

Commit 831f54f

Browse files
Preslav LeConvex, Inc.
Preslav Le
authored and
Convex, Inc.
committed
Rename requestId to executionContext in json (#23879)
Rename the name of the field in the json seriealization. Make the change forwards/backwards compatible. GitOrigin-RevId: fdcf8e4d9232306ef8fe54896afa0565baa28c35
1 parent 54dd497 commit 831f54f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

crates/node_executor/src/executor.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -519,10 +519,9 @@ impl TryFrom<ExecutorRequest> for JsonValue {
519519
"userIdentity": r.user_identity.map(JsonValue::try_from).transpose()?,
520520
"environmentVariables": JsonValue::Array(environment_variables),
521521
"npmVersion": npm_version.map(|v| v.to_string()),
522-
// TODO(CX-5733): Migrate and remove.
523-
"parentScheduledJob": r.context.parent_scheduled_job.map(|id| id.to_string()),
524-
// TODO(presley): Rename this to executionContext
525-
"requestContext": JsonValue::from(r.context),
522+
// TODO(presley): Remove `requestContext` after a backend push.
523+
"requestContext": JsonValue::from(r.context.clone()),
524+
"executionContext": JsonValue::from(r.context),
526525
})
527526
},
528527
ExecutorRequest::Analyze(r) => {

npm-packages/node-executor/src/executor.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,9 @@ export type ExecuteRequest = {
116116
environmentVariables: EnvironmentVariable[];
117117
timeoutSecs: number;
118118
npmVersion: string | null;
119-
// TODO(presley): Rename this to executionContext
119+
// TODO(presley): Remove requestContext and make executionContext non-optional.
120120
requestContext: ExecutionContext;
121+
executionContext: ExecutionContext | null;
121122
};
122123

123124
export type ExecutionContext = {
@@ -182,7 +183,7 @@ export async function execute(
182183
request.backendCallbackToken,
183184
request.authHeader,
184185
request.userIdentity,
185-
request.requestContext,
186+
request.executionContext ?? request.requestContext,
186187
);
187188

188189
let innerResult: ExecuteResponseInner;

0 commit comments

Comments
 (0)