Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2952 +/- ##
==========================================
+ Coverage 40.91% 41.35% +0.44%
==========================================
Files 324 327 +3
Lines 28743 29310 +567
==========================================
+ Hits 11760 12121 +361
- Misses 16129 16321 +192
- Partials 854 868 +14
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 7 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
🎯 Code Coverage (details) 🔗 Commit SHA: 7b91959 | Docs | Datadog PR Page | Give us feedback! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f30fbac802
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| stable, _ := d.getPackageConfigVersions(req.Package) | ||
| d.setPackageConfigVersions(req.Package, stable, "") |
There was a problem hiding this comment.
Preserve promoted version on no-op promote
Update the no-op promote path to carry forward the promoted config into StableConfigVersion before clearing ExperimentConfigVersion. In the recover-after-restart case (status already Promoted, installer state still stable=S, experiment=E), this code currently writes stable=S, experiment="", which drops the promoted version E even though it is now live. That leaves backend/operator state inconsistent and can cause later expected_state checks and task planning to use the wrong baseline.
Useful? React with 👍 / 👎.
…-back phase When `promoteDatadogAgentExperiment` hits the no-op branch, it previously always cleared the experiment config version. If the phase was already `Promoted` (e.g. after a daemon crash between status update and `setPackageConfigVersions`), the experiment version should move to stable instead so the backend's expected_state baseline stays correct.
Re-do of #2913.
What does this PR do?
Read the target
DatadogAgentnamespace/name from theUPDATER_TASKparams directly (via a newparseTaskNSNhelper) for start, stop, and promote operations, instead of storing it in aexperimentTargetfield on the daemon struct.Motivation
Previously, stop and promote operations relied on
d.experimentTargetbeing set by a prior start call. This stateful approach was fragile — if the daemon restarted between start and stop/promote, the target was lost. Carrying the name in every task payload makes each operation self-contained and idempotent.Additional Notes
experimentTarget types.NamespacedNamefield from the daemon struct.NamespacedNameis now a field ofexperimentParams(carried in the task itself).validateOperationtests for empty name/namespace are replaced byparseTaskNSNtests.Minimum Agent Versions
No minimum version requirements.
Describe your test plan
Unit tests in
pkg/fleet/daemon_test.goandpkg/fleet/remote_config_test.goare updated to passNamespacedNameinsideexperimentParams. NewTestParseTaskNSN_*tests cover the valid, missing-name, and missing-namespace cases.Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel