-
Notifications
You must be signed in to change notification settings - Fork 0
build image via go-m-m #6
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "permissions": { | ||
| "allow": [ | ||
| "Bash(gh pr:*)", | ||
| "WebFetch(domain:github.com)", | ||
| "WebFetch(domain:raw.githubusercontent.com)", | ||
| "Bash(curl:*)" | ||
| ] | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -18,7 +18,6 @@ name: Checks | |||||||||
| permissions: | ||||||||||
| checks: write | ||||||||||
| contents: read | ||||||||||
| pull-requests: read | ||||||||||
| jobs: | ||||||||||
| checks: | ||||||||||
| name: Checks | ||||||||||
|
|
@@ -30,7 +29,7 @@ jobs: | |||||||||
| uses: actions/setup-go@v6 | ||||||||||
| with: | ||||||||||
| check-latest: true | ||||||||||
| go-version: 1.25.5 | ||||||||||
| go-version: 1.26.1 | ||||||||||
| - name: Run golangci-lint | ||||||||||
| uses: golangci/golangci-lint-action@v9 | ||||||||||
| with: | ||||||||||
|
|
@@ -42,13 +41,11 @@ jobs: | |||||||||
| - name: Dependency Licenses Review | ||||||||||
| run: make check-dependency-licenses | ||||||||||
| - name: Check for spelling errors | ||||||||||
| uses: reviewdog/action-misspell@v1 | ||||||||||
| with: | ||||||||||
| exclude: ./vendor/* | ||||||||||
| fail_on_error: true | ||||||||||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||||||||||
| ignore: importas | ||||||||||
| reporter: github-check | ||||||||||
| uses: crate-ci/typos@v1 | ||||||||||
| env: | ||||||||||
| CLICOLOR: "1" | ||||||||||
| - name: Delete typos binary | ||||||||||
| run: rm typos | ||||||||||
|
Comment on lines
+47
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: find . -name "checks.yaml" -path "*/.github/workflows/*" -type fRepository: cobaltcore-dev/cloud-profile-sync Length of output: 108 🏁 Script executed: cat -n .github/workflows/checks.yaml | head -60Repository: cobaltcore-dev/cloud-profile-sync Length of output: 2192 🌐 Web query:
💡 Result:
Binary install / extraction behavior:
Sources: [1] [2] Make this cleanup step non-failing. The Suggested fix - name: Delete typos binary
- run: rm typos
+ run: rm -f typos📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| - name: Check if source code files have license header | ||||||||||
| run: make check-addlicense | ||||||||||
| - name: REUSE Compliance Check | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| ################################################################################ | ||
| # This file is AUTOGENERATED with <https://github.com/sapcc/go-makefile-maker> # | ||
| # Edit Makefile.maker.yaml instead. # | ||
| ################################################################################ | ||
|
|
||
| # SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| name: Container Registry GHCR | ||
| "on": | ||
| push: | ||
| branches: | ||
| - master | ||
| workflow_dispatch: {} | ||
|
Comment on lines
+11
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: find . -name "container-registry-ghcr.yaml" -type fRepository: cobaltcore-dev/cloud-profile-sync Length of output: 125 🏁 Script executed: cat -n ./.github/workflows/container-registry-ghcr.yamlRepository: cobaltcore-dev/cloud-profile-sync Length of output: 2570 🏁 Script executed: # Let me search for any documentation or comments about how docker/metadata-action behaves with semver
web_search "docker/metadata-action type=semver git tags trigger"Repository: cobaltcore-dev/cloud-profile-sync Length of output: 127 🏁 Script executed: web_search "docker metadata-action semver pattern git tag ref"Repository: cobaltcore-dev/cloud-profile-sync Length of output: 127 🌐 Web query:
💡 Result: How Git tags trigger
|
||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| jobs: | ||
| build-and-push-image: | ||
| name: Push container to ghcr.io | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v6 | ||
| - name: Log in to the Container registry | ||
| uses: docker/login-action@v4 | ||
| with: | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| - name: Extract metadata (tags, labels) for Docker | ||
| id: meta | ||
| uses: docker/metadata-action@v6 | ||
| with: | ||
| images: ghcr.io/${{ github.repository }} | ||
| tags: | | ||
| # https://github.com/docker/metadata-action#typeedge | ||
| type=edge | ||
| # https://github.com/docker/metadata-action#latest-tag | ||
| type=raw,value=latest,enable={{is_default_branch}} | ||
| # https://github.com/docker/metadata-action#typesemver | ||
| type=semver,pattern={{raw}} | ||
| type=semver,pattern=v{{major}}.{{minor}} | ||
| type=semver,pattern=v{{major}} | ||
| # https://github.com/docker/metadata-action#typesha | ||
| type=sha,format=long | ||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v4 | ||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v4 | ||
| - name: Build and push Docker image | ||
| uses: docker/build-push-action@v7 | ||
|
Comment on lines
+23
to
+52
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: cat -n .github/workflows/container-registry-ghcr.yaml | head -60Repository: cobaltcore-dev/cloud-profile-sync Length of output: 2570 🏁 Script executed: fd Makefile.maker.yamlRepository: cobaltcore-dev/cloud-profile-sync Length of output: 96 🏁 Script executed: cat -n Makefile.maker.yamlRepository: cobaltcore-dev/cloud-profile-sync Length of output: 1392 🏁 Script executed: web_search
Query: go-makefile-maker action pinning SHA github workflowsRepository: cobaltcore-dev/cloud-profile-sync Length of output: 172 🌐 Web query:
💡 Result: If you use
Example (what “pin to SHA” looks like): - uses: OWNER/REPO@0123456789abcdef0123456789abcdef01234567 # v1.2.3Sources
Pin GitHub Actions to commit SHAs instead of floating version tags. This workflow pushes container images with
🤖 Prompt for AI Agents |
||
| with: | ||
| context: . | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| platforms: linux/amd64 | ||
| push: true | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,7 +56,6 @@ linters: | |
| - ineffassign | ||
| - intrange | ||
| - iotamixing | ||
| - misspell | ||
| - modernize | ||
| - nilerr | ||
| - nolintlint | ||
|
|
@@ -137,8 +136,20 @@ linters: | |
| excludes: | ||
| # gosec wants us to set a short ReadHeaderTimeout to avoid Slowloris attacks, but doing so would expose us to Keep-Alive race conditions (see https://iximiuz.com/en/posts/reverse-proxy-http-keep-alive-and-502s/ | ||
| - G112 | ||
| # if we put a password or token into a serialized payload, guess what, we probably did that on purpose | ||
| - G117 | ||
| # this triggers on net/http.Request.ParseForm() and its callers, e.g. net/http.Request.FormValue(), complaining about potential memory exhaustion from unbounded form parsing; | ||
| # but that is incorrect, ParseForm() by default never parses more than 10 MiB for this specific reason | ||
| - G120 | ||
| # created file permissions are restricted by umask if necessary | ||
| - G306 | ||
| # the following lints cause false-positives in many repositories, should be fixed with the next release. (see https://github.com/securego/gosec/issues/1500) | ||
| - G701 | ||
| - G702 | ||
| - G703 | ||
| - G704 | ||
| - G705 | ||
| - G706 | ||
|
Comment on lines
+139
to
+152
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, locate and examine the .golangci.yaml file
find . -name ".golangci.yaml" -o -name ".golangci.yml" | head -20Repository: cobaltcore-dev/cloud-profile-sync Length of output: 93 🏁 Script executed: # Read the .golangci.yaml file with context around lines 139-152
wc -l .golangci.yamlRepository: cobaltcore-dev/cloud-profile-sync Length of output: 95 🏁 Script executed: # Show the relevant section with surrounding context
head -160 .golangci.yaml | tail -30Repository: cobaltcore-dev/cloud-profile-sync Length of output: 1404 🏁 Script executed: # Check if there are any `#nosec` or //nolint:gosec annotations in the codebase currently
rg "#nosec|//nolint.*gosec" --type go | head -20Repository: cobaltcore-dev/cloud-profile-sync Length of output: 59 🏁 Script executed: # Search for specific code patterns that would match the excluded rules
# G120: net/http.Request.ParseForm() or FormValue()
rg "ParseForm|FormValue" --type go -nRepository: cobaltcore-dev/cloud-profile-sync Length of output: 59 🏁 Script executed: # Search for patterns related to G117 (hardcoded credentials) and G306 (file permissions)
rg "os.Create|os.OpenFile|NewFile|chmod" --type go -n | head -30Repository: cobaltcore-dev/cloud-profile-sync Length of output: 59 🏁 Script executed: # Check if golangci-lint documentation is available locally
find . -name "*.md" -type f | xargs grep -l "gosec\|excludes" 2>/dev/null | head -5Repository: cobaltcore-dev/cloud-profile-sync Length of output: 59 🏁 Script executed: # Get an overview of the codebase structure
find . -type f -name "*.go" | wc -l
ls -la | head -20Repository: cobaltcore-dev/cloud-profile-sync Length of output: 1281 🏁 Script executed: # Check git history or comments to understand why these rules were excluded
git log --oneline -n 20 -- .golangci.yaml 2>/dev/null | head -10Repository: cobaltcore-dev/cloud-profile-sync Length of output: 106 🏁 Script executed: # Search for any code that might involve password/token handling (related to G117)
rg "password|token|secret|credential" --type go -i -l | head -10Repository: cobaltcore-dev/cloud-profile-sync Length of output: 274 🏁 Script executed: # Check the content of files that mention password/token/secret
cat cloudprofilesync/source.go | head -100Repository: cobaltcore-dev/cloud-profile-sync Length of output: 2352 🏁 Script executed: # Check the controller files for password/token handling
rg "password|token|secret" --type go -B 2 -A 2Repository: cobaltcore-dev/cloud-profile-sync Length of output: 4930 🏁 Script executed: # Check if there are any comments in the code mentioning gosec or nosec
rg "gosec|nosec|nolint" --type go | head -20Repository: cobaltcore-dev/cloud-profile-sync Length of output: 59 🏁 Script executed: # Look for the issue mentioned in the comment (https://github.com/securego/gosec/issues/1500)
# to understand the context of G701-G706 exclusions
rg "G701|G702|G703|G704|G705|G706" .Repository: cobaltcore-dev/cloud-profile-sync Length of output: 59 🏁 Script executed: # Verify the exact usage of OCIParams to understand if password serialization is truly necessary
rg "OCIParams" --type go -B 2 -A 2Repository: cobaltcore-dev/cloud-profile-sync Length of output: 1341 🏁 Script executed: # Check if there's any marshaling/serialization of OCIParams or similar structures
rg "json\.Marshal|json\.Unmarshal|MarshalJSON|UnmarshalJSON" --type goRepository: cobaltcore-dev/cloud-profile-sync Length of output: 914 🏁 Script executed: # Check if OCIParams is ever marshaled or serialized
rg "NewOCI" --type go -A 5 | head -40Repository: cobaltcore-dev/cloud-profile-sync Length of output: 1344 🏁 Script executed: # Look at the full controller code to see if the password ends up in serialized form
sed -n '1,100p' controllers/managedcloudprofile_controller.goRepository: cobaltcore-dev/cloud-profile-sync Length of output: 3670 🏁 Script executed: # Check if OCIParams json tags are actually used anywhere (marshaled/unmarshaled)
rg "OCIParams" --type go -A 10 -B 2 | grep -A 10 -B 2 "Marshal\|Unmarshal"Repository: cobaltcore-dev/cloud-profile-sync Length of output: 59 🏁 Script executed: # Verify the complete picture: is OCIParams ever serialized?
ast-grep --pattern 'json.Marshal($$_OCIParams)' || true
ast-grep --pattern 'json.Unmarshal($$_, $$_OCIParams)' || trueRepository: cobaltcore-dev/cloud-profile-sync Length of output: 59 🏁 Script executed: # Check if there are any http.Request.ParseForm or FormValue calls
rg "ParseForm|FormValue" --type go -nRepository: cobaltcore-dev/cloud-profile-sync Length of output: 59 Remove unnecessary The 🤖 Prompt for AI Agents |
||
| govet: | ||
| disable: | ||
| - fieldalignment | ||
|
|
@@ -147,7 +158,7 @@ linters: | |
| require-specific: true | ||
| modernize: | ||
| disable: | ||
| # omitzero requires removing omitempty tags in kubernetes api struct types which are nested, which is intepreted by controller-gen and breaks the CRDs. | ||
| # omitzero requires removing omitempty tags in kubernetes api struct types which are nested, which is interpreted by controller-gen and breaks the CRDs. | ||
| - omitzero | ||
| perfsprint: | ||
| # modernize generates nicer fix code | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # SPDX-FileCopyrightText: 2025 SAP SE | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| [default.extend-words] | ||
|
|
||
| [files] | ||
| extend-exclude = [ | ||
| "go.mod", | ||
| ] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -43,7 +43,10 @@ install-golangci-lint: FORCE | |||||
| @if ! hash golangci-lint 2>/dev/null; then printf "\e[1;36m>> Installing golangci-lint (this may take a while)...\e[0m\n"; go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest; fi | ||||||
|
|
||||||
| install-shellcheck: FORCE | ||||||
| @if ! hash shellcheck 2>/dev/null; then printf "\e[1;36m>> Installing shellcheck...\e[0m\n"; SHELLCHECK_ARCH=$(shell uname -m); if [[ "$$SHELLCHECK_ARCH" == "arm64" ]]; then SHELLCHECK_ARCH=aarch64; fi; SHELLCHECK_OS=$(shell uname -s | tr '[:upper:]' '[:lower:]'); SHELLCHECK_VERSION="stable"; if command -v curl >/dev/null 2>&1; then GET="curl -sLo-"; elif command -v wget >/dev/null 2>&1; then GET="wget -O-"; else echo "Didn't find curl or wget to download shellcheck"; exit 2; fi; $$GET "https://github.com/koalaman/shellcheck/releases/download/$$SHELLCHECK_VERSION/shellcheck-$$SHELLCHECK_VERSION.$$SHELLCHECK_OS.$$SHELLCHECK_ARCH.tar.xz" | tar -Jxf -; BIN=$$(go env GOBIN); if [[ -z $$BIN ]]; then BIN=$$(go env GOPATH)/bin; fi; install -Dm755 shellcheck-$$SHELLCHECK_VERSION/shellcheck -t "$$BIN"; rm -rf shellcheck-$$SHELLCHECK_VERSION; fi | ||||||
| @set -eou pipefail; if ! hash shellcheck 2>/dev/null; then printf "\e[1;36m>> Installing shellcheck...\e[0m\n"; SHELLCHECK_ARCH=$$(uname -m); if [[ "$$SHELLCHECK_ARCH" == "arm64" ]]; then SHELLCHECK_ARCH=aarch64; fi; SHELLCHECK_OS=$$(uname -s | tr '[:upper:]' '[:lower:]'); SHELLCHECK_VERSION="stable"; if command -v curl >/dev/null 2>&1; then GET="curl -sLo-"; elif command -v wget >/dev/null 2>&1; then GET="wget -O-"; else echo "Didn't find curl or wget to download shellcheck"; exit 2; fi; $$GET "https://github.com/koalaman/shellcheck/releases/download/$$SHELLCHECK_VERSION/shellcheck-$$SHELLCHECK_VERSION.$$SHELLCHECK_OS.$$SHELLCHECK_ARCH.tar.xz" | tar -Jxf -; BIN=$$(go env GOBIN); if [[ -z $$BIN ]]; then BIN=$$(go env GOPATH)/bin; fi; install -Dm755 shellcheck-$$SHELLCHECK_VERSION/shellcheck -t "$$BIN"; rm -rf shellcheck-$$SHELLCHECK_VERSION; fi | ||||||
|
|
||||||
| install-typos: FORCE | ||||||
| @set -eou pipefail; if ! hash typos 2>/dev/null; then printf "\e[1;36m>> Installing typos...\e[0m\n"; TYPOS_ARCH=$$(uname -m); if [[ "$$TYPOS_ARCH" == "arm64" ]]; then TYPOS_ARCH=aarch64; fi; if command -v curl >/dev/null 2>&1; then GET="curl $${GITHUB_TOKEN:+" -u \":$$GITHUB_TOKEN\""} -sLo-"; elif command -v wget >/dev/null 2>&1; then GET="wget $${GITHUB_TOKEN:+" --password \"$$GITHUB_TOKEN\""} -O-"; else echo "Didn't find curl or wget to download typos"; exit 2; fi; if command -v gh >/dev/null; then TYPOS_GET_RELEASE_JSON="gh api /repos/crate-ci/typos/releases"; else TYPOS_GET_RELEASE_JSON="$$GET https://api.github.com/repos/crate-ci/typos/releases"; fi; TYPOS_VERSION=$$($$TYPOS_GET_RELEASE_JSON | jq -r '.[0].name' ); if [[ $(UNAME_S) == Darwin ]]; then TYPOS_FILE="typos-$$TYPOS_VERSION-$$TYPOS_ARCH-apple-darwin.tar.gz"; elif [[ $(UNAME_S) == Linux ]]; then TYPOS_FILE="typos-$$TYPOS_VERSION-$$TYPOS_ARCH-unknown-linux-musl.tar.gz"; fi; mkdir -p typos; $$GET ""https://github.com/crate-ci/typos/releases/download/$$TYPOS_VERSION/$$TYPOS_FILE"" | tar -C typos -zxf -; BIN=$$(go env GOBIN); if [[ -z $$BIN ]]; then BIN=$$(go env GOPATH)/bin; fi; install -Dm755 typos/typos -t "$$BIN"; rm -rf typos/; fi | ||||||
|
|
||||||
| install-go-licence-detector: FORCE | ||||||
| @if ! hash go-licence-detector 2>/dev/null; then printf "\e[1;36m>> Installing go-licence-detector (this may take a while)...\e[0m\n"; go install go.elastic.co/go-licence-detector@latest; fi | ||||||
|
|
@@ -54,7 +57,7 @@ install-addlicense: FORCE | |||||
| install-reuse: FORCE | ||||||
| @if ! hash reuse 2>/dev/null; then if ! hash pipx 2>/dev/null; then printf "\e[1;31m>> You are required to manually intervene to install reuse as go-makefile-maker cannot automatically resolve installing reuse on all setups.\e[0m\n"; printf "\e[1;31m>> The preferred way for go-makefile-maker to install python tools after nix-shell is pipx which could not be found. Either install pipx using your package manager or install reuse using your package manager if at least version 6 is available.\e[0m\n"; printf "\e[1;31m>> As your Python was likely installed by your package manager, just doing pip install --user sadly does no longer work as pip issues a warning about breaking your system. Generally running --break-system-packages with --user is safe to do but you should only run this command if you can resolve issues with it yourself: pip3 install --user --break-system-packages reuse\e[0m\n"; else printf "\e[1;36m>> Installing reuse...\e[0m\n"; pipx install reuse; fi; fi | ||||||
|
|
||||||
| prepare-static-check: FORCE install-goimports install-golangci-lint install-shellcheck install-go-licence-detector install-addlicense install-reuse | ||||||
| prepare-static-check: FORCE install-goimports install-golangci-lint install-shellcheck install-typos install-go-licence-detector install-addlicense install-reuse | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested fix-__static-check: FORCE run-shellcheck run-golangci-lint check-dependency-licenses check-license-headers
+__static-check: FORCE run-shellcheck run-typos run-golangci-lint check-dependency-licenses check-license-headersAlso applies to: 122-124 🤖 Prompt for AI Agents |
||||||
|
|
||||||
| install-controller-gen: FORCE | ||||||
| @if ! hash controller-gen 2>/dev/null; then printf "\e[1;36m>> Installing controller-gen (this may take a while)...\e[0m\n"; go install sigs.k8s.io/controller-tools/cmd/controller-gen@latest; fi | ||||||
|
|
@@ -76,7 +79,7 @@ build/cloud-profile-sync: FORCE generate | |||||
| env $(GO_BUILDENV) go build $(GO_BUILDFLAGS) -ldflags '-s -w $(GO_LDFLAGS)' -o build/cloud-profile-sync . | ||||||
|
|
||||||
| DESTDIR = | ||||||
| ifeq ($(shell uname -s),Darwin) | ||||||
| ifeq ($(UNAME_S),Darwin) | ||||||
| PREFIX = /usr/local | ||||||
| else | ||||||
| PREFIX = /usr | ||||||
|
|
@@ -116,6 +119,10 @@ run-shellcheck: FORCE install-shellcheck | |||||
| @printf "\e[1;36m>> shellcheck\e[0m\n" | ||||||
| @find . -type f \( -name '*.bash' -o -name '*.ksh' -o -name '*.zsh' -o -name '*.sh' -o -name '*.shlib' \) -exec shellcheck {} + | ||||||
|
|
||||||
| run-typos: FORCE install-typos | ||||||
| @printf "\e[1;36m>> typos\e[0m\n" | ||||||
| @typos | ||||||
|
|
||||||
| build/cover.out: FORCE generate install-setup-envtest | build | ||||||
| @printf "\e[1;36m>> Running tests\e[0m\n" | ||||||
| KUBEBUILDER_ASSETS=$$(setup-envtest use 1.34 -p path) go run github.com/onsi/ginkgo/v2/ginkgo run --randomize-all -output-dir=build $(GO_BUILDFLAGS) -ldflags '-s -w $(GO_LDFLAGS)' -covermode=count -coverpkg=$(subst $(space),$(comma),$(GO_COVERPKGS)) $(GO_TESTFLAGS) $(GO_TESTPKGS) | ||||||
|
|
@@ -151,7 +158,7 @@ license-headers: FORCE install-addlicense install-reuse | |||||
| @printf "\e[1;36m>> addlicense (for license headers on source code files)\e[0m\n" | ||||||
| @printf "%s\0" $(patsubst $(shell awk '$$1 == "module" {print $$2}' go.mod)%,.%/*.go,$(shell go list ./...)) | $(XARGS) -0 -I{} bash -c 'year="$$(grep 'Copyright' {} | head -n1 | grep -E -o '"'"'[0-9]{4}(-[0-9]{4})?'"'"')"; if [[ -z "$$year" ]]; then year=$$(date +%Y); fi; gawk -i inplace '"'"'{if (display) {print} else {!/^\/\*/ && !/^\*/}}; {if (!display && $$0 ~ /^(package |$$)/) {display=1} else { }}'"'"' {}; addlicense -c "SAP SE or an SAP affiliate company" -s=only -y "$$year" -- {}; $(SED) -i '"'"'1s+// Copyright +// SPDX-FileCopyrightText: +'"'"' {}; ' | ||||||
| @printf "\e[1;36m>> reuse annotate (for license headers on other files)\e[0m\n" | ||||||
| @reuse lint -j | jq -r '.non_compliant.missing_licensing_info[]' | grep -vw vendor | $(XARGS) reuse annotate -c 'SAP SE or an SAP affiliate company' -l Apache-2.0 --skip-unrecognised | ||||||
| @reuse lint -j | jq -r '.non_compliant.missing_licensing_info[]' | sed '/\<vendor\>/d' | $(XARGS) reuse annotate -c 'SAP SE or an SAP affiliate company' -l Apache-2.0 --skip-unrecognised | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reuse the This hardcodes Suggested fix- `@reuse` lint -j | jq -r '.non_compliant.missing_licensing_info[]' | sed '/\<vendor\>/d' | $(XARGS) reuse annotate -c 'SAP SE or an SAP affiliate company' -l Apache-2.0 --skip-unrecognised
+ `@reuse` lint -j | jq -r '.non_compliant.missing_licensing_info[]' | $(SED) '/\<vendor\>/d' | $(XARGS) reuse annotate -c 'SAP SE or an SAP affiliate company' -l Apache-2.0 --skip-unrecognised📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| @printf "\e[1;36m>> reuse download --all\e[0m\n" | ||||||
| @reuse download --all | ||||||
| @printf "\e[1;35mPlease review the changes. If *.license files were generated, consider instructing go-makefile-maker to add overrides to REUSE.toml instead.\e[0m\n" | ||||||
|
|
@@ -194,6 +201,7 @@ help: FORCE | |||||
| @printf " \e[36minstall-goimports\e[0m Install goimports required by goimports/static-check\n" | ||||||
| @printf " \e[36minstall-golangci-lint\e[0m Install golangci-lint required by run-golangci-lint/static-check\n" | ||||||
| @printf " \e[36minstall-shellcheck\e[0m Install shellcheck required by run-shellcheck/static-check\n" | ||||||
| @printf " \e[36minstall-typos\e[0m Install typos required by run-typos/static-check\n" | ||||||
| @printf " \e[36minstall-go-licence-detector\e[0m Install-go-licence-detector required by check-dependency-licenses/static-check\n" | ||||||
| @printf " \e[36minstall-addlicense\e[0m Install addlicense required by check-license-headers/license-headers/static-check\n" | ||||||
| @printf " \e[36minstall-reuse\e[0m Install reuse required by license-headers/check-reuse\n" | ||||||
|
|
@@ -211,6 +219,7 @@ help: FORCE | |||||
| @printf " \e[36mgenerate\e[0m Generate code for Kubernetes CRDs and deepcopy.\n" | ||||||
| @printf " \e[36mrun-golangci-lint\e[0m Install and run golangci-lint. Installing is used in CI, but you should probably install golangci-lint using your package manager.\n" | ||||||
| @printf " \e[36mrun-shellcheck\e[0m Install and run shellcheck. Installing is used in CI, but you should probably install shellcheck using your package manager.\n" | ||||||
| @printf " \e[36mrun-typos\e[0m Check for spelling errors using typos.\n" | ||||||
| @printf " \e[36mbuild/cover.out\e[0m Run tests and generate coverage report.\n" | ||||||
| @printf " \e[36mbuild/cover.html\e[0m Generate an HTML file with source code annotations from the coverage report.\n" | ||||||
| @printf " \e[36mcheck-addlicense\e[0m Check license headers in all non-vendored .go files with addlicense.\n" | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| module github.com/cobaltcore-dev/cloud-profile-sync | ||
|
|
||
| go 1.25 | ||
| go 1.26 | ||
|
|
||
| require ( | ||
| github.com/blang/semver/v4 v4.0.0 | ||
|
|
||
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.
🧩 Analysis chain
🏁 Script executed:
Repository: cobaltcore-dev/cloud-profile-sync
Length of output: 251
Add
.claude/settings.local.jsonto.gitignoreor narrow the overly permissive permissions.The file is currently tracked in the repository with broad wildcard shell access (
Bash(gh pr:*)andBash(curl:*)). If this is a local-only setting, it should be ignored. If intentionally shared, these permissions exceed least privilege and create unnecessary exfiltration/misuse risk—narrow them to specific commands instead.🤖 Prompt for AI Agents