Skip to content

fix(composer): inject APIClientFactory and CallOptionsInjector into EnvironmentClusterFinderImpl - #1015

Merged
kyasbal merged 2 commits into
GoogleCloudPlatform:mainfrom
kyasbal:push-kuwoolzuvkln
Sep 16, 2026
Merged

kyasbal merged 2 commits into
GoogleCloudPlatform:mainfrom
kyasbal:push-kuwoolzuvkln

Conversation

@kyasbal

@kyasbal kyasbal commented Sep 16, 2026

Copy link
Copy Markdown
Member

Summary

Fixes an undeclared task dependency panic in AutocompleteComposerClusterNamesTask when autocompleting GKE cluster names for Cloud Composer environments.

Cause

EnvironmentClusterFinderImpl.GetGKEClusterNames previously invoked coretask.GetTaskResult directly on the caller's ctx to retrieve APIClientFactoryTaskID and APIClientCallOptionsInjectorTaskID. When invoked from AutocompleteComposerClusterNamesTask, which does not declare those dependencies in its task dependency list, KHI's runtime dependency verifier triggered a panic (undeclared task dependency access: ref:cloud.google.com/common/api-client-factory).

Solution

  • Declare both APIClientFactoryTaskID and APIClientCallOptionsInjectorTaskID on ComposerEnvironmentClusterFinderTask in pkg/task/inspection/googlecloud/cluster/composer/impl/inject.go.
  • Inject *googlecloud.ClientFactory and *googlecloud.CallOptionInjector into EnvironmentClusterFinderImpl via NewEnvironmentClusterFinder at construction time instead of resolving them from the caller's execution context.
@kyasbal kyasbal added type:bug Something isn't working as expected area:backend-core Core backend frameworks, DAG task runner, and server API labels Sep 16, 2026
@kyasbal
kyasbal requested a review from RyuSA as a code owner September 16, 2026 10:03
@kyasbal kyasbal added the area:backend-parser Log parsers and log timeline mapper tasks label Sep 16, 2026

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

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.

Code Review

This pull request refactors EnvironmentClusterFinderImpl to accept its dependencies (ClientFactory and CallOptionsInjector) via a constructor instead of retrieving them from the context, updating the dependency injection configuration accordingly. The review feedback points out a duplicate interface implementation assertion in environment_cluster_finder.go that should be removed.

@kyasbal
kyasbal added this pull request to the merge queue Sep 16, 2026
Merged via the queue into GoogleCloudPlatform:main with commit 15d0e8b Sep 16, 2026
17 checks passed
@kyasbal
kyasbal deleted the push-kuwoolzuvkln branch September 16, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:backend-core Core backend frameworks, DAG task runner, and server API area:backend-parser Log parsers and log timeline mapper tasks type:bug Something isn't working as expected

1 participant