reviewgen-greenfield-controller

Reviews pull requests adding controllers for KCC Greenfield resources against defined criteria.

1.1k|377|Updated Apr 8, 2019
One-click install
npx skills add https://github.com/GoogleCloudPlatform/k8s-config-connector --skill reviewgen-greenfield-controller
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: reviewgen-greenfield-controller
Source: https://github.com/GoogleCloudPlatform/k8s-config-connector/tree/main/.gemini/skills/reviewgen-greenfield-controller
Command: npx skills add https://github.com/GoogleCloudPlatform/k8s-config-connector --skill reviewgen-greenfield-controller

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reviewing pull requests that add new direct controllers for Config Connector Greenfield resources requires checking many invariants—proto diffing, LRO waits, status updates, test coverage—which reviewers can easily miss or apply inconsistently.

Core Features & Use Cases

  • Structured Review Criteria: Enforces six review dimensions including proto diff/field mask usage, structured reporting, mandatory KRM status updates, LRO waiting, test coverage, and GAPIC REST client creation.
  • Standardized Review Output: Produces a consistent pass/fail review comment template listing each criterion with detailed findings and required actions.
  • Use Case: When a contributor opens a PR adding a new direct controller (e.g., for a GCP service), run this review to verify it uses common.CompareProtoMessage, waits on LROs, updates status on no-op changes, and includes minimal and maximal test fixtures.

Quick Start

Review the open pull request that adds a new KCC Greenfield controller and report results using the standard review template.

Frequently Asked Questions about reviewgen-greenfield-controller

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review a PR that adds a KCC Greenfield controller?

Check the controller against six criteria: proto diffing with common.CompareProtoMessage, structured reporting of diffs, mandatory status updates after Create and Update, waiting on LROs, minimal and maximal test fixtures, and GAPIC REST client creation. Report results using the standard pass/fail template.

What test coverage is required for a new Config Connector direct controller?

The resource must have at least a minimal test case and one or more maximal test cases covering all spec fields under pkg/test/resourcefixture/testdata/basic/. Edge-case tests are expected when the controller has complex logic such as resource dependencies or identity mapping.

Should KCC controllers use gRPC or REST clients?

Controllers should prefer the official GAPIC Go client REST constructor, such as NewFooRESTClient, over NewFooClient or manual grpc.Dial with raw protobuf clients. gRPC is acceptable only when REST is unavailable or fails.

Why must a KCC controller update status even when nothing changed?

The controller must always update the KRM status at the end of Create and Update operations, even on no-op reconciliations. This ensures ObservedState and ExternalRef stay current and users can observe the actual resource state.

What is the reference implementation for a KCC direct controller?

The canonical reference is workerpool_controller.go in pkg/controller/direct/cloudbuild. Note that it predates IdentityV2, so new controllers must implement IdentityV2 correctly rather than copying that part.