CatalogBuilder addLocationAnalyzers & setLocationAnalyzer API confusing + breaking change
See original GitHub issueExpected Behavior
The API surface for the CatalogBuilder
shouldn’t have a confusing API in regards to LocationAnalyzer
related interfaces
Actual Behavior
Recently as part of #13800 the catalog-import
analyze process was pushed back into the backend. On a whole this makes sense. However, it has also introduced a confusing API surface and behaviour change. There was an existing CatalogBuilder.setLocationAnalyzer
method which allowed you to change the default LocationAnalyzer
(defaults to RepoLocationAnalyzer
). Now there is a addLocationAnalyzers
. Without looking at the code this is very confusing as to which is used for what.
Under the covers though they are entirely different and the default RepoLocationAnalyzer
wraps the new ScmLocationAnalyzer
(which also is not inherited from the original LocationAnalyzer
). Instead the implementation of. So, if you had previously implemented a custom LocationAnalzyer
it won’t work as expected unless you also change that custom LocationAnalyzer
to also wrap the ScmLocationAnalyzers
and mimic the behaviour of the default RepoLocationAnalyzer
.
I’m all for these improvements, but the current current API is just really confusing and misleading between the ScmLocationAnalyzer
, LocationAnalyzer
interfaces and their relationship + the 2 similar but different CatalogBuilder
methods.
Possible Solutions
I haven’t fully thought through a suggested solution, but here are some options:
- More clearly distinguish the difference between
LocationAnalyzer
andScmLocationAnalyzer
, by renaming one or the other concepts. - Maybe combine both concepts into a single concept and API surface
- Decouple the relationship of the 2 concepts so one doesn’t rely on the other.
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:9 (4 by maintainers)
Top GitHub Comments
Sure that works. I have a workaround now + it’s documented. I just wanted to flag this for others and maybe have a discussion on improving it in the future.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.