Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ASCII-2077] upgrade golangci-lint to a version that support module plugin #28022

Merged
merged 32 commits into from
Aug 2, 2024

Conversation

GustavoCaso
Copy link
Member

@GustavoCaso GustavoCaso commented Jul 29, 2024

What does this PR do?

Upgrade golangci-lint to version 1.57.0 https://golangci-lint.run/product/changelog/#v1570

This is part of the effort of adding custom Go lang linters. We need to use a version that supports the new module plugin for writing custom linters.

If you want to have a look at a PoC that uses the module plugin system, you can! #27033

I fixed the revive warnings using custom script that uses the JSON output of golanci-lint and revive https://github.com/DataDog/experimental/pull/3532

Motivation

Additional Notes

Possible Drawbacks / Trade-offs

Describe how to test/QA your changes

@GustavoCaso GustavoCaso changed the title upgrade golangc-lint to a version taht support module plugin [ASCII-2077] upgrade golangc-lint to a version that support module plugin Jul 29, 2024
@GustavoCaso GustavoCaso added changelog/no-changelog qa/no-code-change No code change in Agent code requiring validation labels Jul 29, 2024
@GustavoCaso GustavoCaso added this to the 7.57.0 milestone Jul 29, 2024
@pr-commenter
Copy link

pr-commenter bot commented Jul 29, 2024

Regression Detector

Regression Detector Results

Run ID: 234e1934-378d-4211-8511-d5caf793ff4e Metrics dashboard Target profiles

Baseline: 3952fb4
Comparison: 10957a8

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

No significant changes in experiment optimization goals

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

There were no significant changes in experiment optimization goals at this confidence level and effect size tolerance.

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI links
tcp_syslog_to_blackhole ingress throughput +2.47 [-10.71, +15.66] Logs
idle memory utilization +0.58 [+0.54, +0.61] Logs
uds_dogstatsd_to_api_cpu % cpu utilization +0.46 [-0.43, +1.36] Logs
basic_py_check % cpu utilization +0.36 [-2.18, +2.91] Logs
otel_to_otel_logs ingress throughput +0.14 [-0.67, +0.95] Logs
uds_dogstatsd_to_api ingress throughput +0.00 [-0.00, +0.00] Logs
tcp_dd_logs_filter_exclude ingress throughput -0.00 [-0.01, +0.01] Logs
pycheck_1000_100byte_tags % cpu utilization -0.57 [-5.39, +4.25] Logs
file_tree memory utilization -0.58 [-0.65, -0.50] Logs

Explanation

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

@GustavoCaso GustavoCaso changed the title [ASCII-2077] upgrade golangc-lint to a version that support module plugin [ASCII-2077] upgrade golangci-lint to a version that support module plugin Jul 29, 2024
@GustavoCaso GustavoCaso force-pushed the upgrade-golangci-lint branch from 37f7fdc to b192792 Compare July 29, 2024 16:52
@GustavoCaso GustavoCaso force-pushed the upgrade-golangci-lint branch 5 times, most recently from 858c6e0 to 3b53c26 Compare July 30, 2024 15:00
@GustavoCaso GustavoCaso force-pushed the upgrade-golangci-lint branch from 3b53c26 to 2b1d24b Compare July 30, 2024 15:34
@GustavoCaso GustavoCaso requested review from a team as code owners August 2, 2024 09:48
@GustavoCaso GustavoCaso requested a review from a team August 2, 2024 09:48
@GustavoCaso GustavoCaso requested review from a team as code owners August 2, 2024 09:48
@GustavoCaso GustavoCaso requested review from dinooliva and a team August 2, 2024 09:48
@FlorentClarret FlorentClarret merged commit 1039270 into main Aug 2, 2024
361 of 363 checks passed
@FlorentClarret FlorentClarret deleted the upgrade-golangci-lint branch August 2, 2024 09:51
Copy link
Member

@davidor davidor left a comment

Choose a reason for hiding this comment

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

From the container-platform files, changes look good because it's mostly replacing unused vars with "_". However, there are many TODOs that should be deleted, I only pointed out a few.

@@ -162,7 +162,7 @@ func makeFlare(w http.ResponseWriter, r *http.Request, statusComponent status.Co
}

//nolint:revive // TODO(CINT) Fix revive linter
func getConfigCheck(w http.ResponseWriter, r *http.Request, ac autodiscovery.Component) {
func getConfigCheck(w http.ResponseWriter, _ *http.Request, ac autodiscovery.Component) {
Copy link
Member

Choose a reason for hiding this comment

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

We should remove the TODO here

@@ -46,7 +46,7 @@ type MockProvider struct {
}

//nolint:revive // TODO(AML) Fix revive linter
func (p *MockProvider) Collect(ctx context.Context) ([]integration.Config, error) {
func (p *MockProvider) Collect(_ context.Context) ([]integration.Config, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Delete the TODO and also in the other 2 occurrences of this file

@@ -72,14 +72,14 @@ func (s *dummyService) IsReady(context.Context) bool {
// HasFilter returns false
//
//nolint:revive // TODO(AML) Fix revive linter
func (s *dummyService) HasFilter(filter containers.FilterType) bool {
func (s *dummyService) HasFilter(_ containers.FilterType) bool {
Copy link
Member

Choose a reason for hiding this comment

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

Delete TODO

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.

4 participants