Skip to content

[chore] enable revive deep-exit linter rule#8274

Merged
yurishkuro merged 4 commits into
jaegertracing:mainfrom
abhay1999:enable-revive-deep-exit
May 24, 2026
Merged

[chore] enable revive deep-exit linter rule#8274
yurishkuro merged 4 commits into
jaegertracing:mainfrom
abhay1999:enable-revive-deep-exit

Conversation

@abhay1999

Copy link
Copy Markdown
Contributor

Summary

Enables the deep-exit revive rule, which flags calls to os.Exit / log.Fatal outside of main() or init() functions.

Only 5 violations, all straightforward fixes:

  • examples/hotrod/cmd/root.go — removed dead os.Exit(-1) that appeared right after logger.Fatal(...). Zap's Fatal already calls os.Exit(1) internally, so the explicit exit was unreachable code.
  • internal/storage/v1/badger/spanstore/read_write_test.go — replaced 4 log.Fatal calls with b.Fatal in BenchmarkWrites and makeReadBenchmark. Both closures capture the outer b *testing.B, so this is a direct drop-in. It's also a real improvement — log.Fatal calls os.Exit and skips deferred teardown, while b.Fatal cooperates with the testing framework. Dropped the now-unused "log" import.

Part of #5506.

Test plan

  • golangci-lint run passes with zero issues
  • go build ./examples/hotrod/... and go build ./internal/storage/v1/badger/... succeed

Enable the `deep-exit` revive rule which flags calls to os.Exit /
log.Fatal outside of main() or init() functions.

Violations found and fixed:
- examples/hotrod/cmd/root.go: remove dead os.Exit(-1) after
  logger.Fatal (zap already calls os.Exit(1) internally)
- internal/storage/v1/badger/spanstore/read_write_test.go: replace
  log.Fatal with b.Fatal in two benchmark functions so failures are
  reported through the testing framework rather than aborting the
  process; drop now-unused "log" import

Part of jaegertracing#5506

Signed-off-by: abhay1999 <abhaychaurasiya19@gmail.com>
@abhay1999 abhay1999 requested a review from a team as a code owner April 1, 2026 07:08
Copilot AI review requested due to automatic review settings April 1, 2026 07:08
@dosubot dosubot Bot added area/storage storage/badger Issues related to badger storage labels Apr 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR enables the deep-exit revive linter rule, which flags calls to os.Exit and log.Fatal outside of main() or init() functions. The PR fixes all 5 violations by removing dead code and replacing log.Fatal with appropriate alternatives.

Changes:

  • Removed dead os.Exit(-1) call after logger.Fatal() in examples/hotrod/cmd/root.go and its unused os import
  • Replaced 4 log.Fatal calls with b.Fatal in benchmark functions in internal/storage/v1/badger/spanstore/read_write_test.go and removed the unused log import
  • Enabled the deep-exit revive rule in .golangci.yml by removing its disabled: true entry

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
examples/hotrod/cmd/root.go Removed unreachable os.Exit(-1) call and unused os import
internal/storage/v1/badger/spanstore/read_write_test.go Replaced log.Fatal with b.Fatal in benchmark functions for proper test framework integration and removed unused log import
.golangci.yml Enabled deep-exit revive rule

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov

codecov Bot commented Apr 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.59%. Comparing base (908b704) to head (380d324).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8274      +/-   ##
==========================================
+ Coverage   96.56%   96.59%   +0.02%     
==========================================
  Files         332      332              
  Lines       17575    17575              
==========================================
+ Hits        16972    16976       +4     
+ Misses        454      451       -3     
+ Partials      149      148       -1     
Flag Coverage Δ
badger_direct 8.94% <ø> (ø)
badger_e2e 1.04% <ø> (ø)
cassandra-4.x-direct-manual 14.55% <ø> (ø)
cassandra-4.x-e2e-auto 1.03% <ø> (ø)
cassandra-4.x-e2e-manual 1.03% <ø> (ø)
cassandra-5.x-direct-manual 14.55% <ø> (ø)
cassandra-5.x-e2e-auto 1.03% <ø> (ø)
cassandra-5.x-e2e-manual 1.03% <ø> (ø)
clickhouse-direct 8.97% <ø> (ø)
clickhouse-e2e 1.16% <ø> (ø)
elasticsearch-6.x-direct 16.87% <ø> (ø)
elasticsearch-7.x-direct 16.91% <ø> (ø)
elasticsearch-8.x-direct 17.05% <ø> (ø)
elasticsearch-8.x-e2e 1.04% <ø> (ø)
elasticsearch-9.x-e2e 1.04% <ø> (ø)
grpc_direct 7.90% <ø> (ø)
grpc_e2e 1.04% <ø> (ø)
kafka-3.x-v2 1.04% <ø> (ø)
memory_v2 1.04% <ø> (ø)
opensearch-1.x-direct 16.95% <ø> (ø)
opensearch-2.x-direct 16.95% <ø> (ø)
opensearch-2.x-e2e 1.04% <ø> (ø)
opensearch-3.x-e2e 1.04% <ø> (ø)
query 1.04% <ø> (ø)
tailsampling-processor 0.55% <ø> (ø)
unittests 94.89% <ø> (+0.02%) ⬆️

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.

abhay1999 and others added 2 commits April 1, 2026 13:02
Signed-off-by: Mahad Zaryab <43658574+mahadzaryab1@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 24, 2026 04:19
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@mahadzaryab1 mahadzaryab1 added the changelog:refactoring Internal code refactoring without functional changes label May 24, 2026
@mahadzaryab1 mahadzaryab1 enabled auto-merge May 24, 2026 04:22
@mahadzaryab1 mahadzaryab1 added this pull request to the merge queue May 24, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 24, 2026
@yurishkuro yurishkuro merged commit 85a1ad9 into jaegertracing:main May 24, 2026
72 of 73 checks passed
vic-comm pushed a commit to vic-comm/jaeger that referenced this pull request Jun 11, 2026
Signed-off-by: Victor Chidera Obiezue <obiezuechidera@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/storage changelog:refactoring Internal code refactoring without functional changes storage/badger Issues related to badger storage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants