Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2026-01-12T10:23:28Z by kres 0e8da31.
# Generated on 2026-04-28T10:33:12Z by kres e4dc583.

*
!cmd
Expand All @@ -12,3 +12,4 @@
!README.md
!.markdownlint.json
!hack/govulncheck.sh
!.disvulncheck.yaml

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.dockerignore whitelists .disvulncheck.yaml, but that file doesn’t appear to exist in the repo. If dis-vulncheck is expected to use a repo config file, it should be added to the PR (and/or referenced explicitly); otherwise this exception should be removed to avoid confusion about what’s included in the Docker build context.

Suggested change
!.disvulncheck.yaml

Copilot uses AI. Check for mistakes.
28 changes: 18 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2026-01-12T10:23:28Z by kres 0e8da31.
# Generated on 2026-04-28T10:33:12Z by kres e4dc583.

concurrency:
group: ${{ github.head_ref || github.run_id }}
Expand Down Expand Up @@ -55,17 +55,25 @@ jobs:
done
continue-on-error: true
- name: checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # version: v6.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # version: v6.0.2
- name: Unshallow
run: |
git fetch --prune --unshallow
- name: Set up Docker Buildx
id: setup-buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # version: v3.12.0
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # version: v4.0.0
with:
driver: remote
endpoint: tcp://buildkit-amd64.ci.svc.cluster.local:1234
timeout-minutes: 10
- name: CI temp release tag
if: github.event_name == 'pull_request'
run: |
make ci-temp-release-tag
- name: Check dirty
if: github.event_name == 'pull_request'
run: |
make check-dirty
- name: base
run: |
make base
Expand All @@ -74,7 +82,7 @@ jobs:
make conform
- name: Login to registry
if: github.event_name != 'pull_request'
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # version: v3.6.0
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # version: v4.1.0
with:
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
Expand Down Expand Up @@ -108,7 +116,7 @@ jobs:
make release-notes
- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # version: v2.5.0
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # version: v3.0.0
with:
body_path: _out/RELEASE_NOTES.md
draft: "true"
Expand Down Expand Up @@ -148,13 +156,13 @@ jobs:
done
continue-on-error: true
- name: checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # version: v6.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # version: v6.0.2
- name: Unshallow
run: |
git fetch --prune --unshallow
- name: Set up Docker Buildx
id: setup-buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # version: v3.12.0
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # version: v4.0.0
with:
driver: remote
endpoint: tcp://buildkit-amd64.ci.svc.cluster.local:1234
Expand Down Expand Up @@ -195,13 +203,13 @@ jobs:
done
continue-on-error: true
- name: checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # version: v6.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # version: v6.0.2
- name: Unshallow
run: |
git fetch --prune --unshallow
- name: Set up Docker Buildx
id: setup-buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # version: v3.12.0
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # version: v4.0.0
with:
driver: remote
endpoint: tcp://buildkit-amd64.ci.svc.cluster.local:1234
Expand All @@ -213,7 +221,7 @@ jobs:
run: |
make unit-tests-race
- name: coverage
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # version: v5.5.2
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # version: v6.0.0
with:
files: _out/coverage-unit-tests.txt
flags: unit-tests
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/slack-notify-ci-failure.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2026-01-12T10:23:28Z by kres 0e8da31.
# Generated on 2026-04-28T10:33:12Z by kres e4dc583.

"on":
workflow_run:
Expand All @@ -18,7 +18,7 @@ jobs:
if: github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.event != 'pull_request'
steps:
- name: Slack Notify
uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a # version: v2.1.1
uses: slackapi/slack-github-action@03ea5433c137af7c0495bc0cad1af10403fc800c # version: v3.0.2
with:
method: chat.postMessage
payload: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/slack-notify.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2026-01-12T10:23:28Z by kres 0e8da31.
# Generated on 2026-04-28T10:33:12Z by kres e4dc583.

"on":
workflow_run:
Expand All @@ -23,7 +23,7 @@ jobs:
run: |
echo pull_request_number=$(gh pr view -R ${{ github.repository }} ${{ github.event.workflow_run.head_repository.owner.login }}:${{ github.event.workflow_run.head_branch }} --json number --jq .number) >> $GITHUB_OUTPUT
- name: Slack Notify
uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a # version: v2.1.1
uses: slackapi/slack-github-action@03ea5433c137af7c0495bc0cad1af10403fc800c # version: v3.0.2
with:
method: chat.postMessage
payload: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2026-01-12T10:23:28Z by kres 0e8da31.
# Generated on 2026-04-28T10:33:12Z by kres e4dc583.

"on":
schedule:
Expand All @@ -15,7 +15,7 @@ jobs:
- ubuntu-latest
steps:
- name: Close stale issues and PRs
uses: actions/stale@997185467fa4f803885201cee163a9f38240193d # version: v10.1.1
uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # version: v10.2.0
with:
close-issue-message: This issue was closed because it has been stalled for 7 days with no activity.
days-before-issue-close: "5"
Expand Down
3 changes: 2 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2026-01-12T10:23:28Z by kres 0e8da31.
# Generated on 2026-04-28T10:33:12Z by kres e4dc583.

version: "2"

Expand All @@ -9,6 +9,7 @@ run:
modules-download-mode: readonly
issues-exit-code: 1
tests: true
build-tags: []

# output configuration options
output:
Expand Down
18 changes: 10 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# syntax = docker/dockerfile-upstream:1.20.0-labs
# syntax = docker/dockerfile-upstream:1.23.0-labs

# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2026-01-12T10:23:28Z by kres 0e8da31.
# Generated on 2026-04-28T10:33:12Z by kres e4dc583.

ARG TOOLCHAIN=scratch

FROM ghcr.io/siderolabs/ca-certificates:v1.12.0 AS image-ca-certificates
FROM ghcr.io/siderolabs/ca-certificates:v1.13.0 AS image-ca-certificates

FROM ghcr.io/siderolabs/fhs:v1.12.0 AS image-fhs
FROM ghcr.io/siderolabs/fhs:v1.13.0 AS image-fhs

# runs markdownlint
FROM docker.io/oven/bun:1.3.5-alpine AS lint-markdown
FROM docker.io/oven/bun:1.3.13-alpine AS lint-markdown
WORKDIR /src
RUN bun i markdownlint-cli@0.47.0 sentences-per-line@0.5.0
RUN bun i markdownlint-cli@0.48.0 sentences-per-line@0.5.2
COPY .markdownlint.json .
COPY ./CHANGELOG.md ./CHANGELOG.md
COPY ./README.md ./README.md
Expand Down Expand Up @@ -41,6 +41,9 @@ RUN --mount=type=cache,target=/root/.cache/go-build,id=conform/root/.cache/go-bu
&& mv /go/bin/golangci-lint /bin/golangci-lint
RUN --mount=type=cache,target=/root/.cache/go-build,id=conform/root/.cache/go-build --mount=type=cache,target=/go/pkg,id=conform/go/pkg go install golang.org/x/vuln/cmd/govulncheck@latest \
&& mv /go/bin/govulncheck /bin/govulncheck
ARG DIS_VULNCHECK_VERSION
RUN --mount=type=cache,target=/root/.cache/go-build,id=conform/root/.cache/go-build --mount=type=cache,target=/go/pkg,id=conform/go/pkg go install github.com/shanduur/dis-vulncheck@${DIS_VULNCHECK_VERSION} \
&& mv /go/bin/dis-vulncheck /bin/dis-vulncheck
ARG GOFUMPT_VERSION
RUN go install mvdan.cc/gofumpt@${GOFUMPT_VERSION} \
&& mv /go/bin/gofumpt /bin/gofumpt
Expand Down Expand Up @@ -87,8 +90,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build,id=conform/root/.cache/go-bu
# runs govulncheck
FROM base AS lint-govulncheck
WORKDIR /src
Comment thread
smira marked this conversation as resolved.
COPY --chmod=0755 hack/govulncheck.sh ./hack/govulncheck.sh
RUN --mount=type=cache,target=/root/.cache/go-build,id=conform/root/.cache/go-build --mount=type=cache,target=/go/pkg,id=conform/go/pkg ./hack/govulncheck.sh ./...
RUN --mount=type=cache,target=/root/.cache/go-build,id=conform/root/.cache/go-build --mount=type=cache,target=/go/pkg,id=conform/go/pkg dis-vulncheck -tool=false ./...

# runs unit-tests with race detector
FROM base AS unit-tests-race
Expand Down
45 changes: 36 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2026-01-12T10:23:28Z by kres 0e8da31.
# Generated on 2026-04-28T10:33:12Z by kres e4dc583.

# common variables

SHA := $(shell git describe --match=none --always --abbrev=8 --dirty)
TAG := $(shell git describe --tag --always --dirty --match v[0-9]\*)
TAG ?= $(shell git describe --tag --always --dirty --match v[0-9]\*)
TAG_SUFFIX ?=
ABBREV_TAG := $(shell git describe --tags >/dev/null 2>/dev/null && git describe --tag --always --match v[0-9]\* --abbrev=0 || echo 'undefined')
ABBREV_TAG ?= $(shell git describe --tags >/dev/null 2>/dev/null && git describe --tag --always --match v[0-9]\* --abbrev=0 || echo 'undefined')
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
ARTIFACTS := _out
IMAGE_TAG ?= $(TAG)$(TAG_SUFFIX)
OPERATING_SYSTEM := $(shell uname -s | tr '[:upper:]' '[:lower:]')
GOARCH := $(shell uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/')
CI_RELEASE_TAG := $(shell git log --oneline --format=%B -n 1 HEAD^2 -- 2>/dev/null | head -n 1 | sed -r "/^release\(.*\)/ s/^release\((.*)\):.*$$/\\1/; t; Q")
Comment thread
smira marked this conversation as resolved.
WITH_DEBUG ?= false
WITH_RACE ?= false
REGISTRY ?= ghcr.io
USERNAME ?= siderolabs
REGISTRY_AND_USERNAME ?= $(REGISTRY)/$(USERNAME)
PROTOBUF_GO_VERSION ?= 1.36.11
GRPC_GO_VERSION ?= 1.6.0
GRPC_GATEWAY_VERSION ?= 2.27.4
GRPC_GO_VERSION ?= 1.6.1
GRPC_GATEWAY_VERSION ?= 2.29.0
VTPROTOBUF_VERSION ?= 0.6.0
GOIMPORTS_VERSION ?= 0.40.0
GOIMPORTS_VERSION ?= 0.44.0
GOMOCK_VERSION ?= 0.6.0
DEEPCOPY_VERSION ?= v0.5.8
GOLANGCILINT_VERSION ?= v2.7.2
GOLANGCILINT_VERSION ?= v2.11.4
GOFUMPT_VERSION ?= v0.9.2
GO_VERSION ?= 1.25.5
GO_VERSION ?= 1.26.2
DIS_VULNCHECK_VERSION ?= v0.0.0-20260409114749-05440f84fe69
GO_BUILDFLAGS ?=
GO_BUILDTAGS ?= ,
GO_LDFLAGS ?=
Expand Down Expand Up @@ -75,8 +77,9 @@ COMMON_ARGS += --build-arg=GOMOCK_VERSION="$(GOMOCK_VERSION)"
COMMON_ARGS += --build-arg=DEEPCOPY_VERSION="$(DEEPCOPY_VERSION)"
COMMON_ARGS += --build-arg=GOLANGCILINT_VERSION="$(GOLANGCILINT_VERSION)"
COMMON_ARGS += --build-arg=GOFUMPT_VERSION="$(GOFUMPT_VERSION)"
COMMON_ARGS += --build-arg=DIS_VULNCHECK_VERSION="$(DIS_VULNCHECK_VERSION)"
COMMON_ARGS += --build-arg=TESTPKGS="$(TESTPKGS)"
TOOLCHAIN ?= docker.io/golang:1.25-alpine
TOOLCHAIN ?= docker.io/golang:1.26-alpine

# help menu

Expand Down Expand Up @@ -153,6 +156,14 @@ $(ARTIFACTS): ## Creates artifacts directory.
clean: ## Cleans up all artifacts.
@rm -rf $(ARTIFACTS)

.PHONY: ci-temp-release-tag
ci-temp-release-tag: ## Generates a temporary release tag for CI run.
@if [ -n "$(CI_RELEASE_TAG)" -a -n "$${GITHUB_ENV}" ]; then \
echo Setting temporary release tag "$(CI_RELEASE_TAG)"; \
echo "TAG=$(CI_RELEASE_TAG)" >> "$${GITHUB_ENV}"; \
echo "ABBREV_TAG=$(CI_RELEASE_TAG)" >> "$${GITHUB_ENV}"; \
fi

target-%: ## Builds the specified target defined in the Dockerfile. The build result will only remain in the build cache.
@$(BUILD) --target=$* $(COMMON_ARGS) $(TARGET_ARGS) $(CI_ARGS) .

Expand All @@ -171,6 +182,10 @@ local-%: ## Builds the specified target defined in the Dockerfile using the loc
fi; \
done'

.PHONY: check-dirty
check-dirty: generate
@if test -n "`git status --porcelain`"; then echo "Source tree is dirty"; git status; git diff; exit 1 ; fi

generate: ## Generate .proto definitions.
@$(MAKE) local-$@ DEST=./

Expand Down Expand Up @@ -270,3 +285,15 @@ conformance:
@docker pull $(CONFORMANCE_IMAGE)
@docker run --rm -it -v $(PWD):/src -w /src $(CONFORMANCE_IMAGE) enforce

.PHONY: renovate-local
renovate-local: ## runs renovate locally to check syntax and test configuration
@docker run --rm \
--user $(shell id -u):$(shell id -g) \
-v $(PWD):/src \
-w /src \
-e GITHUB_TOKEN \
-e LOG_LEVEL=debug \
-e RENOVATE_PLATFORM=local \
-e RENOVATE_DRY_RUN=full \
renovate/renovate
Comment thread
smira marked this conversation as resolved.

2 changes: 2 additions & 0 deletions cmd/conform/enforce.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var enforceCmd = &cobra.Command{

// Get the config path value
configPath := cmd.Flags().Lookup("config").Value.String()

e, err := enforcer.New(configPath, reporter)
if err != nil {
return fmt.Errorf("failed to create enforcer: %w", err)
Expand All @@ -51,6 +52,7 @@ var enforceCmd = &cobra.Command{
if err != nil {
return fmt.Errorf("failed to detect main branch: %w", err)
}

if mainBranch != "" {
opts = append(opts, policy.WithCommitRef(fmt.Sprintf("refs/heads/%s", mainBranch)))
}
Expand Down
5 changes: 5 additions & 0 deletions cmd/conform/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,15 @@ var serveCmd = &cobra.Command{

return
}

if err = os.MkdirAll(filepath.Join(dir, "repo"), 0o700); err != nil {
log.Printf("failed to create repo directory: %+v\n", err)

return
}

event := filepath.Join(dir, "github", "event.json")

pullRequestEvent := &github.PullRequestEvent{}
if err = json.Unmarshal(payload, pullRequestEvent); err != nil {
log.Printf("failed to parse pull_request event: %+v\n", err)
Expand Down Expand Up @@ -131,17 +133,20 @@ var serveCmd = &cobra.Command{

return
}

cmd := exec.Command("/proc/self/exe", "enforce", "--reporter=github", "--commit-ref=refs/heads/"+pullRequestEvent.GetPullRequest().GetBase().GetRef())
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stdout
cmd.Dir = cloneRepo
cmd.Env = []string{fmt.Sprintf("INPUT_TOKEN=%s", os.Getenv("INPUT_TOKEN")), fmt.Sprintf("GITHUB_EVENT_PATH=%s", event)}

err = cmd.Start()
if err != nil {
log.Printf("failed to start command: %+v\n", err)

return
}

err = cmd.Wait()
if err != nil {
log.Printf("command failed: %+v\n", err)
Expand Down
Loading
Loading