Skip to content
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
merged 3 commits into from
Nov 21, 2024

Conversation

davidor
Copy link
Member

@davidor davidor commented Nov 21, 2024

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:

  • The first one does the refactor.
  • The second one adapts some callers.
  • The third one affects the tests that were relying on SetupFakeTagger to set up the fx dependencies for them. Previously, the mock depended on several components like config, workloadmeta, logs, etc. but that is no longer the case. Therefore, this SetupFakeTagger 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.

@davidor 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
@davidor davidor added this to the 7.61.0 milestone Nov 21, 2024
@davidor davidor requested review from a team as code owners November 21, 2024 08:06
@davidor davidor requested a review from a team November 21, 2024 08:06
@davidor davidor requested a review from a team as a code owner November 21, 2024 08:06
@davidor davidor requested a review from Kaderinho November 21, 2024 08:06
@github-actions github-actions bot added the medium review PR review might take time label Nov 21, 2024
Copy link
Member

@GustavoCaso GustavoCaso left a comment

Choose a reason for hiding this comment

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

Great job 🎉

@davidor
Copy link
Member Author

davidor commented Nov 21, 2024

/merge

@dd-devflow
Copy link

dd-devflow bot commented Nov 21, 2024

Devflow running: /merge

View all feedbacks in Devflow UI.


2024-11-21 14:30:05 UTC ℹ️ MergeQueue: pull request added to the queue

The median merge time in main is 25m.

@dd-mergequeue dd-mergequeue bot merged commit a021530 into main Nov 21, 2024
259 checks passed
@dd-mergequeue 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants