Skip to content

Drop vgopath from API code generation#1479

Merged
afritzler merged 1 commit into
mainfrom
enh/remove-vgopath
Jun 1, 2026
Merged

Drop vgopath from API code generation#1479
afritzler merged 1 commit into
mainfrom
enh/remove-vgopath

Conversation

@afritzler
Copy link
Copy Markdown
Member

@afritzler afritzler commented Jun 1, 2026

Proposed Changes

Use upstream k8s.io/code-generator (kube_codegen.sh) directly instead of synthesizing a virtual GOPATH via vgopath. The codegen tools have been module-aware for a while, so the GOPATH-style layout is no longer needed.

  • Remove the VGOPATH variable, install target, and version pin from the Makefile, and drop vgopath as a prerequisite of generate and proto.
  • Drop the mktemp + vgopath -o materialization and GOROOT/GOPATH exports from hack/update-codegen.sh; only go mod download remains so go list -m can resolve k8s.io/code-generator.

Generated output (api/, client-go/, internal/apis/, iri/) is byte-identical to before.

Fixes #1478

Summary by CodeRabbit

  • Chores
    • Simplified the build toolchain by removing an unused dependency tool and streamlining the module initialization process. Build infrastructure is now leaner with reduced complexity in code generation setup.

Use upstream `k8s.io/code-generator` (kube_codegen.sh) directly instead
of synthesizing a virtual GOPATH via vgopath. The codegen tools have
been module-aware for a while, so the GOPATH-style layout is no longer
needed.

- Remove the VGOPATH variable, install target, and version pin from
  the Makefile, and drop vgopath as a prerequisite of `generate` and
  `proto`.
- Drop the mktemp + vgopath -o materialization and GOROOT/GOPATH
  exports from hack/update-codegen.sh; only `go mod download` remains
  so `go list -m` can resolve k8s.io/code-generator.

Generated output (`api/`, `client-go/`, `internal/apis/`, `iri/`) is
byte-identical to before.

Signed-off-by: Andreas Fritzler <andreas.fritzler@sap.com>
@afritzler afritzler requested a review from a team as a code owner June 1, 2026 08:04
@github-actions github-actions Bot added size/S enhancement New feature or request labels Jun 1, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b4117ada-9500-46d1-8129-e7f93d69f068

📥 Commits

Reviewing files that changed from the base of the PR and between ddfd5b3 and fe91bcb.

📒 Files selected for processing (2)
  • Makefile
  • hack/update-codegen.sh

📝 Walkthrough

Walkthrough

This PR removes the vgopath tool from the code generation pipeline. The Makefile targets generate and proto no longer depend on vgopath, and the tool installation machinery is deleted. The hack/update-codegen.sh script is simplified to run module downloads directly without creating a virtual GOPATH context.

Changes

Remove vgopath from code generation pipeline

Layer / File(s) Summary
Makefile target and tool cleanup
Makefile
generate and proto targets drop vgopath from prerequisites; generate now exports MODELS_SCHEMA and OPENAPI_GEN to the script. VGOPATH, VGOPATH_VERSION variables and the vgopath install target are removed entirely.
Script virtual GOPATH removal
hack/update-codegen.sh
Virtual GOPATH setup (VIRTUAL_GOPATH, GOROOT, GOPATH exports and cleanup trap) is removed; go mod download now runs directly in PROJECT_ROOT with MODELS_SCHEMA and OPENAPI_GEN preserved in the environment.

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title concisely and accurately summarizes the main change: removing vgopath from the API code generation pipeline.
Description check ✅ Passed The description follows the template structure with a 'Proposed Changes' section that clearly outlines the modifications, explains the rationale, and references the fixed issue.
Linked Issues check ✅ Passed The PR successfully addresses all coding-related objectives from issue #1478: removes VGOPATH variable/target/version-pin, drops vgopath prerequisites, simplifies hack/update-codegen.sh, and maintains byte-identical output.
Out of Scope Changes check ✅ Passed All changes are directly within scope: modifications to Makefile and hack/update-codegen.sh align with the stated objectives of removing vgopath and simplifying the codegen workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch enh/remove-vgopath

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@afritzler afritzler merged commit 96f03ac into main Jun 1, 2026
12 checks passed
@afritzler afritzler deleted the enh/remove-vgopath branch June 1, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove vgopath from API code generation, use upstream Kubernetes codegen tooling directly

2 participants