8000 [Code health] include-what-you-use cleanup, part 2 by marcalff · Pull Request #2704 · open-telemetry/opentelemetry-cpp · GitHub
[go: up one dir, main page]

Skip to content

Conversation

marcalff
Copy link
Member
@marcalff marcalff commented Jun 17, 2024

Contributes to #2054

Changes

Changed the include-what-you-use build to:

  • use the C++14 STL
  • cover more code

Performed general cleanup to resolve issues reported by include-what-you-use:

  • Cleanup in OTLP HTTP exporter
  • Cleanup in OTLP File exporter
  • Cleanup in Zipkin exporter
  • Cleanup in exporter examples

For the most part, applying the code suggestions from include-what-you-use was sufficient.

In some cases, in particular for:

namespace nostd = opentelemetry::nostd;

nostd::xxx foo;

the namespace directive causes iwyu to want a header to declare the nostd namespace itself.

Because there are many available headers, iwyu does not suggest the best choice.

Resolved by removing the namespace alias, and use fully qualified names instead:

opentelemetry::nostd::xxx foo;

This is the second pass at cleanup, follow up work is still required.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

Copy link
codecov bot commented Jun 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.67%. Comparing base (497eaf4) to head (3ea1033).
Report is 97 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2704      +/-   ##
==========================================
+ Coverage   87.12%   87.67%   +0.56%     
==========================================
  Files         200      190      -10     
  Lines        6109     5855     -254     
==========================================
- Hits         5322     5133     -189     
+ Misses        787      722      -65     
Files Coverage Δ
exporters/ostream/src/span_exporter.cc 87.50% <ø> (-0.61%) ⬇️
sdk/src/logs/logger.cc 78.95% <ø> (ø)
sdk/src/logs/logger_provider.cc 90.91% <ø> (ø)
sdk/src/logs/readable_log_record.cc 58.34% <ø> (ø)
sdk/src/metrics/meter.cc 62.14% <ø> (+0.69%) ⬆️
sdk/src/metrics/meter_provider.cc 87.18% <ø> (+0.34%) ⬆️
sdk/src/metrics/state/observable_registry.cc 83.73% <ø> (+0.39%) ⬆️
sdk/src/trace/tracer.cc 82.46% <ø> (ø)
sdk/src/trace/tracer_provider.cc 89.14% <ø> (ø)

... and 109 files with indirect coverage changes

8000

@marcalff marcalff marked this pull request as ready for review June 22, 2024 01:04
@marcalff marcalff requested a review from a team June 22, 2024 01:04
@marcalff marcalff added the pr:please-review This PR is ready for review label Jun 22, 2024
@marcalff marcalff added the issue:blocking This issue is preventing other fixes label Jul 6, 2024
@marcalff
Copy link
Member Author
marcalff commented Jul 6, 2024

Marking as blocking, because this PR is likely to cause merge conflicts with the clang-tidy cleanup:

so it is very desirable to get this merged soon.

Also, merging this round (part 2) is required before implementing more include-what-you-use cleanup on more code.

@open-telemetry/cpp-approvers Please review.

Copy link
Member
@esigo esigo left a comment

Choose a reason for hiding this comment

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

LGTM
Thanks for the PR :)

@marcalff marcalff merged commit 6dbfdb5 into open-telemetry:main Jul 6, 2024
@marcalff marcalff deleted the fix_iwyu_cleanup_2 branch February 5, 2025 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

issue:blocking This issue is preventing other fixes pr:please-review This PR is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0