Skip to content

feat(cai): report determinate progress and scanned resource counts during CAI fetching - #1035

Merged
kyasbal merged 1 commit into
GoogleCloudPlatform:mainfrom
kyasbal:push-umtvupuwotxs
Sep 24, 2026
Merged

kyasbal merged 1 commit into
GoogleCloudPlatform:mainfrom
kyasbal:push-umtvupuwotxs

Conversation

@kyasbal

@kyasbal kyasbal commented Sep 24, 2026

Copy link
Copy Markdown
Member

Summary

  • Add CAISearchProgressCallback to CAIFetcher.SearchResources so that iterator scans report live cumulative resource counts on each it.Next() step.
  • Track parent counts per query chunk in BuildCAIParentSearchQueries (CAIParentSearchQuery) and enhance SearchCAIAssetsByParents with CAIParentSearchProgressConfig to report determinate progress (X/Y namespaces, Z resources scanned) when parent units are known, or indeterminate progress with a live scanned counter (Z resources scanned).
  • Update BatchGetAssetsHistory to report determinate progress by asset count (X/Y assets, Z snapshots (rate, ETA)) rather than internal chunk indices.
  • Report 2-step determinate progress ([1/2] cluster, [2/2] nodepools) with live scanned counters in discoverGKEResourceAssetNames.
  • Add determinate progress.ForEach tracking to newCAIRawLogTask and ExtractCAIActiveAssetStates.
@kyasbal kyasbal added the type:feature New feature or request label Sep 24, 2026
@kyasbal
kyasbal requested a review from RyuSA as a code owner September 24, 2026 03:53
@kyasbal kyasbal added the area:backend-parser Log parsers and log timeline mapper tasks label Sep 24, 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 progress reporting for Cloud Asset Inventory (CAI) searches and asset history fetching. It introduces a CAISearchProgressCallback to report progress dynamically during resource searches, updates the CAIFetcher interface and its implementations to support this callback, and replaces indeterminate progress reporting with more detailed, determinate progress tracking where possible. Additionally, it updates the ExtractCAIActiveAssetStates function to accept a context.Context to enable progress tracking during log filtering, and updates all corresponding tests to align with these signature changes. All review comments have been filtered out as they incorrectly assumed ExtractCAIActiveAssetStates returns an error, so I have no feedback to provide.

@kyasbal
kyasbal enabled auto-merge September 24, 2026 03:58
@kyasbal
kyasbal added this pull request to the merge queue Sep 24, 2026
Merged via the queue into GoogleCloudPlatform:main with commit 1996fd8 Sep 24, 2026
17 checks passed
@kyasbal
kyasbal deleted the push-umtvupuwotxs branch September 24, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:backend-parser Log parsers and log timeline mapper tasks type:feature New feature or request

1 participant