-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Refactor component and factory interface definitions #683
Refactor component and factory interface definitions #683
Conversation
742508d
to
f77b7f1
Compare
Codecov Report
@@ Coverage Diff @@
## master #683 +/- ##
==========================================
- Coverage 74.36% 74.29% -0.07%
==========================================
Files 162 159 -3
Lines 11385 11391 +6
==========================================
- Hits 8466 8463 -3
- Misses 2500 2508 +8
- Partials 419 420 +1
Continue to review full report at Codecov.
|
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.
LGTM @tigrannajaryan
I want to challenge this:
If we break now all the users, why keeping v1 and v2, I would suggest v2 to become the version without any suffix and the old interfaces maybe name the Old or just remove them completely. |
Yes, that's a possibility too. Let me play with the names a bit and see what it looks like. |
f77b7f1
to
b7a73e4
Compare
@bogdandrutu I added a new commit with the approach you suggested. PTAL. |
What everybody thinks about the general approach of putting all factories and interfaces in one package? Do you see any downsides? Like, e.g. the potential of creating too much coupling between normally unrelated the component factories? |
@bogdandrutu just to clarify, removing completely is not possible now. We have to first implemented the new interfaces in all components. |
@tigrannajaryan the components package is very small and I would not worry that much of coupling as long as we don't put all the implementations there :) Few questions/suggestions:
|
I'd keep this as a separate package. We will move new internal data representation implementation here once it is ready, so it will become a large package itself. I don't want to overload These are data models, they don't need any access to component factories / interfaces and I think it is better to keep them in a separate package. It is a typical approach to keep data model declarations as a separate package so that other packages can freely import them in any order without worrying about circular dependencies.
Yes, these will need to be moved/renamed. But I want to wait until you finish your work and we have the implementation. |
ee3cb7b
to
4b0f347
Compare
@bogdandrutu any more thoughts on this? |
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.
LGTM.
@tigrannajaryan for the moment I am done, will look again once it is merge (in some examples where we use this and see how it is). |
2863d6e
to
5d8d834
Compare
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.
lgtm
@@ -1,32 +1,60 @@ | |||
// Copyright 2019, OpenTelemetry Authors | |||
// Copyright OpenTelemetry Authors |
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.
nit: Is this supposed to have the year? Happened in a couple places.
As we are preparing for Beta release we want to cleanup publicly exported types and interfaces and do all necessary refactoring and breaking changes now, before the Beta release. We will have a lot less leeway for breaking changes after the Beta release. Component related type declarations are now all in the `component` package. This makes it possible for the interfaces to reference each other. This was were very restricted earlier because component interfaces were in 5 different packages and many proposals were impossible to implement because they would result in circular dependencies between packages. (An example upcoming new capability that is enabled by this refactoring is for components to query the Host for other components and for factories). List of changes in this commit: - Move all factory interfaces and component interfaces to component package. - Rename old factories and components interfaces to use "Old" suffix for clarity. - Eliminate forced checks that components implement factories. This is already enforced by the compiler when the factory is added to the Defaults() and was unnecessary code. - Eliminated some unnecessary codes (removed overall over 200 lines). - Run `go mod tidy` on testbed. Warning: this is a breaking change to publicly exported types and function signatures. We announced that a breaking change is comming. Once we agree to merge this commit we will need to announce the exact list of changes and guide component authors to modify their components accordingly. Future changes: - Once all components are migrated to the new internal representation, delete all "Old"-suffixed definitions. This will likely be done while we are still in Beta phase, before the Stable release.
5d8d834
to
d792c20
Compare
fix interceptor regexp
As we are preparing for Beta release we want to cleanup publicly exported
types and interfaces and do all necessary refactoring and breaking changes
now, before the Beta release. We will have a lot less leeway for breaking
changes after the Beta release.
Component related type declarations are now all in the
component
package.This makes it possible for the interfaces to reference each other. This
was were very restricted earlier because component interfaces were in 5
different packages and many proposals were impossible to implement because
they would result in circular dependencies between packages.
(An example upcoming new capability that is enabled by this refactoring
is for components to query the Host for other components and for factories).
List of changes in this commit:
enforced by the compiler when the factory is added to the Defaults() and
was unnecessary code.
go mod tidy
on testbed.Warning: this is a breaking change to publicly exported types and function
signatures. We announced that a breaking change is comming. Once we agree
to merge this commit we will need to announce the exact list of changes
and guide component authors to modify their components accordingly.
Future changes:
delete all "Old"-suffixed definitions. This will likely be done while
we are still in Beta phase, before the Stable release.