Skip to content

Agent Mesh

Fix presubmits

Antonio Ojeae45b15082801
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index 7139bd56..49d2d8d8 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -36,4 +36,4 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- run: sudo make test
- run: make lint
-
+ - run: make verify
diff --git a/.golangci.yml b/.golangci.yml
new file mode 100644
index 00000000..90d56b3e
--- /dev/null
+++ b/.golangci.yml
@@ -0,0 +1,22 @@
+version: 2
+
+linters:
+ enable:
+ - goheader
+
+linters-settings:
+ goheader:
+ template: |-
+ Copyright {{ YEAR }} Google LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/Makefile b/Makefile
index fc940cb8..13745ba3 100644
--- a/Makefile
+++ b/Makefile
@@ -46,5 +46,9 @@ test-e2e-container: build
lint:
hack/lint.sh
+.PHONY: verify
+verify:
+ ./hack/verify-generated.sh
+
update:
go mod tidy
diff --git a/hack/verify-generated.sh b/hack/verify-generated.sh
new file mode 100755
index 00000000..07853037
--- /dev/null
+++ b/hack/verify-generated.sh
@@ -0,0 +1,47 @@
+#!/usr/bin/env bash
+# Copyright 2026 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -o errexit
+set -o nounset
+set -o pipefail
+
+REPO_ROOT=$(git rev-parse --show-toplevel)
+TMP_DIR=$(mktemp -d)
+
+echo "Creating temporary worktree at ${TMP_DIR}..."
+git worktree add -f "${TMP_DIR}" HEAD
+
+# Ensure cleanup on exit
+cleanup() {
+ echo "Cleaning up worktree..."
+ git worktree remove -f "${TMP_DIR}" || true
+ rm -rf "${TMP_DIR}"
+}
+trap cleanup EXIT
+
+# Move to worktree root
+cd "${TMP_DIR}"
+
+echo "Running code generation..."
+./hack/gen-proto.sh
+
+echo "Checking for differences..."
+if ! git diff --exit-code; then
+ echo "ERROR: Generated code is not up to date."
+ echo "Please run ./hack/gen-proto.sh locally and commit the changes."
+ exit 1
+fi
+
+echo "Generated code is up to date."