Skip to content

DocumentAIProcessor: Migrate KMSCryptoKeyRef to kmsv1beta1 and normalize references - #13637

Open
lovelace-coder-bot wants to merge 1 commit into
GoogleCloudPlatform:masterfrom
lovelace-coder-bot:issue-13612-1790897493
Open

lovelace-coder-bot wants to merge 1 commit into
GoogleCloudPlatform:masterfrom
lovelace-coder-bot:issue-13612-1790897493

Conversation

@lovelace-coder-bot

Copy link
Copy Markdown
Collaborator

Overview

This PR migrates the KMS key reference in DocumentAIProcessor (documentai.cnrm.cloud.google.com/v1alpha1) from legacy refs.KMSCryptoKeyRef to typed kmsv1beta1.KMSCryptoKeyRef, and ensures references are normalized during reconciliation in the direct controller.

Key Changes

  1. API Types:
    • In apis/documentai/v1alpha1/documentaiprocessor_types.go, changed spec.kmsKeyRef to *kmsv1beta1.KMSCryptoKeyRef (which implements refs.Ref).
    • Regenerated CRD manifests and deepcopy methods.
  2. Direct Controller:
    • In pkg/controller/direct/documentai/documentaiprocessor_controller.go, invoked common.NormalizeReferences(ctx, reader, obj, nil) in AdapterForObject.
    • Added custom mapping functions in pkg/controller/direct/documentai/documentaiprocessor_mappings.go to handle KmsKeyRef to kms_key_name translation between KRM and Proto.
    • Updated DocumentAIProcessorFuzzer in documentaiprocessor_fuzzer.go to cover .kms_key_name.
  3. Tests:
    • Added unit tests in pkg/controller/direct/documentai/documentaiprocessor_test.go verifying KMS key reference proto mapping and reference normalization.
    • Verified that fuzz round-trip tests and existing fixtures pass.

Fixes #13612

NONE

This PR was generated by the overseer agent (powered by the gemini-3.7-flash model).

…ences

Migrate KMS key reference in DocumentAIProcessor from legacy refs.KMSCryptoKeyRef
to typed kmsv1beta1.KMSCryptoKeyRef.
Invoke common.NormalizeReferences in DocumentAIProcessor direct controller
to resolve references before reconciliation.
Add custom mappings for KmsKeyRef and update fuzzer and tests.

Issue: 13612
@argus-watcher-bot

Copy link
Copy Markdown
Collaborator

🤖 AI Factory started investigating CI check failures for this pull request.

Note: We recommend waiting for the 'ready-for-human' label before leaving review comments. Comments added while the system is actively working may be associated with outdated commits once a new commit is pushed, causing them to be ignored.

@lovelace-coder-bot

Copy link
Copy Markdown
Collaborator Author

Investigating fuzz-roundtrippers-2-of-8 failure

Run: 36952492186
Name: fuzz-roundtrippers-2-of-8
Cause: Flake / Infrastructure
Details: The job failed at the end of the 150-second fuzzing period with --- FAIL: FuzzAllMappers (150.12s) context deadline exceeded when Go's test runner cancelled in-flight worker execution upon reaching -fuzztime 150s. All mapper fuzzer round-trip tests and unit tests for DocumentAIProcessor pass cleanly locally.
Action Taken: Rerun triggered for failed workflow jobs via GitHub Actions CLI (gh run rerun 36952492186 --failed).

Investigating presubmit-gatekeeper failure

Run: 36952492186
Name: presubmit-gatekeeper
Cause: Flake / Infrastructure
Details: Failed as a cascading dependency of the fuzz-roundtrippers-2-of-8 failure.
Action Taken: Rerun triggered via parent workflow.

(This report was generated by overseer)

@anhdle-sso anhdle-sso left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

/lgtm

@google-oss-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: anhdle-sso
Once this PR has been reviewed and has the lgtm label, please assign anfernee for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@anhdle-sso
anhdle-sso added this pull request to the merge queue Oct 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 2, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment