fix(docs): replace deprecated atomic fetch_update with try_update - #2007
Conversation
Newer Rust toolchains renamed `Atomic*::fetch_update` to `try_update`. Under `#![deny(warnings)]`, the deprecation warning breaks the nightly `make generate-api-docs` build. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ca26b84efc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
loom 0.7 does not have `try_update` on its `AtomicUsize`; only std does (it was renamed from `fetch_update`). Use cfg(feature = "loom") to call `fetch_update` under loom and `try_update` otherwise. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Binary Size Analysis (Agent Data Plane)Baseline: 92cb9bd · Comparison: 69898d0 · diff ✅ Binary size difference within thresholdChanges by Module
Detailed Symbol Changes |
This comment has been minimized.
This comment has been minimized.
Regression Detector (Agent Data Plane)Run ID: Optimization Goals: ✅ No significant changes detectedFine details of change detection per experiment (5)Experiments configured
Bounds Checks: ✅ Passed (5)
ExplanationA change is flagged as a regression when |Δ mean %| > 5.00% in the regressing direction for its optimization goal AND SMP marks the experiment as a regression ( |
nightly-2025-06-16 predates the stabilization of `atomic_try_update`, so `try_update` on `AtomicUsize` fails to compile under that toolchain. Bumping to 2026-07-05 picks up the stabilization and unblocks Miri CI. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Introduce RUST_NIGHTLY_VERSION variable so generate-api-docs and test-miri share a single pinned nightly version. Previously: - generate-api-docs used bare +nightly (always latest) - test-miri used +nightly-2026-07-05 (pinned) This mismatch was confusing and easy to get out of sync. New structure: - RUST_NIGHTLY_VERSION := nightly-2026-07-05 defined once in Makefile - Both targets reference $(RUST_NIGHTLY_VERSION) - New `ensure-rust-nightly` target installs the pinned toolchain - `ensure-rust-miri` now depends on ensure-rust-nightly + adds miri component - `generate-api-docs` now depends on ensure-rust-nightly (auto-installs for local dev, mirroring how miri works) - docs.yml workflow now installs stable (make handles nightly version), making the Makefile the single source of truth To update the nightly version in the future, change RUST_NIGHTLY_VERSION in one place and both targets + CI pick up the change automatically. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Resolve conflict in .github/workflows/docs.yml: adopt main's updated action pin (v1.17) while keeping our changes (comment, renamed step, toolchain: stable). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Related to #2007, adapted for the 1.1.0 toolchain. Newer nightly toolchains deprecate Atomic*::fetch_update in favor of try_update. Because make generate-api-docs runs cargo +nightly doc and the affected crates have #![deny(warnings)], the deprecation is promoted to a hard error, breaking the CI generate-api-docs job. The main-branch fix (#2007) switched to try_update, but that method isn't stable on the 1.93.0 toolchain pinned on this branch. Instead, suppress the deprecation with #[allow(deprecated)] at the three call sites, keeping fetch_update (stable here) while letting the nightly doc build pass. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Related to #2007, adapted for the 1.1.0 toolchain. Newer nightly toolchains deprecate Atomic*::fetch_update in favor of try_update. Because make generate-api-docs runs cargo +nightly doc and the affected crates have #![deny(warnings)], the deprecation is promoted to a hard error, breaking the CI generate-api-docs job. The main-branch fix (#2007) switched to try_update, but that method isn't stable on the 1.93.0 toolchain pinned on this branch. Instead, suppress the deprecation with #[allow(deprecated)] at the three call sites, keeping fetch_update (stable here) while letting the nightly doc build pass. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
## Summary Release-prep PR for **ADP 1.2.3** on `releases/1.2.x`. Bumps the version and bundles four fixes. Because 1.2.x is on Rust 1.96.0 (same as `main`), the `fetch_update` fix could be cherry-picked directly rather than needing the `#[allow(deprecated)]` workaround used on 1.1.0. 1. **Honor `site` when `dd_url` equals the default-derived URL** — corresponds to #2028 (`7ec65f2`). The Core Agent's config stream sends `dd_url` at its schema default (`https://app.datadoghq.com`) for every configuration, even when the operator only set `site`, so ADP routed all traffic to the US1 intake and `site` was effectively ignored (#1965). A `dd_url` equal to the default-derived URL is now filtered to `None` at deserialization, letting `site` determine the endpoint. `set_dd_url` bypasses serde and is unaffected. Adapted to the 1.2.x code (no `configured_primary_endpoint`), so the change is confined to the `dd_url` deserializer plus tests. 2. **Unblock the nightly `generate-api-docs` build** — cherry-pick of #2007 (`917e05f`). Newer nightly toolchains deprecate `Atomic*::fetch_update`; under `#![deny(warnings)]`, `cargo +nightly doc` turns that into a hard error. Since 1.2.x uses the 1.96.0 toolchain (where `try_update` is stable), the three call sites switch to `try_update`, matching `main`. (The `fixed_size.rs` hunk from the original commit was dropped — that method doesn't exist on 1.2.x and has no `fetch_update` to fix.) 3. **Update `anyhow`** — cherry-pick of #1945 (`bc51393`). Bumps `anyhow` 1.0.102 → 1.0.103 in `Cargo.lock` to unblock `check deny`. (The `2a7be76` hash is the gh-pages docs artifact for that PR; `bc51393` is the source commit.) 4. **Bump `crossbeam-epoch` to 0.9.20** — fresh fix for RUSTSEC-2026-0204. `crossbeam-epoch 0.9.18` (an invalid pointer dereference in the `fmt::Pointer` impl for `Atomic`/`Shared`) fails `check-deny`. This is a repo-wide issue; the equivalent fix for `main` is #2038. Applied directly here (semver-compatible, lockfile-only bump) rather than cherry-picked, since it landed on the release branches in parallel with the main PR. Plus a `chore(dev): Bump ADP to 1.2.3` commit updating `bin/agent-data-plane/Cargo.toml` and the lockfile. ## Test plan - New unit tests for the `dd_url`/`site` resolution (default filtered → `None`; explicit override wins; `set_dd_url` never filtered; end-to-end `build_primary_endpoint` for both cases). - `make check-deny` passes with the crossbeam-epoch bump. - `cargo check` passes for the affected crates on the pinned `1.96.0` toolchain, including the `try_update` call sites. Fixes #1965. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: webern <matt.briggs@datadoghq.com> Co-authored-by: jesse.szwedko <jesse.szwedko@datadoghq.com>
Summary
Newer Rust nightly toolchains renamed
Atomic*::fetch_updatetotry_updatefor consistency. Becausemake generate-api-docsrunscargo +nightly docand all affected crates have#![deny(warnings)], the deprecation is promoted to a hard error, breaking the CIgenerate-api-docsjob.This replaces all three
fetch_updatecall sites withtry_update. The new name is available on both the nightly used bymake generate-api-docsand the pinned stable1.96.0toolchain used for regular builds, checks, and tests.Test plan
make generate-api-docspasses on the updated nightly (1.99.0-nightly 2026-07-05).cargo +1.96.0 check --testspasses for the affected crates.🤖 Generated with Claude Code