Skip to content
Open
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
1 change: 1 addition & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ nogo(
"//pkg/testutils/lint/passes/grpcstatuswithdetails",
"//pkg/testutils/lint/passes/hash",
"//pkg/testutils/lint/passes/leaktestcall",
"//pkg/testutils/lint/passes/metricmetadatainit",
"//pkg/testutils/lint/passes/nilness",
"//pkg/testutils/lint/passes/nocopy",
"//pkg/testutils/lint/passes/redactcheck",
Expand Down
11 changes: 11 additions & 0 deletions build/bazelutil/nogo_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -1654,5 +1654,16 @@
"external/": "exclude all third-party code for all analyzers",
"pkg/sql/colexec/colexechash/hash\\.go$": "re-implements runtime.noescape for efficient hashing"
}
},
"metricmetadatainit": {
"exclude_files": {
"external/": "exclude all third-party code",
".*\\.pb\\.go$": "generated code",
".*\\.pb\\.gw\\.go$": "generated code",
"pkg/.*\\.eg\\.go$": "generated code",
"pkg/.*_generated\\.go$": "generated code",
"pkg/util/metric/.*\\.go$": "metric package internal usage is allowed",
"pkg/testutils/": "test utilities may construct Metadata for testing"
}
}
}
4 changes: 0 additions & 4 deletions build/github/check-generated-code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ if grep TODO DEPS.bzl; then
fi
check_workspace_clean "Run \`./dev generate bazel\` to fix this error."

# Run gen-metric-owners to ensure metric_owners.yaml is up to date
# before //pkg/gen regenerates metrics.yaml from it.
bazel run //pkg/cmd/gen-metric-owners $ENGFLOW_ARGS -- -out="$(pwd)/pkg/internal/metricscan/metric_owners.yaml"

# Run `bazel run //pkg/gen` and ensure nothing changes. This ensures
# generated documentation and checked-in go code are up to date.
bazel run //pkg/gen $ENGFLOW_ARGS
Expand Down
5 changes: 1 addition & 4 deletions docs/generated/metrics/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
genrule(
name = "metrics",
srcs = [
"//pkg/internal/metricscan:metric_owners.yaml",
],
outs = ["metrics.yaml"],
cmd = "$(location //pkg/cmd/cockroach-short) gen metric-list --logtostderr=NONE --metric-owners=$(location //pkg/internal/metricscan:metric_owners.yaml) > $@",
cmd = "$(location //pkg/cmd/cockroach-short) gen metric-list --logtostderr=NONE > $@",
tools = ["//pkg/cmd/cockroach-short"],
visibility = [
":__pkg__",
Expand Down
Loading
Loading