-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[tagger/mock] Refactor to use fake impl directly and avoid unwanted dependencies #31297
Merged
dd-mergequeue
merged 3 commits into
main
from
davidor/contp-506-tagger-mock-unwanted-deps
Nov 21, 2024
Merged
[tagger/mock] Refactor to use fake impl directly and avoid unwanted dependencies #31297
dd-mergequeue
merged 3 commits into
main
from
davidor/contp-506-tagger-mock-unwanted-deps
Nov 21, 2024
Conversation
This file contains 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
davidor
added
changelog/no-changelog
qa/done
QA done before merge and regressions are covered by tests
team/container-platform
The Container Platform Team
labels
Nov 21, 2024
GustavoCaso
reviewed
Nov 21, 2024
GustavoCaso
approved these changes
Nov 21, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job 🎉
wdhif
approved these changes
Nov 21, 2024
L3n41c
approved these changes
Nov 21, 2024
vickenty
approved these changes
Nov 21, 2024
kkhor-datadog
approved these changes
Nov 21, 2024
/merge |
Devflow running:
|
dd-mergequeue
bot
deleted the
davidor/contp-506-tagger-mock-unwanted-deps
branch
November 21, 2024 14:59
jack0x2
pushed a commit
that referenced
this pull request
Nov 21, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
changelog/no-changelog
medium review
PR review might take time
qa/done
QA done before merge and regressions are covered by tests
team/container-platform
The Container Platform Team
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.
What does this PR do?
This PR refactors the tagger mock to eliminate unnecessary dependencies.
Here's the issue that this PR addresses: The OpenTelemetry project (otel) only needs the remote tagger implementation. Currently, the mock tagger is tied to the main implementation, which drags along extra dependencies, like the metrics package. We want to avoid forcing otel to convert all these extras into a module.
To achieve this, this PR moves the already existing fake tagger implementation that we have (and that doesn't require any unwanted dependencies) to the
mock
package, and change the mock to use this implementation.The PR is separated into 3 commits:
SetupFakeTagger
to set up thefx
dependencies for them. Previously, the mock depended on several components like config, workloadmeta, logs, etc. but that is no longer the case. Therefore, thisSetupFakeTagger
no longer includes them, and I needed to adapt the callers that were relying on this.There are more things that we can improve in this area, for example, I don't think we need
SetupFakeTagger()
anymore, but refactoring that involves many changes. In this PR I just wanted to focus on avoiding the unwanted dependencies.Describe how to test/QA your changes
Unit tests are enough.