Conversation
Signed-off-by: Wassim DHIF <wassim.dhif@datadoghq.com>
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (22.22%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #2906 +/- ##
==========================================
- Coverage 40.03% 39.99% -0.04%
==========================================
Files 319 320 +1
Lines 28066 28120 +54
==========================================
+ Hits 11235 11247 +12
- Misses 16008 16050 +42
Partials 823 823
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Adds Datadog Dashboard support to the DatadogGenericResource (DDGR) flow so dashboards can be managed declaratively via spec.type=dashboard and a raw JSON payload in spec.jsonSpec.
Changes:
- Extend DDGR supported resource types to include
dashboard(API types, validation, CRD schemas). - Add a
DashboardHandlerwired into the DDGR controller dispatch and Datadog generic client. - Add unit tests for dashboard status population and handler selection.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/datadogclient/client.go | Adds DashboardsApi to the generic Datadog client initialization and struct. |
| internal/controller/datadoggenericresource/controller.go | Wires the dashboards client into the reconciler and credential refresh path. |
| internal/controller/datadoggenericresource/utils.go | Routes spec.type=dashboard to the new DashboardHandler. |
| internal/controller/datadoggenericresource/dashboards.go | Implements create/get/update/delete operations for dashboards and status population. |
| internal/controller/datadoggenericresource/dashboards_test.go | Adds unit tests for dashboard status updates and handler selection. |
| api/datadoghq/v1alpha1/datadoggenericresource_types.go | Adds the Dashboard enum value and updates kubebuilder validation enum. |
| api/datadoghq/v1alpha1/datadoggenericresource_validation.go | Allows dashboard as a valid DDGR resource type. |
| config/crd/bases/v1/datadoghq.com_datadoggenericresources.yaml | Adds dashboard to the CRD enum list (YAML). |
| config/crd/bases/v1/datadoghq.com_datadoggenericresources_v1alpha1.json | Adds dashboard to the CRD enum list (JSON). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9aa31b0f9e
ℹ️ 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".
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Wassim DHIF <wassim.dhif@datadoghq.com>
3f1ae8b to
aedb981
Compare
What does this PR do?
Adds dashboard as a supported resource type in the
DatadogGenericResourceCRD, allowing users to manage Datadog Dashboards declaratively via a Kubernetes CR with a raw JSON spec.Motivation
The
DatadogGenericResourceCRD gives users full flexibility over the dashboard payload viajsonSpec.Additional Notes
Minimum Agent Versions
N/A, this is an Operator-only change with no Agent or Cluster Agent dependency.
Describe your test plan
Tested end-to-end on a local minikube cluster
Also validated with unit tests.
Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel