Skip to content

chore: executor framework admin actions code#8093

Draft
alkatrivedi wants to merge 2 commits intomainfrom
executor-framework-admin-actions
Draft

chore: executor framework admin actions code#8093
alkatrivedi wants to merge 2 commits intomainfrom
executor-framework-admin-actions

Conversation

@alkatrivedi
Copy link
Copy Markdown
Contributor

No description provided.

@alkatrivedi alkatrivedi requested a review from a team as a code owner April 22, 2026 09:25
@alkatrivedi alkatrivedi marked this pull request as draft April 22, 2026 09:25
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements instance management functionality in the CloudClientExecutor, including update, delete, list, and get operations. Review feedback identifies a missing import for status, a logic error in the executeUpdateCloudInstance method where displayName was incorrectly assigned, and the hardcoding of nextPageToken which prevents proper pagination in executeListCloudInstances.

import * as protos from '../../protos/protos';
import {CloudUtil} from './cloud-util';
import {OutcomeSender, ExecutionFlowContextInterface} from './cloud-executor';
import {OutcomeSender, ExecutionFlowContextInterface, CloudExecutor} from './cloud-executor';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The code uses status.OK in several methods (lines 374, 409), but status is not imported in this file. It should be imported from @grpc/grpc-js to avoid a ReferenceError.

Suggested change
import {OutcomeSender, ExecutionFlowContextInterface, CloudExecutor} from './cloud-executor';
import {status} from '@grpc/grpc-js';
import {OutcomeSender, ExecutionFlowContextInterface, CloudExecutor} from './cloud-executor';

Comment on lines +307 to +308
displayName:
action.displayName !== undefined ? instanceId : undefined,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The displayName is incorrectly being set to instanceId when action.displayName is provided. It should be set to the value of action.displayName.

          displayName: action.displayName,

Comment on lines +364 to +381
const [instances] = await instanceAdminClient.listInstances({
parent: instanceAdminClient.projectPath(projectId),
filter: action.filter,
pageSize: action.pageSize,
pageToken: action.pageToken,
});

console.log(`Found ${instances.length} instances.`);

const outcome = SpannerActionOutcome.create({
status: CloudExecutor.toProto(status.OK),
adminResult: {
instanceResponse: {
listedInstances: instances,
nextPageToken: '',
},
},
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The nextPageToken from the listInstances response is currently ignored and hardcoded to an empty string, which breaks pagination for the executor framework.

Suggested change
const [instances] = await instanceAdminClient.listInstances({
parent: instanceAdminClient.projectPath(projectId),
filter: action.filter,
pageSize: action.pageSize,
pageToken: action.pageToken,
});
console.log(`Found ${instances.length} instances.`);
const outcome = SpannerActionOutcome.create({
status: CloudExecutor.toProto(status.OK),
adminResult: {
instanceResponse: {
listedInstances: instances,
nextPageToken: '',
},
},
});
const [instances, , response] = await instanceAdminClient.listInstances({
parent: instanceAdminClient.projectPath(projectId),
filter: action.filter,
pageSize: action.pageSize,
pageToken: action.pageToken,
});
console.log(`Found ${instances.length} instances.`);
const outcome = SpannerActionOutcome.create({
status: CloudExecutor.toProto(status.OK),
adminResult: {
instanceResponse: {
listedInstances: instances,
nextPageToken: response?.nextPageToken || '',
},
},
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant