-
Notifications
You must be signed in to change notification settings - Fork 837
chore: remove vendor #4201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
chore: remove vendor #4201
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes vendor mode from the Go build process across the project. The changes update build commands to use standard Go module resolution instead of vendored dependencies, and add build cache mounts to improve Docker build performance.
- Removed
-mod vendorflag from allgo build,go test, andgo runcommands - Added BuildKit cache mounts for Go modules and build cache in Dockerfiles
- Updated both production and development build configurations
Reviewed Changes
Copilot reviewed 4 out of 8452 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| gator.Dockerfile | Removed vendor mode and added cache mounts for gator binary build |
| Dockerfile | Removed vendor mode and added cache mounts for manager binary build |
| Makefile | Removed vendor mode from test, build, and run targets |
| Tiltfile | Removed vendor mode from development build command |
JaydipGabani
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should vendor be added to .gitignore here or as a follow up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 12 out of 8463 changed files in this pull request and generated 2 comments.
| - bases/status.gatekeeper.sh_connectionpodstatuses.yaml | ||
| - bases/status.gatekeeper.sh_providerpodstatuses.yaml | ||
| - bases/connection.gatekeeper.sh_connections.yaml | ||
| - bases/constrainttemplate-customresourcedefinition.yaml |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new CRD file bases/constrainttemplate-customresourcedefinition.yaml is added to the kustomization resources, but there's no test coverage verifying that this file is correctly copied from the frameworks module (as done in the Makefile at line 367). Consider adding a test to ensure this file exists and is valid before kustomization runs.
| paths="./pkg/..." \ | ||
| output:crd:artifacts:config=config/crd/bases | ||
| @# Copy constraint template CRD from frameworks module | ||
| cp $$(go list -m -f '{{.Dir}}' github.com/open-policy-agent/frameworks/constraint)/deploy/crds.yaml config/crd/bases/constrainttemplate-customresourcedefinition.yaml |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cp command has no error handling. If the go list command fails or the source file doesn't exist, the error will be silent or unclear. Consider adding error checking: || { echo 'Failed to copy constraint template CRD'; exit 1; }
| cp $$(go list -m -f '{{.Dir}}' github.com/open-policy-agent/frameworks/constraint)/deploy/crds.yaml config/crd/bases/constrainttemplate-customresourcedefinition.yaml | |
| cp $$(go list -m -f '{{.Dir}}' github.com/open-policy-agent/frameworks/constraint)/deploy/crds.yaml config/crd/bases/constrainttemplate-customresourcedefinition.yaml || { echo 'Failed to copy constraint template CRD'; exit 1; } |
- Update license-lint workflow to not check vendor directory - Update Makefile to remove vendor targets and references - Update kustomization.yaml to reference CRD from config/crd/bases - Copy ConstraintTemplate CRD from go module cache to config/crd/bases - Update test infrastructure to use single CRD directory path - Remove unused go:generate directive from apis/apis.go - Update Tiltfile to remove vendor from deps - Update .gitignore to remove vendor exclusion patterns - Update AGENTS.md documentation to reflect Go modules usage - Update Dockerfiles to use go module cache instead of vendor Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
05013fa to
d384285
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 12 out of 8463 changed files in this pull request and generated 2 comments.
| - bases/expansion.gatekeeper.sh_expansiontemplate.yaml | ||
| - bases/status.gatekeeper.sh_connectionpodstatuses.yaml | ||
| - bases/status.gatekeeper.sh_providerpodstatuses.yaml | ||
| - bases/connection.gatekeeper.sh_connections.yaml |
Copilot
AI
Dec 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new CRD file reference 'constrainttemplate-customresourcedefinition.yaml' is generated by the Makefile's manifests target (lines 366-368), but this dependency relationship is not documented. Consider adding a comment explaining that this file is generated from the frameworks module to help maintainers understand the build process.
| - bases/connection.gatekeeper.sh_connections.yaml | |
| - bases/connection.gatekeeper.sh_connections.yaml | |
| # NOTE: The following CRD file is generated by the Makefile's manifests target (lines 366-368) from the frameworks module. |
| @# Copy constraint template CRD from frameworks module | ||
| go mod download github.com/open-policy-agent/frameworks/constraint | ||
| cp $$(go list -m -f '{{.Dir}}' github.com/open-policy-agent/frameworks/constraint)/deploy/crds.yaml config/crd/bases/constrainttemplate-customresourcedefinition.yaml |
Copilot
AI
Dec 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new CRD copy logic lacks error handling. If go mod download or go list fails, the make target will continue and potentially create an empty or corrupted CRD file. Consider adding error checking (e.g., set -e or explicit error checks) to fail fast if the module cannot be downloaded or located.
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## master #4201 +/- ##
===========================================
- Coverage 54.49% 40.70% -13.80%
===========================================
Files 134 251 +117
Lines 12329 17723 +5394
===========================================
+ Hits 6719 7214 +495
- Misses 5116 9886 +4770
- Partials 494 623 +129
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, using
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when the PR gets merged):Fixes #
Special notes for your reviewer: