Skip to content

Conversation

@utkarsh-goel-google
Copy link
Contributor

@utkarsh-goel-google utkarsh-goel-google commented Oct 14, 2025

Description

This pull request introduces a new caching mechanism for Lineage Enablement and significantly refactors the existing cache implementation to
improve maintainability and reduce code duplication.

Key Changes:

  • New Lineage Enablement Cache:

    • A new cache has been added to handle PERMISSION_DENIED errors with LINEAGE_INGESTION_DISABLED reason that occur when Lineage is not enabled for a project and client.
    • This prevents repeated API calls to projects where Lineage ingestion is known to be disabled, improving client performance and reducing
      unnecessary network traffic.
    • Note: The Lineage ingestion enablement is controlled via Lineage Configurations per client.
  • Refactoring to a Generic Cache Model:

    • The duplicated logic between the original API Enablement Cache and the new Lineage Enablement Cache has been eliminated.
    • A single, generic ProjectStatusCache class has been created to handle the core caching logic using a composition-based design.
    • The specific cache implementations (StandardApiEnablementCache and StandardLineageEnablementCache) now act as simple, lightweight
      wrappers around this generic component.
  • Consolidated Cache Configuration:

    • The previous configuration classes (ApiEnablementCacheOptions, ApiEnablementCacheSettings) have been
      removed and replaced with two generic classes: CacheOptions and CacheSettings.
    • This centralizes all cache configuration, making the system cleaner and easier to manage. The original Api... classes were effectively renamed and generalized to Cache... to reflect their new, broader purpose.

@utkarsh-goel-google utkarsh-goel-google marked this pull request as ready for review October 16, 2025 09:08
@utkarsh-goel-google utkarsh-goel-google changed the title feat/lineage enablement cache feat: Add Lineage Enablement Cache Oct 16, 2025
Copy link
Collaborator

@KonstantinMi KonstantinMi left a comment

Choose a reason for hiding this comment

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

Looks good

@KonstantinMi KonstantinMi merged commit 304c0c7 into GoogleCloudPlatform:main Dec 1, 2025
2 checks passed
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.

4 participants