Skip to content

[FA] Read name from UPDATER_TASK#2913

Closed
coignetp wants to merge 17 commits intomainfrom
paul/fa-read-names-from-task
Closed

[FA] Read name from UPDATER_TASK#2913
coignetp wants to merge 17 commits intomainfrom
paul/fa-read-names-from-task

Conversation

@coignetp
Copy link
Copy Markdown
Contributor

@coignetp coignetp commented Apr 17, 2026

What does this PR do?

Read the target DatadogAgent namespace/name from the UPDATER_TASK params directly (via a new parseTaskNSN helper) for start, stop, and promote operations, instead of storing it in a experimentTarget field on the daemon struct.

Motivation

Previously, stop and promote operations relied on d.experimentTarget being 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

  • Removes the experimentTarget types.NamespacedName field from the daemon struct.
  • NamespacedName is now a field of experimentParams (carried in the task itself).
  • validateOperation tests for empty name/namespace are replaced by parseTaskNSN tests.

Minimum Agent Versions

No minimum version requirements.

Describe your test plan

Unit tests in pkg/fleet/daemon_test.go and pkg/fleet/remote_config_test.go are updated to pass NamespacedName inside experimentParams. New TestParseTaskNSN_* tests cover the valid, missing-name, and missing-namespace cases.

Checklist

  • PR has at least one valid label: bug, enhancement, refactoring, documentation, tooling, and/or dependencies
  • PR has a milestone or the qa/skip-qa label
  • All commits are signed (see: signing commits)

@datadog-official
Copy link
Copy Markdown

datadog-official Bot commented Apr 17, 2026

Code Coverage

Fix all issues with BitsAI

🛑 Gate Violations

🎯 1 Code Coverage issue detected

A Patch coverage percentage gate may be blocking this PR.

Patch coverage: 63.16% (threshold: 80.00%)

ℹ️ Info

🎯 Code Coverage (details)
Patch Coverage: 63.16%
Overall Coverage: 40.57%

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: f3aad2b | Docs | Datadog PR Page | Give us feedback!

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 17, 2026

Codecov Report

❌ Patch coverage is 65.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.50%. Comparing base (a816a2a) to head (f3aad2b).

Files with missing lines Patch % Lines
pkg/fleet/daemon.go 46.15% 3 Missing and 4 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@                      Coverage Diff                       @@
##           khewonc/experiment-signals    #2913      +/-   ##
==============================================================
- Coverage                       40.54%   40.50%   -0.04%     
==============================================================
  Files                             321      320       -1     
  Lines                           28514    28395     -119     
==============================================================
- Hits                            11560    11501      -59     
+ Misses                          16107    16048      -59     
+ Partials                          847      846       -1     
Flag Coverage Δ
unittests 40.50% <65.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
pkg/fleet/experiment.go 84.61% <100.00%> (+0.94%) ⬆️
pkg/fleet/remote_config.go 100.00% <ø> (ø)
pkg/fleet/daemon.go 64.98% <46.15%> (-0.48%) ⬇️

... and 4 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a816a2a...f3aad2b. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coignetp coignetp added this to the v1.27.0 milestone Apr 20, 2026
@coignetp coignetp modified the milestones: v1.27.0, v1.26.0 Apr 20, 2026
Base automatically changed from khewonc/experiment-signals to main April 23, 2026 14:09
@coignetp coignetp closed this Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants