Skip to content

Conversation

@sozercan
Copy link
Member

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:

Copilot AI review requested due to automatic review settings October 28, 2025 19:01
@sozercan sozercan requested a review from a team as a code owner October 28, 2025 19:01
Copy link
Contributor

Copilot AI left a 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 vendor flag from all go build, go test, and go run commands
  • 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

Copy link
Contributor

@JaydipGabani JaydipGabani left a 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?

@sozercan sozercan marked this pull request as draft October 28, 2025 21:05
@sozercan sozercan added this to the v3.22.0 milestone Oct 29, 2025
@JaydipGabani JaydipGabani removed this from the v3.22.0 milestone Dec 3, 2025
Copilot AI review requested due to automatic review settings December 5, 2025 23:35
Copy link
Contributor

Copilot AI left a 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
Copy link

Copilot AI Dec 5, 2025

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.

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Dec 5, 2025

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; }

Suggested change
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; }

Copilot uses AI. Check for mistakes.
- 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>
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copilot AI review requested due to automatic review settings December 6, 2025 01:41
Copy link
Contributor

Copilot AI left a 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
Copy link

Copilot AI Dec 6, 2025

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.

Suggested change
- 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.

Copilot uses AI. Check for mistakes.
Comment on lines +366 to +368
@# 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
Copy link

Copilot AI Dec 6, 2025

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.

Copilot uses AI. Check for mistakes.
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 40.70%. Comparing base (3350319) to head (46ae592).
⚠️ Report is 514 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (3350319) and HEAD (46ae592). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (3350319) HEAD (46ae592)
unittests 2 1
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     
Flag Coverage Δ
unittests 40.70% <ø> (-13.80%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants