Remove unused generated code from pprofile#14073
Merged
Merged
Conversation
b15c844 to
e9c518e
Compare
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
e9c518e to
f42770a
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #14073 +/- ##
==========================================
+ Coverage 91.61% 92.52% +0.90%
==========================================
Files 655 654 -1
Lines 42793 36071 -6722
==========================================
- Hits 39205 33374 -5831
+ Misses 2765 1877 -888
+ Partials 823 820 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
dmathieu
approved these changes
Oct 23, 2025
dmathieu
left a comment
Member
There was a problem hiding this comment.
This feels like we could improve our CI to detect those issues.
Member
Author
For sure, was about to add an issue. |
Member
Author
|
Done #14074 |
dmitryax
approved these changes
Oct 23, 2025
sAchin-680
added a commit
to sAchin-680/opentelemetry-collector
that referenced
this pull request
Nov 6, 2025
The implementation: - Adds CleanInternalGeneratedFiles() to clean shared pdata/internal/ directory - Adds CleanGeneratedFiles() method to Package for cleaning package directories - Cleans all generated file patterns: generated_*.go, generated_wrapper_*.go, generated_proto_*.go, and generated_enum_*.go - Ensures cleanup happens before any file generation to prevent partial states This resolves issues where removed structs or enums leave behind unused generated code, as seen in open-telemetry#14073. Fixes open-telemetry#14074 Signed-off-by: SACHIN KUMAR <mrmister680@gmail.com>
4 tasks
sAchin-680
added a commit
to sAchin-680/opentelemetry-collector
that referenced
this pull request
Nov 6, 2025
The implementation: - Adds CleanInternalGeneratedFiles() to clean shared pdata/internal/ directory - Adds CleanGeneratedFiles() method to Package for cleaning package directories - Cleans all generated file patterns: generated_*.go, generated_wrapper_*.go, generated_proto_*.go, and generated_enum_*.go - Ensures cleanup happens before any file generation to prevent partial states This resolves issues where removed structs or enums leave behind unused generated code, as seen in open-telemetry#14073. Fixes open-telemetry#14074 Signed-off-by: SACHIN KUMAR <mrmister680@gmail.com>
sAchin-680
added a commit
to sAchin-680/opentelemetry-collector
that referenced
this pull request
Nov 6, 2025
The implementation: - Adds CleanInternalGeneratedFiles() to clean shared pdata/internal/ directory - Adds CleanGeneratedFiles() method to Package for cleaning package directories - Cleans all generated file patterns: generated_*.go, generated_wrapper_*.go, generated_proto_*.go, and generated_enum_*.go - Ensures cleanup happens before any file generation to prevent partial states This resolves issues where removed structs or enums leave behind unused generated code, as seen in open-telemetry#14073. Fixes open-telemetry#14074 Signed-off-by: SACHIN KUMAR <mrmister680@gmail.com>
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Nov 10, 2025
…#14135) #### Description Implements automatic cleanup of generated files before pdatagen regeneration to prevent stale code accumulation. Previously, removing structs/enums from configuration left behind unused generated files requiring manual cleanup (see #14073). **Solution:** All generated files are now automatically deleted before regeneration, ensuring generated code always matches the current configuration. **Implementation:** - `CleanInternalGeneratedFiles()` - cleans shared `pdata/internal/` directory - `CleanGeneratedFiles()` - cleans individual package directories - Covers all patterns: `generated_*.go`, `generated_wrapper_*.go`, `generated_proto_*.go`, `generated_enum_*.go` #### Link to tracking issue Fixes #14074 - Automatic delete generated files with pdatagen before re-generate #### Testing - [x] Successfully built and ran `make genpdata` - [x] Verified all 160+ generated files covered by cleanup patterns - [x] No compilation or linting errors - [x] Gracefully handles non-existent files #### Documentation Self-documented code with clear function comments. No user-facing changes required. --------- Signed-off-by: SACHIN KUMAR <mrmister680@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.