datadog-operator icon indicating copy to clipboard operation
datadog-operator copied to clipboard

Refactor utility functions related to pointers

Open shuheiktgw opened this issue 9 months ago • 1 comments

What does this PR do?

Most of the pointer-related utility functions have been deprecated due to the introduction of generics. In this PR, I've refactored the code and removed most of them.

Motivation

Cleaning up the codebase.

Additional Notes

N/A

Minimum Agent Versions

N/A

Describe your test plan

N/A

Checklist

  • [x] 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

shuheiktgw avatar Feb 19 '25 07:02 shuheiktgw

Codecov Report

:x: Patch coverage is 69.55224% with 102 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 49.30%. Comparing base (bd4ad0b) to head (002b257). :warning: Report is 284 commits behind head on main.

Files with missing lines Patch % Lines
internal/controller/testutils/agent.go 0.00% 64 Missing :warning:
pkg/testutils/builder.go 89.89% 10 Missing :warning:
...adogagent/component/clusterchecksrunner/default.go 0.00% 4 Missing :warning:
pkg/constants/utils.go 0.00% 4 Missing :warning:
...troller/datadogagent/controller_reconcile_agent.go 0.00% 1 Missing and 1 partial :warning:
...ontroller/datadogagent/controller_reconcile_ccr.go 0.00% 0 Missing and 2 partials :warning:
...atadogagent/feature/kubernetesstatecore/feature.go 60.00% 1 Missing and 1 partial :warning:
...nternal/controller/datadogagent/override/global.go 66.66% 1 Missing and 1 partial :warning:
internal/controller/datadogagent/utils.go 0.00% 2 Missing :warning:
...ontroller/datadogagent/controller_reconcile_dca.go 0.00% 0 Missing and 1 partial :warning:
... and 9 more

:x: Your patch status has failed because the patch coverage (69.55%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1710      +/-   ##
==========================================
- Coverage   49.30%   49.30%   -0.01%     
==========================================
  Files         219      219              
  Lines       21298    21292       -6     
==========================================
- Hits        10501    10498       -3     
+ Misses      10250    10248       -2     
+ Partials      547      546       -1     
Flag Coverage Δ
unittests 49.30% <69.55%> (-0.01%) :arrow_down:

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

Files with missing lines Coverage Δ
...controller/datadogagent/component/agent/default.go 79.35% <100.00%> (ø)
...ler/datadogagent/component/clusteragent/default.go 96.89% <100.00%> (ø)
...nal/controller/datadogagent/feature/asm/feature.go 71.21% <100.00%> (ø)
...roller/datadogagent/feature/autoscaling/feature.go 72.91% <100.00%> (ø)
...ller/datadogagent/feature/clusterchecks/feature.go 62.04% <100.00%> (ø)
...al/controller/datadogagent/feature/cspm/feature.go 75.20% <100.00%> (ø)
...ntroller/datadogagent/feature/ebpfcheck/feature.go 83.60% <100.00%> (ø)
...er/datadogagent/feature/eventcollection/feature.go 62.31% <100.00%> (ø)
...er/datadogagent/feature/externalmetrics/feature.go 54.16% <100.00%> (ø)
...nal/controller/datadogagent/feature/gpu/feature.go 90.47% <100.00%> (ø)
... and 36 more

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 bd4ad0b...002b257. Read the comment docs.

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

codecov-commenter avatar Feb 19 '25 07:02 codecov-commenter

This pull request has been automatically marked as stale because it has not had activity in the past 15 days.

It will be closed in 30 days if no further activity occurs. If this pull request is still relevant, adding a comment or pushing new commits will keep it open. Also, you can always reopen the pull request if you missed the window.

Thank you for your contributions!

dd-octo-sts[bot] avatar Oct 13 '25 10:10 dd-octo-sts[bot]

This pull request has been automatically marked as stale because it has not had activity in the past 15 days.

It will be closed in 30 days if no further activity occurs. If this pull request is still relevant, adding a comment or pushing new commits will keep it open. Also, you can always reopen the pull request if you missed the window.

Thank you for your contributions!

dd-octo-sts[bot] avatar Nov 10 '25 10:11 dd-octo-sts[bot]