Skip to content

adding support for Managed airflow audit log - #878

Merged
kyasbal merged 1 commit into
GoogleCloudPlatform:mainfrom
kyasbal:push-ukzsqlonryzt
Aug 10, 2026
Merged

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

Conversation

@kyasbal

@kyasbal kyasbal commented Aug 10, 2026 •

Copy link
Copy Markdown
Member

Summary

This PR adds support for Cloud Composer (composer.googleapis.com) API audit logs to KHI, allowing users to inspect environment-level operations and lifecycle transitions directly on the timeline.

Key Changes

  1. New Inspection Package (googlecloudlogcomposerapiaudit):
    • FieldSet Reader: Implemented ComposerAuditLogResourceFieldSet (fieldset.go) to extract environment_name, location, and project_id from resource.labels.
    • Log Type & Task Definitions: Registered LogTypeManagedAirflowAPI (log_type.go) and task IDs.
    • Query Generation: Created query generator task filtering log_id("cloudaudit.googleapis.com/activity") and serviceName="composer.googleapis.com" (query_task.go).
    • Ingester & Timeline Mapper: Added LogIngesterTask and LogToTimelineMapperTask (parser_tasks.go) to map audit logs to operations and environment lifecycle revisions.
    • Task Registration: Registered under the product: composer inspection selector (registration.go).
  2. Timeline Structure & Hierarchy:
    • Registered TimelineTypeManagedAirflowEnvironment (Managed Airflow) under GCP Project in googlecloudcommon (timeline_type.go).
    • Implemented MustManagedAirflowEnvironmentTimeline(ctx, projectPath, environmentName) (timeline.go).
    • Kept internal Airflow components (Scheduler, Worker, DAGs, Task Instances) timelines as root-level timelines.
  3. Lifecycle Revision States:
    • Added RevisionStateManagedAirflowEnvironment* states matching GKE cluster/nodepool styling, labels, and icons in revision_state.go:
      • CreateEnvironment: Environment is being provisioned ➔ Environment exists (with Log Not Found fallback).
      • DeleteEnvironment: Environment is being deleted ➔ Environment is deleted (with Log Not Found fallback).
  4. Common GCP Contract Enhancements:
    • Added principalSubject fallback in GCPOperationAuditLogFieldSetReader (fieldset.go) to support Workload Identity Service Accounts where principalEmail is empty.
    • Added MarkStarted(operationID string) helper in GCPOperationTracker (operation_tracker.go).

Verification

  • make build-go: Passed.
  • make test-go: All backend tests passed.
  • make lint-go: Passed with 0 issues.
  • make pre-commit: All format and lint checks passed.

@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 introduces support for Cloud Composer API audit logs, enabling the visualization of environment operations such as creation, update, and deletion on timelines. It defines new revision states, timeline types, and field set readers, and implements tasks for querying, ingesting, grouping, and mapping these logs, supported by comprehensive unit tests. The review feedback recommends replacing hex color notations (style.MustForceConvertSRGBHex) with style.Color raw values in revision_state.go and log_type.go to comply with KHI's color space standards.

@kyasbal
kyasbal force-pushed the push-ukzsqlonryzt branch from d66b2eb to 76caaa1 Compare August 10, 2026 05:01
@kyasbal kyasbal added the type:feature New feature or request label Aug 10, 2026
@kyasbal
kyasbal marked this pull request as ready for review August 10, 2026 05:09
@kyasbal
kyasbal merged commit f4e03ca into GoogleCloudPlatform:main Aug 10, 2026
16 checks passed
@kyasbal
kyasbal deleted the push-ukzsqlonryzt branch August 10, 2026 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature New feature or request

1 participant