Repository navigation
feat(cai): report determinate progress and scanned resource counts during CAI fetching - #1035
Conversation
…ring CAI fetching
There was a problem hiding this comment.
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.
1996fd8
Summary
CAISearchProgressCallbacktoCAIFetcher.SearchResourcesso that iterator scans report live cumulative resource counts on eachit.Next()step.BuildCAIParentSearchQueries(CAIParentSearchQuery) and enhanceSearchCAIAssetsByParentswithCAIParentSearchProgressConfigto 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).BatchGetAssetsHistoryto report determinate progress by asset count (X/Y assets, Z snapshots (rate, ETA)) rather than internal chunk indices.[1/2]cluster,[2/2]nodepools) with live scanned counters indiscoverGKEResourceAssetNames.progress.ForEachtracking tonewCAIRawLogTaskandExtractCAIActiveAssetStates.