Skip to content

Detect stale generated files in CI

Mikhail Mazurskiy requested to merge ash2k/check-stale-files into master

Closes #67 (closed).

This MR does two things:

  • Introduces a new CI image for the test/etc job because the old one is based on https://github.com/GoogleCloudPlatform/container-definitions, which is not being maintained anymore. It's also hard to add things to it - we need go and make in it to run mock regeneration, etc.
  • Adds a verify-ci make target to regenerate everything and check for any uncommitted changes.

Example failed build: https://gitlab.com/gitlab-org/cluster-integration/gitlab-agent/-/jobs/1518828210

error: uncommitted changes detected:
diff --git a/internal/tool/tlstool/BUILD.bazel b/internal/tool/tlstool/BUILD.bazel
index 5123c64..30befd6 100644
--- a/internal/tool/tlstool/BUILD.bazel
+++ b/internal/tool/tlstool/BUILD.bazel
@@ -1,7 +1,7 @@
 load("@io_bazel_rules_go//go:def.bzl", "go_library")
 
 go_library(
-      name = "tlstool",
+    name = "tlstool",
     srcs = ["tlstool.go"],
     importpath = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v14/internal/tool/tlstool",
     visibility = ["//:__subpackages__"],
make: *** [Makefile:88: test-ci] Error 1
Edited by Mikhail Mazurskiy

Merge request reports