Skip to content

[FA] feat: read group_version_kind from UPDATER_TASK.params#2958

Draft
coignetp wants to merge 1 commit intopaul/fa-fixup-tasksfrom
paul/fa-gvk-from-task
Draft

[FA] feat: read group_version_kind from UPDATER_TASK.params#2958
coignetp wants to merge 1 commit intopaul/fa-fixup-tasksfrom
paul/fa-gvk-from-task

Conversation

@coignetp
Copy link
Copy Markdown
Contributor

Stacked on #2952.

Summary

  • Added group_version_kind field to experimentParams (parsed from UPDATER_TASK.params)
  • resolveOperation now reads GVK from task params instead of hardcoding datadoghq.com/v2alpha1/DatadogAgent
  • Falls back to the hardcoded default when the field is absent (backward compat for old tasks)
  • Updated TestStartDatadogAgentExperiment_NoDDAOperation to assert on task params GVK (since that's now the authoritative source)
  • Added TestResolveOperation_GVKFromTaskParams and TestResolveOperation_GVKFallback

Test plan

  • go test ./pkg/fleet/... -run TestResolveOperation
  • go test ./pkg/fleet/...

🤖 Generated with Claude Code

…f hardcoded default

Add `group_version_kind` to `experimentParams` so the backend can specify
the target GVK per task. `resolveOperation` now assigns GVK from task params
before validation, falling back to `datadoghq.com/v2alpha1/DatadogAgent` for
tasks that predate this field.
@coignetp coignetp requested review from a team as code owners April 29, 2026 13:38
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2c3eb6c89e

ℹ️ 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".

Comment thread pkg/fleet/daemon.go
Comment on lines +199 to +203
gvk := req.Params.GroupVersionKind
if gvk.Kind == "" {
gvk = v2alpha1.GroupVersion.WithKind("DatadogAgent")
}
op.GroupVersionKind = gvk
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Validate installer config GVK before overriding it

Overwriting op.GroupVersionKind from task params before validateOperation means the installer config’s own group_version_kind is no longer checked at all. If an INSTALLER_CONFIG operation is malformed or targets another kind, this path now rewrites it to DatadogAgent (or any task-provided kind) and proceeds, so a mismatched patch can be applied to the DatadogAgent instead of failing fast. This is a behavioral regression from the prior flow where invalid operation kinds in config were rejected.

Useful? React with 👍 / 👎.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 41.00%. Comparing base (7b91959) to head (2c3eb6c).

Additional details and impacted files

Impacted file tree graph

@@                   Coverage Diff                   @@
##           paul/fa-fixup-tasks    #2958      +/-   ##
=======================================================
- Coverage                41.35%   41.00%   -0.36%     
=======================================================
  Files                      327      324       -3     
  Lines                    29310    28763     -547     
=======================================================
- Hits                     12121    11793     -328     
+ Misses                   16321    16115     -206     
+ Partials                   868      855      -13     
Flag Coverage Δ
unittests 41.00% <100.00%> (-0.36%) ⬇️

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

Files with missing lines Coverage Δ
pkg/fleet/daemon.go 71.91% <100.00%> (+0.29%) ⬆️
pkg/fleet/remote_config.go 100.00% <ø> (ø)

... and 7 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 7b91959...2c3eb6c. Read the comment docs.

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

@datadog-datadog-prod-us1-2
Copy link
Copy Markdown

Code Coverage

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 41.11% (-0.31%)

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

@coignetp coignetp marked this pull request as draft April 29, 2026 13:53
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.

2 participants