Skip to content

PMM-7 Fix staticcheck and noerrcheck linter warnings#5408

Open
maxkondr wants to merge 35 commits into
v3from
PMM-7-linter-fixes
Open

PMM-7 Fix staticcheck and noerrcheck linter warnings#5408
maxkondr wants to merge 35 commits into
v3from
PMM-7-linter-fixes

Conversation

@maxkondr
Copy link
Copy Markdown
Contributor

@maxkondr maxkondr self-assigned this May 22, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

Codecov Report

❌ Patch coverage is 17.64706% with 42 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.62%. Comparing base (7fccd1e) to head (d9153ad).
⚠️ Report is 1 commits behind head on v3.

Files with missing lines Patch % Lines
managed/models/software_version_helpers.go 16.66% 4 Missing and 1 partial ⚠️
...ent/agents/postgres/pgstatmonitor/pgstatmonitor.go 0.00% 4 Missing ⚠️
managed/services/agents/jobs.go 0.00% 4 Missing ⚠️
admin/commands/config.go 0.00% 1 Missing and 1 partial ⚠️
.../inventory/add_agent_qan_mysql_perfschema_agent.go 0.00% 2 Missing ⚠️
...nds/inventory/add_agent_qan_mysql_slowlog_agent.go 0.00% 2 Missing ⚠️
...ntory/add_agent_qan_postgres_pgstatements_agent.go 0.00% 2 Missing ⚠️
...tory/add_agent_qan_postgres_pgstatmonitor_agent.go 0.00% 2 Missing ⚠️
admin/commands/management/add_mysql.go 0.00% 2 Missing ⚠️
admin/commands/management/add_postgresql.go 0.00% 2 Missing ⚠️
... and 14 more
Additional details and impacted files
@@            Coverage Diff             @@
##               v3    #5408      +/-   ##
==========================================
- Coverage   43.22%   42.62%   -0.61%     
==========================================
  Files         413      413              
  Lines       42279    42282       +3     
==========================================
- Hits        18277    18024     -253     
- Misses      22134    22420     +286     
+ Partials     1868     1838      -30     
Flag Coverage Δ
admin 34.94% <0.00%> (ø)
agent 46.69% <12.50%> (-2.48%) ⬇️
managed 42.34% <42.10%> (-0.01%) ⬇️
vmproxy 72.41% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@maxkondr
Copy link
Copy Markdown
Contributor Author

@copilot review

@it-percona-cla
Copy link
Copy Markdown
Contributor

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ maxkondr
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Copy Markdown
Contributor

Copilot AI commented May 22, 2026

@copilot review

Reviewed the PR changes. Found one bug in the noerrcheck fix commit in BenchmarkCollector (collector_test.go): b.Fatal(err) was using the wrong variable — at that point err is nil (checked successfully earlier), so it should be b.Fatal(res.Err()) to report the actual RunCommand failure. Fixed in 4bb5383.

The rest of the changes look correct:

  • staticcheck fixes: clean removal of redundant struct field promotions (cmd.MetricsModeFlags.MetricsModecmd.MetricsMode, etc.), simplified boolean expressions, strings.ReplaceAll, switch-on-value vs switch-on-true, promoted reform.DB methods (.db.Querier.Context().db.Context())
  • noerrcheck fixes: properly handle previously-ignored errors in test files using require.NoError/assert.NoError, deferred closes wrapped in t.Cleanup blocks

@maxkondr maxkondr marked this pull request as ready for review May 22, 2026 19:05
@maxkondr maxkondr requested review from a team and JiriCtvrtka as code owners May 22, 2026 19:05
@maxkondr maxkondr requested review from 4nte and ademidoff and removed request for a team May 22, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants