Skip to content

Commit 4e02e07

Browse files
committed
Merge remote-tracking branch 'origin/main' into dd/vuln-92045-external-metric-namespace-20260729
2 parents 8c31e64 + 95ac563 commit 4e02e07

964 files changed

Lines changed: 23532 additions & 9588 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/injector-dev/SKILL.md

Lines changed: 482 additions & 0 deletions
Large diffs are not rendered by default.

.bazelignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
# inside of arm64 Linux containers.
77
bazel-datadog-agent/
88
bazel-testlogs/
9+
hard-coded-generation/

.bazelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ common:cache:frontend --remote_cache=grpcs://buildbarn-frontend-datadog-agent.us
9898
common:cache --config=cache:frontend
9999
common:cache --noremote_upload_local_results
100100

101+
# Explicit local-only config: disable the remote cache while keeping the
102+
# wrapper-injected --disk_cache. Use `--config=no-remote-cache` (or
103+
# DD_BAZEL_REMOTE_CACHE=off) to opt out of tools/bazel auto-selection.
104+
common:no-remote-cache --remote_cache=
105+
101106
# CI config ------------------------------------------------------------------------------------------------------------
102107
common:ci --config=adms
103108
common:ci --config=lint

.dda/extend/commands/run/docs/build/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from typing import TYPE_CHECKING
44

55
import click
6-
76
from dda.cli.base import dynamic_command, pass_app
87

98
if TYPE_CHECKING:
@@ -19,9 +18,9 @@ def cmd(app: Application, *, check: bool) -> None:
1918
"""
2019
from dda.utils.fs import Path
2120
from dda.utils.process import EnvVars
22-
2321
from utils.docs.constants import SOURCE_DATE_EPOCH
2422
from utils.docs.deps import DEPENDENCIES
23+
from utils.docs.links import check_links
2524

2625
group_dir = Path(__file__).parent.parent
2726
venv_path = app.config.storage.join("venvs", group_dir.id).data
@@ -38,5 +37,7 @@ def cmd(app: Application, *, check: bool) -> None:
3837
cache_marker.parent.mkdir(parents=True, exist_ok=True)
3938
cache_marker.touch()
4039

41-
if check:
42-
app.subprocess.exit_with(["lychee", "--config", ".lychee.toml", "site"], env=env_vars)
40+
# CI runs `dda run docs check-links` as a step of its own instead, so that a rotted link on
41+
# somebody else's site is reported separately from documentation that fails to build.
42+
if check:
43+
check_links(app)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from __future__ import annotations
2+
3+
from typing import TYPE_CHECKING
4+
5+
from dda.cli.base import dynamic_command, pass_app
6+
7+
if TYPE_CHECKING:
8+
from dda.cli.application import Application
9+
10+
11+
@dynamic_command(short_help="Check documentation links")
12+
@pass_app
13+
def cmd(app: Application) -> None:
14+
"""
15+
Check the links of the built documentation.
16+
"""
17+
from utils.docs.links import check_links
18+
19+
check_links(app)

.dda/extend/commands/run/docs/serve/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from typing import TYPE_CHECKING
44

55
import click
6-
76
from dda.cli.base import dynamic_command, pass_app
87

98
if TYPE_CHECKING:
@@ -20,7 +19,6 @@ def cmd(app: Application, *, port: int, launch: bool) -> None:
2019
"""
2120
from dda.utils.fs import Path
2221
from dda.utils.process import EnvVars
23-
2422
from utils.docs.constants import SOURCE_DATE_EPOCH
2523
from utils.docs.deps import DEPENDENCIES
2624

.dda/extend/pythonpath/utils/docs/deps.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"zensical~=0.0.50",
55
# Fetching data
66
"httpx",
7-
# Validation
8-
"lychee-bin~=0.24.2",
97
)
8+
9+
# Kept out of the build's dependencies so that a local build or serve never unpacks a checker it
10+
# does not use.
11+
LINK_CHECKER = "lychee-bin~=0.24.2"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from __future__ import annotations
2+
3+
from pathlib import Path
4+
5+
6+
def check_links(app) -> None:
7+
"""Resolve every link of the built documentation, exiting with the checker's status."""
8+
from utils.docs.deps import LINK_CHECKER
9+
10+
site_dir = Path("site")
11+
if not site_dir.is_dir():
12+
app.abort(f"No documentation to check at `{site_dir}`, run `dda run docs build` first")
13+
14+
# Isolated so that the checker never enters the environment the documentation is built with, and
15+
# never resolves to a `lychee` that happens to be installed elsewhere.
16+
lychee_command = ["lychee", "--config", ".lychee.toml", str(site_dir)]
17+
app.tools.uv.exit_with(["tool", "run", "--isolated", "--from", LINK_CHECKER, *lychee_command])
Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
// This devcontainer directs workspaces to use a pre-built image. To make
22
// configuration changes, edit prebuild-devcontainer.json in this folder instead
33
{
4-
"image": "registry.ddbuild.io/workspaces/prebuilt/datadog/datadog-agent@sha256:23a853a5e181b86b01bb82f55c2b1fd35f3b614a52e2b1d5db27e2f057ec7948"
4+
"image": "registry.ddbuild.io/workspaces/prebuilt/datadog/datadog-agent@sha256:5d8bf28b3e932c6e5e25cccc32f283a6cff9ddb475346f132c36b0a5ae81975d",
5+
"runArgs": [
6+
"--pid=host",
7+
"--cgroupns=host",
8+
//"-v",
9+
//"/etc/passwd:/etc/passwd",
10+
//"-v",
11+
//"/etc/group:/etc/group",
12+
// WARNING: This mounts the entire host filesystem (read-only) into the container.
13+
// When an AI coding agent runs inside, it can
14+
// autonomously read any host file — SSH keys, cloud credentials, shell history,
15+
// browser secrets — without explicit user action, and may include them in context
16+
// sent to a remote model. Only use on machines that do not hold high-value secrets.
17+
// Justified because system-probe and eBPF development require host filesystem
18+
// visibility to mirror what the Datadog Agent does in production.
19+
"-v",
20+
"/:/host/root:ro",
21+
"-v",
22+
"/sys/kernel/debug:/sys/kernel/debug",
23+
"-v",
24+
"/etc/os-release:/etc/os-release",
25+
],
526
}

.devcontainer/datadog/default/prebuild-devcontainer.json

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,24 @@
1212
"forwardPorts": [22],
1313
"containerUser": "root",
1414
"remoteUser": "bits",
15-
"waitFor": "postStartCommand"
15+
"waitFor": "postStartCommand",
16+
"securityOpt": [
17+
"apparmor:unconfined"
18+
],
19+
"capAdd": [
20+
"SYS_ADMIN",
21+
"SYS_RESOURCE",
22+
"SYS_PTRACE",
23+
"NET_ADMIN",
24+
"NET_BROADCAST",
25+
"NET_RAW",
26+
"IPC_LOCK",
27+
"CHOWN",
28+
"KILL"
29+
],
30+
"containerEnv": {
31+
"HOST_ROOT": "/host/root",
32+
"HOST_PROC": "/host/root/proc",
33+
"HOST_SYS": "/host/root/sys"
34+
}
1635
}

0 commit comments

Comments
 (0)