generate-sh-checker

Detect missing generate.sh scripts in Config Connector API directories and create PR-ready fixes.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents inconsistent or missing generate.sh automation in the Config Connector apis/ directories, which can lead to broken generation workflows, stale generated code, and harder-to-review pull requests.

Core Features & Use Cases

  • Scans for missing generate scripts: Detects apis/<service>/<version>/ directories (typically v1alpha1/v1beta1) that contain Go API types but lack a generate.sh.
  • Extracts generation context from source: Reads api_types.go and groupversion_info.go to determine the required proto service, group/version, and resource mappings.
  • Creates consistent, PR-ready generation scripts: Produces a generate.sh following the existing generate-proto/generate-types/generate-mapper/CRD update pipeline and includes guidance for multi-version edge cases.
  • Handles common generation gotchas: Covers naming expectations, hand-written types.generated.go protection, pointer-field preservation, and acronym ref-field fixes.

Quick Start

Run the generate-sh-checker workflow to scan apis/ for missing generate.sh files and generate them following the standard pattern from #7293.

Frequently Asked Questions about generate-sh-checker

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

FAQPage Schema
How do I generate a missing generate.sh script for a Config Connector K8s API directory?

To generate a missing generate.sh for Config Connector, the workflow scans apis/<service>/<version>/ directories for Go API types and automatically creates a PR-ready script. It extracts proto service, group, version, and resource mappings from api_types.go and groupversion_info.go to ensure standardized automation.

What is the standard generate.sh pipeline for Config Connector CRD and mapper generation?

The standard generate.sh pipeline for Config Connector sequentially executes generate-proto, generate-types, generate-mapper, and CRD update commands. This ensures consistent proto type generation, K8s controller mapper creation, and Custom Resource Definition updates across all KCC APIs.

How do I handle multi-version promotions when generating KCC API types and CRDs?

Handling multi-version promotions in KCC API generation requires applying correct generator flags and ordering across apis/*/<service>/<version> directory structures. The workflow addresses edge cases like type naming, pointer optionality, and acronym ref-field mismatches to ensure version compatibility.

Why does my Config Connector code generation break on hand-written types.generated.go files?

Config Connector code generation breaks on hand-written types.generated.go files if the generate.sh script lacks proper protection logic. The standardized workflow detects these edge cases and applies safeguards to preserve hand-written outputs and pointer-field definitions during mapper generation.

Can I automatically detect which Config Connector API directories are missing generation scripts?

Yes, you can automatically detect Config Connector API directories missing generation scripts by scanning for apis/<service>/<version>/ paths that contain Go API types but lack a generate.sh file. The workflow then extracts the required context and creates the standardized script.