chore: migrate to go-makefile-maker generated Makefile#67
Open
onuryilmaz wants to merge 7 commits into
Open
Conversation
Enable the g-m-m generated Makefile (makefile: enabled: true) and move custom project-specific targets into the verbatim section. Version ldflags are now managed via golang.ldflags in Makefile.maker.yaml. Custom targets preserved in verbatim: manifests, test, fmt, vet, kustomize, build-local, run, docker-build, docker-push, docker-push-mac, install-crd, uninstall-crd, deploy, undeploy, generate-helm-chart. Targets superseded by g-m-m: build-all, generate, controller-gen, envtest, install-go-licence-detector, check-dependency-licenses, build/cover.out, golint/lint, help. Note: install/uninstall (CRD operations) renamed to install-crd/uninstall-crd to avoid conflict with g-m-m's install target (binary install).
3cf60c7 to
38e4f1b
Compare
- manifests: add install-controller-gen as prerequisite
- test: add install-setup-envtest as prerequisite
- controllers/util.go: use slices.Contains (modernize)
- pkg/disco/designate.go: use maps.Copy (modernize)
- hack/kustomize-to-helm.go: use any instead of interface{} (modernize)
- pkg/clientutil/client.go: remove unused //nolint:errcheck directive
- api/v1/record_webhook.go: fix goimports
vendor/ is gitignored and not committed, so CI builds fail when go-makefile-maker auto-detects the local vendor/ directory and adds -mod vendor to GO_BUILDFLAGS. Delete vendor/ before running g-m-m so it generates without the vendor flag.
- Replace /* Copyright YEAR SAP SE */ block comments with SPDX headers (// SPDX-FileCopyrightText / // SPDX-License-Identifier) in Go files - Add SPDX headers to Go files that had no copyright info - Run reuse annotate to add SPDX headers to non-Go files (YAML, Markdown, Dockerfile, etc.) - Add REUSE.toml entries for files reuse cannot annotate inline (PROJECT, .helmignore, config.env, boilerplate.go.txt) - Add reuse.annotations to Makefile.maker.yaml to preserve these entries across future go-makefile-maker runs
Merging this branch will not change overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
makefile: enabled: trueinMakefile.maker.yamlso g-m-m generates theMakefileGitBranch,GitCommit,GitState,BuildDate) togolang.ldflagssobuild-allinjects them automatically viaGO_LDFLAGSverbatim::manifests,test(envtest),fmt,vet,kustomize,build-local,run, docker targets, deployment targets,generate-helm-chartbuild-all,generate,controller-gen,envtest,install-go-licence-detector,check-dependency-licenses,build/cover.out,golint/lint,helpbuildtobuild-localto avoid collision with g-m-m'sbuild(which creates thebuild/directory)install/uninstall(CRD operations via kustomize) toinstall-crd/uninstall-crdto avoid collision with g-m-m'sinstall(binary install)Test plan
make build-allcompiles binary with correct version ldflagsmake checkpasses (static-check + tests)make generateruns controller-gen correctlymake manifestsgenerates CRDs/RBAC correctlymake install-crdinstalls CRDs to cluster