Skip to content

Commit d5553fa

Browse files
authored
Merge branch 'main' into pgimalac/bump-testify
2 parents 0787c54 + 36cedee commit d5553fa

File tree

12 files changed

+285
-12
lines changed

12 files changed

+285
-12
lines changed

.github/workflows/report-merged-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
echo "Last commit message: $COMMIT_MESSAGE"
3434
3535
# Extract PR number from format "(#1234)" in commit message
36-
PR_NUMBER=$(echo "$COMMIT_MESSAGE" | grep -oE '\(#[0-9]+\)' | grep -oE '[0-9]+')
36+
PR_NUMBER="$(echo "$COMMIT_MESSAGE" | grep -oE '\(#[0-9]+\)' | grep -oE '[0-9]+' | tail -n 1)"
3737
3838
# If no PR number found in commit message, exit with error
3939
if [ -z "$PR_NUMBER" ]; then

MODULE.bazel

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,16 @@ bazel_dep(name = "rules_pkg", version = "1.1.0")
1111
## Prebuilt binaries ##
1212
#########################
1313

14-
bazel_dep(name = "buildifier_prebuilt", version = "8.2.0.2", dev_dependency = True)
14+
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
15+
16+
http_archive(
17+
name = "com_github_bazelbuild_buildtools",
18+
patch_strip = 1,
19+
patches = ["//bazel/patches:buildifier.patch"],
20+
sha256 = "53119397bbce1cd7e4c590e117dcda343c2086199de62932106c80733526c261",
21+
strip_prefix = "buildtools-8.2.1",
22+
urls = ["https://github.com/bazelbuild/buildtools/archive/refs/tags/v8.2.1.tar.gz"],
23+
)
1524

1625
bazel_dep(name = "rules_multitool", version = "1.9.0")
1726

MODULE.bazel.lock

Lines changed: 140 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bazel/buildifier/BUILD.bazel

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("@buildifier_prebuilt//:rules.bzl", "buildifier", "buildifier_test")
1+
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier", "buildifier_test")
22

33
exclude_patterns = [
44
"./.bazelbsp/**",
@@ -7,6 +7,7 @@ exclude_patterns = [
77

88
buildifier(
99
name = "buildifier",
10+
buildifier = "@multitool//tools/buildifier",
1011
exclude_patterns = exclude_patterns,
1112
lint_mode = "fix",
1213
mode = "fix",
@@ -19,6 +20,7 @@ buildifier(
1920
# - requires additional arguments: `no_sandbox` and `workspace`
2021
buildifier_test(
2122
name = "test",
23+
buildifier = "@multitool//tools/buildifier",
2224
exclude_patterns = exclude_patterns,
2325
lint_mode = "warn",
2426
lint_warnings = ["-module-docstring"],

bazel/patches/buildifier.patch

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff --git a/buildifier/BUILD.bazel b/buildifier/BUILD.bazel
2+
index 1f1cd67..2f2a5b1 100644
3+
--- a/buildifier/BUILD.bazel
4+
+++ b/buildifier/BUILD.bazel
5+
@@ -1,3 +1,4 @@
6+
+INHIBITED_IN_FAVOR_OF_PREBUILT = """
7+
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
8+
load("@rules_shell//shell:sh_test.bzl", "sh_test")
9+
10+
@@ -108,6 +109,7 @@ go_library(
11+
"//wspace",
12+
],
13+
)
14+
+"""
15+
16+
exports_files(
17+
[

bazel/prebuilt_buildtools.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,59 @@
11
{
2+
"buildifier": {
3+
"version": "v8.2.1",
4+
"binaries": [
5+
{
6+
"kind": "file",
7+
"url": "https://github.com/bazelbuild/buildtools/releases/download/v8.2.1/buildifier-darwin-amd64",
8+
"sha256": "9f8cffceb82f4e6722a32a021cbc9a5344b386b77b9f79ee095c61d087aaea06",
9+
"os": "macos",
10+
"cpu": "x86_64",
11+
"size": 7776816,
12+
"published_at": "2025-06-10T13:25:35Z",
13+
"asset_url": "https://api.github.com/repos/bazelbuild/buildtools/releases/assets/262636654"
14+
},
15+
{
16+
"kind": "file",
17+
"url": "https://github.com/bazelbuild/buildtools/releases/download/v8.2.1/buildifier-darwin-arm64",
18+
"sha256": "cfab310ae22379e69a3b1810b433c4cd2fc2c8f4a324586dfe4cc199943b8d5a",
19+
"os": "macos",
20+
"cpu": "arm64",
21+
"size": 7717890,
22+
"published_at": "2025-06-10T13:25:35Z",
23+
"asset_url": "https://api.github.com/repos/bazelbuild/buildtools/releases/assets/262636658"
24+
},
25+
{
26+
"kind": "file",
27+
"url": "https://github.com/bazelbuild/buildtools/releases/download/v8.2.1/buildifier-linux-amd64",
28+
"sha256": "6ceb7b0ab7cf66fceccc56a027d21d9cc557a7f34af37d2101edb56b92fcfa1a",
29+
"os": "linux",
30+
"cpu": "x86_64",
31+
"size": 7882884,
32+
"published_at": "2025-06-10T13:25:35Z",
33+
"asset_url": "https://api.github.com/repos/bazelbuild/buildtools/releases/assets/262636637"
34+
},
35+
{
36+
"kind": "file",
37+
"url": "https://github.com/bazelbuild/buildtools/releases/download/v8.2.1/buildifier-linux-arm64",
38+
"sha256": "3baa1cf7eb41d51f462fdd1fff3a6a4d81d757275d05b2dd5f48671284e9a1a5",
39+
"os": "linux",
40+
"cpu": "arm64",
41+
"size": 7755744,
42+
"published_at": "2025-06-10T13:25:35Z",
43+
"asset_url": "https://api.github.com/repos/bazelbuild/buildtools/releases/assets/262636641"
44+
},
45+
{
46+
"kind": "file",
47+
"url": "https://github.com/bazelbuild/buildtools/releases/download/v8.2.1/buildifier-windows-amd64.exe",
48+
"sha256": "802104da0bcda0424a397ac5be0004c372665a70289a6d5146e652ee497c0dc6",
49+
"os": "windows",
50+
"cpu": "x86_64",
51+
"size": 8020480,
52+
"published_at": "2025-06-10T13:25:35Z",
53+
"asset_url": "https://api.github.com/repos/bazelbuild/buildtools/releases/assets/262636662"
54+
}
55+
]
56+
},
257
"buildozer": {
358
"version": "v8.2.1",
459
"binaries": [

pkg/commonchecks/corechecks.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ import (
3131
"github.com/DataDog/datadog-agent/pkg/collector/corechecks/containers/generic"
3232
"github.com/DataDog/datadog-agent/pkg/collector/corechecks/containers/kubelet"
3333
"github.com/DataDog/datadog-agent/pkg/collector/corechecks/discovery"
34-
"github.com/DataDog/datadog-agent/pkg/collector/corechecks/ebpf"
35-
"github.com/DataDog/datadog-agent/pkg/collector/corechecks/ebpf/oomkill"
36-
"github.com/DataDog/datadog-agent/pkg/collector/corechecks/ebpf/tcpqueuelength"
3734
"github.com/DataDog/datadog-agent/pkg/collector/corechecks/embed/apm"
3835
"github.com/DataDog/datadog-agent/pkg/collector/corechecks/embed/process"
3936
"github.com/DataDog/datadog-agent/pkg/collector/corechecks/gpu"
@@ -93,11 +90,8 @@ func RegisterChecks(store workloadmeta.Component, filterStore workloadfilter.Com
9390
corecheckLoader.RegisterCheck(ksm.CheckName, ksm.Factory(tagger, store))
9491
corecheckLoader.RegisterCheck(helm.CheckName, helm.Factory())
9592
corecheckLoader.RegisterCheck(pod.CheckName, pod.Factory(store, cfg, tagger))
96-
corecheckLoader.RegisterCheck(ebpf.CheckName, ebpf.Factory())
9793
corecheckLoader.RegisterCheck(gpu.CheckName, gpu.Factory(tagger, telemetry, store))
9894
corecheckLoader.RegisterCheck(ecs.CheckName, ecs.Factory(store, tagger))
99-
corecheckLoader.RegisterCheck(oomkill.CheckName, oomkill.Factory(tagger))
100-
corecheckLoader.RegisterCheck(tcpqueuelength.CheckName, tcpqueuelength.Factory(tagger))
10195
corecheckLoader.RegisterCheck(apm.CheckName, apm.Factory())
10296
corecheckLoader.RegisterCheck(process.CheckName, process.Factory())
10397
if cfg.GetBool("use_networkv2_check") {
@@ -128,4 +122,6 @@ func RegisterChecks(store workloadmeta.Component, filterStore workloadfilter.Com
128122
corecheckLoader.RegisterCheck(discovery.CheckName, discovery.Factory())
129123
corecheckLoader.RegisterCheck(versa.CheckName, versa.Factory())
130124
corecheckLoader.RegisterCheck(ncm.CheckName, ncm.Factory(cfg))
125+
126+
registerSystemProbeChecks(tagger)
131127
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed
2+
// under the Apache License Version 2.0.
3+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
// Copyright 2016-present Datadog, Inc.
5+
6+
// This combination of build tags ensures that this file is only included Agents that are not the Cluster Agent
7+
//go:build !(clusterchecks && kubeapiserver) && !systemprobechecks
8+
9+
// Package commonchecks contains shared checks for multiple agent components
10+
package commonchecks
11+
12+
import tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def"
13+
14+
func registerSystemProbeChecks(_ tagger.Component) {
15+
// nothing to do here, this build doesn't include system-probe based checks
16+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed
2+
// under the Apache License Version 2.0.
3+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
// Copyright 2016-present Datadog, Inc.
5+
6+
// This combination of build tags ensures that this file is only included Agents that are not the Cluster Agent
7+
//go:build !(clusterchecks && kubeapiserver) && systemprobechecks
8+
9+
// Package commonchecks contains shared checks for multiple agent components
10+
package commonchecks
11+
12+
import (
13+
tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def"
14+
corecheckLoader "github.com/DataDog/datadog-agent/pkg/collector/corechecks"
15+
"github.com/DataDog/datadog-agent/pkg/collector/corechecks/ebpf"
16+
"github.com/DataDog/datadog-agent/pkg/collector/corechecks/ebpf/oomkill"
17+
"github.com/DataDog/datadog-agent/pkg/collector/corechecks/ebpf/tcpqueuelength"
18+
)
19+
20+
func registerSystemProbeChecks(tagger tagger.Component) {
21+
corecheckLoader.RegisterCheck(ebpf.CheckName, ebpf.Factory())
22+
corecheckLoader.RegisterCheck(oomkill.CheckName, oomkill.Factory(tagger))
23+
corecheckLoader.RegisterCheck(tcpqueuelength.CheckName, tcpqueuelength.Factory(tagger))
24+
}

tasks/build_tags.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"serverless",
5959
"serverlessfips", # used for FIPS mode in the serverless build in datadog-lambda-extension
6060
"systemd",
61+
"systemprobechecks", # used to include system-probe based checks in the agent build
6162
"test", # used for unit-tests
6263
"trivy",
6364
"trivy_no_javadb",
@@ -96,6 +97,7 @@
9697
"podman",
9798
"python",
9899
"systemd",
100+
"systemprobechecks",
99101
"trivy",
100102
"trivy_no_javadb",
101103
"zk",

0 commit comments

Comments
 (0)