Skip to content

Commit b3163ed

Browse files
authored
Merge branch 'main' into jszwedko/disable-rust-toolchain-renovate-updates
2 parents adfb733 + 8f8c45d commit b3163ed

476 files changed

Lines changed: 34632 additions & 13324 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.

.claude/skills/config-system/SKILL.md

Lines changed: 50 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,12 @@ into `SalukiConfiguration`.
4949
| Legacy test registry, legacy smoke test support, doc gen | `lib/datadog-agent/config-testing/` |
5050
| Hand-written Datadog witness implementation | `lib/agent-data-plane-config-system/src/translators/datadog_translator.rs` |
5151
| Saluki-only source model and `seed` | `lib/agent-data-plane-config-system/src/saluki_only.rs` |
52+
| Saluki-only defaults | `lib/agent-data-plane-config/src/defaults.rs` |
5253
| Runtime loading and authority selection | `lib/agent-data-plane-config-system/src/loaded.rs` |
5354
| Translation gate and update loop | `lib/agent-data-plane-config-system/src/system.rs` |
55+
| Schema-driven environment reader (Datadog keys) | `lib/datadog-agent/config/src/env_reader.rs` |
56+
| Figment provider wrapping that reader | `lib/datadog-agent/config/src/env_provider.rs` |
57+
| Same provider, plus Saluki-only keys | `lib/agent-data-plane-config-system/src/env_provider.rs` |
5458

5559
Paths and type names can move. Notify the user when this skill needs an update.
5660

@@ -93,6 +97,27 @@ Use the following command to regenerate it:
9397
make build-schema-overlay
9498
```
9599

100+
## Environment variables and key shape
101+
102+
The Datadog Agent does not derive a variable's name from its key path: it looks up each known key's
103+
declared variable names. `DD_PROXY_HTTP` reaches `proxy.http` while `DD_DOGSTATSD_PORT` reaches the
104+
flat `dogstatsd_port`, and nothing in either name marks the nesting boundary. No separator
105+
convention can reproduce this, so both configuration paths read the environment through the
106+
generated tables instead:
107+
108+
- the typed path via `apply_datadog_env` plus the Saluki-only reader, and
109+
- the by-key path via `EnvironmentProvider`, a Figment provider wrapping those same readers.
110+
111+
**Every source therefore delivers the Agent's canonical shape.** A struct deserialized from
112+
`GenericConfiguration` **MUST** read that shape. Do not add a `#[serde(rename)]` or `#[serde(alias)]`
113+
that maps a nested key onto a flattened spelling, and do not reintroduce a key-alias or
114+
environment-remapping table. Those existed once, only ran on file load, and so never applied to the
115+
Datadog Agent's configuration stream — which is the authority in the Core Agent deployment.
116+
117+
Reserve `#[serde(flatten)]` for a struct that genuinely groups several *top-level* Agent keys (for
118+
example, the forwarder's `forwarder_*` retry settings). Name a Rust field after its canonical
119+
section rather than renaming it onto one.
120+
96121
## Saluki-only values
97122

98123
Values absent from the Datadog schema reach `SalukiConfiguration` through the `SalukiOnly` source
@@ -107,16 +132,16 @@ Keep the authoritative Datadog path and delete the duplicate Saluki-only path.
107132

108133
Exactly one layer owns each default:
109134

110-
| Source class | Model type | Default owner | Translation behavior |
111-
|--------------|-------------|---------------------------------------|----------------------------------|
112-
| Saluki-only | `Option<T>` | No default | `seed` preserves `None` |
113-
| Saluki-only | `T` | One declaration beside the model type | `seed` assigns configured values |
114-
| Witnessed | `T` | Generated Datadog schema default | `drive` always writes it |
115-
| Witnessed | `Option<T>` | No default | `drive` preserves `None` |
135+
| Source class | Model type | Default owner | Translation behavior |
136+
|--------------|-------------|------------------------------------------------|-----------------------------------|
137+
| Saluki-only | `Option<T>` | No default | `seed` preserves `None` |
138+
| Saluki-only | `T` | `agent-data-plane-config/src/defaults.rs` | `seed` assigns the resolved value |
139+
| Witnessed | `T` | Generated Datadog schema default | `drive` always writes it |
140+
| Witnessed | `Option<T>` | No default | `drive` preserves `None` |
116141

117-
For a Saluki-only default, use `#[serde(default = "...")]` with a nearby constant or function. If
118-
the component requires a value, model `T`; use `Option<T>` only when absence is meaningful to the
119-
component, not to defer its default.
142+
Define each Saluki-only default once in `lib/agent-data-plane-config/src/defaults.rs`; source and
143+
model defaults must reference that definition rather than restating its value. If the component
144+
requires a value, model `T`; use `Option<T>` only when absence is meaningful, not to defer a default.
120145

121146
Push source parsing, defaults, and input validation to the configuration boundary. Components keep
122147
only validation that is truly business logic.
@@ -158,9 +183,14 @@ the witnessed model.
158183

159184
1. Verify that the key is absent from `schema_overlay.yaml`.
160185
2. Add its destination to the correct `SalukiConfiguration` slice.
161-
3. Add the exact source hierarchy and a reliable parsing type to `SalukiOnly`.
162-
4. Add one `seed` assignment to the destination.
163-
5. (legacy): Keep `SALUKI_KEYS` consistent with the source key, type, and default.
186+
3. If it has a default, define it once in `agent-data-plane-config/src/defaults.rs` and reference it
187+
from the model and source defaults.
188+
4. Add the exact source hierarchy and a reliable parsing type to `SalukiOnly`. A **nested** key
189+
*requires* this even when its only consumer reads the by-key view: the Saluki-only environment
190+
reader discovers its paths from `SalukiOnly`, and it is the sole source that places `DD_FOO_BAR`
191+
at `foo.bar`. Without a field, the key is silently unreachable from the environment.
192+
5. Add one `seed` assignment to the destination.
193+
6. (legacy): Keep `SALUKI_KEYS` consistent with the source key, type, and default.
164194

165195
### Migrate a raw consumer
166196

@@ -174,12 +204,17 @@ the witnessed model.
174204
5. Add any missing model, witness, or seed path with the workflows above.
175205
6. Change static construction to accept borrowed typed slices. For dynamic behavior, pass a narrow
176206
`Live<T>` and rebuild the reactive state after `changed()`.
177-
7. Remove source serde, Datadog key names, raw-map access, key watches, parsing, and configuration
178-
defaults from the component.
207+
7. Remove source serde, Datadog key names, raw-map access, key watches, parsing, configuration
208+
defaults, and code made unused by the cutover. `#[allow(dead_code)]` is not an acceptable way to
209+
retain migration residue.
179210
8. Update topology call sites and tests. Preserve behavior tests using typed inputs; remove tests
180211
only when they tested legacy deserialization and nothing else.
212+
- Do *not* rename `from_configuration`. Just change its signature to take typed configuration.
181213
9. Remove the component's `run_config_smoke_tests` invocation once it no longer deserializes from
182-
`GenericConfiguration`. Keep `used_by`; it drives legacy smoke-test codegen.
214+
`GenericConfiguration`. Replace migrated structs in the `used_by` field with
215+
`TYPED_CONFIG_SYSTEM`.
216+
10. Higher risk cutovers should be tested with correctness or integration tests that exercise the
217+
affected configurations.
183218

184219
A cutover should be behaviorally transparent. If the old behavior conflicts with the source schema
185220
or typed-system invariants, surface the conflict rather than silently choosing one.

.datadog-agent-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.81.1
1+
7.82.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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/saluki@sha256:74acb389d1ec4c6d44b910054086e89fa74d31261a64867ff37f97b3230a31f4"
4+
"image": "registry.ddbuild.io/workspaces/prebuilt/datadog/saluki@sha256:64aa6699654e73a664984b210a95c50ede74766dadfec5c8b05c3c1352911564"
55
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"forwardPorts": [22],
2121
"features": {
2222
// Campaigner update PRs should take care of bumping those versions
23-
"registry.ddbuild.io/workspaces/features/base:0.4.123652803": {},
23+
"registry.ddbuild.io/workspaces/features/base:0.4.127729119": {},
2424
"registry.ddbuild.io/workspaces/features/claude-code:0.1.123639528": {},
2525
"registry.ddbuild.io/workspaces/features/trajectory:0.1.121704661": {},
2626
// ADP-specific setup

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# NDJSON fixtures are byte-compared with compressed streams and must not be translated to CRLF.
2+
*.ndjson text eol=lf

.github/workflows/bump-adp-version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
echo "release_type=$RELEASE_TYPE" >> $GITHUB_OUTPUT
4848
4949
- name: Checkout repository
50-
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
50+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
5151
with:
5252
token: "${{ steps.octo-sts.outputs.token }}"
5353
ref: ${{ steps.release-info.outputs.target_branch }}

.github/workflows/docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ jobs:
99
generate-docs-site:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
12+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
1313
- name: Set up Node 23
14-
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
14+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
1515
with:
1616
node-version: 23
1717
- name: Build documentation
@@ -28,15 +28,15 @@ jobs:
2828
generate-api-docs:
2929
runs-on: ubuntu-latest
3030
steps:
31-
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
31+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3232
- name: Install Protobuf Compiler
3333
run: |
3434
sudo apt-get update
3535
sudo apt-get install -y protobuf-compiler
3636
# `make generate-api-docs` installs and pins the nightly toolchain it needs (see
3737
# RUST_NIGHTLY_VERSION in the Makefile); this step just provides Rust 1.94 and rustup/cargo.
3838
- name: Set up Rust 1.94
39-
uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17
39+
uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
4040
with:
4141
toolchain: 1.94.0
4242
cache: false

.github/workflows/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
scope: DataDog/saluki
1717
policy: self.labeler
1818

19-
- uses: actions/labeler@f27b608878404679385c85cfa523b85ccb86e213 # v6.1.0
19+
- uses: actions/labeler@bf12e9b00b37c5c0ca2b87b79b2daf7891dbda13 # v7.0.0
2020
with:
2121
repo-token: "${{ steps.octo-sts.outputs.token }}"
2222
sync-labels: true

.github/workflows/renovate-sync-licenses.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656

5757
# Head branch (not merge commit) so we can push back to it.
5858
- name: Checkout PR branch
59-
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
59+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
6060
with:
6161
ref: ${{ github.head_ref }}
6262
token: "${{ steps.octo-sts.outputs.token }}"
@@ -65,7 +65,7 @@ jobs:
6565
# rustflags cleared to suppress the action's default
6666
# -D warnings.
6767
- name: Set up Rust toolchain
68-
uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17
68+
uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
6969
with:
7070
cache: false
7171
rustflags: ""

.github/workflows/update-agent-version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
policy: self.update-agent-version.create-pr
2020

2121
- name: Checkout repository
22-
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
22+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2323
with:
2424
token: "${{ steps.octo-sts.outputs.token }}"
2525

0 commit comments

Comments
 (0)