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

fix: avoid cyclic dependency #1776

Conversation

paullatzelsperger
Copy link
Member

@paullatzelsperger paullatzelsperger commented Aug 3, 2022

What this PR changes/adds

This PR moves the factory methods for RetryPolicy and OkHttpClient from the CoreServicesExtension --> DefaultServicesExtension.

Why it does that

This is to avoid cyclic dependencies when attempting to @Inject either of these two into an extension, onto which the CoreServicesExtension in turn has a dependency, e.g. a Vault extension (it surfaced during #1534).

Further notes

The two new @Provider methods were attributed as default providers (isDefault=true) to allow any other extension to override them.
[edit] removed the isDefault again, this caused problems with system tests

Linked Issue(s)

Closes #1775

Checklist

  • added appropriate tests?
  • performed checkstyle check locally?
  • added/updated copyright headers?
  • documented public classes/methods?
  • added/updated relevant documentation?
  • assigned appropriate label? (exclude from changelog with label no-changelog)
  • formatted title correctly? (take a look at the CONTRIBUTING and styleguide for details)

@paullatzelsperger paullatzelsperger added the bug Something isn't working label Aug 3, 2022
@paullatzelsperger paullatzelsperger force-pushed the bugfix/1775_avoid_cyclic_dependency_retrypolicy_okhttpclient branch from 40b6a69 to 9897bc6 Compare August 3, 2022 12:16
@codecov-commenter
Copy link

codecov-commenter commented Aug 3, 2022

Codecov Report

Merging #1776 (6ed1904) into main (781381c) will increase coverage by 0.01%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #1776      +/-   ##
==========================================
+ Coverage   67.77%   67.78%   +0.01%     
==========================================
  Files         795      793       -2     
  Lines       16968    16838     -130     
  Branches     1079     1077       -2     
==========================================
- Hits        11500    11414      -86     
+ Misses       5005     4951      -54     
- Partials      463      473      +10     
Impacted Files Coverage Δ
...dataspaceconnector/core/CoreServicesExtension.java 85.00% <ø> (-2.50%) ⬇️
...nector/core/defaults/DefaultServicesExtension.java 7.69% <0.00%> (-3.42%) ⬇️
...ector/provision/azure/AzureProvisionExtension.java 0.00% <0.00%> (ø)
.../api/multipart/handler/ArtifactRequestHandler.java 61.42% <0.00%> (-4.71%) ⬇️
.../api/multipart/handler/ContractRequestHandler.java 58.33% <0.00%> (-3.49%) ⬇️
...iation/ProviderContractNegotiationManagerImpl.java 90.00% <0.00%> (-0.56%) ⬇️
...ultipart/dispatcher/sender/IdsMultipartSender.java 79.27% <0.00%> (-0.19%) ⬇️
...connector/ids/api/multipart/util/ResponseUtil.java 98.88% <0.00%> (-0.04%) ⬇️
...aceconnector/ids/core/IdsCoreServiceExtension.java 0.00% <0.00%> (ø)
...ctor/ids/spi/domain/iam/DynamicAttributeToken.java 100.00% <0.00%> (ø)
... and 94 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@paullatzelsperger paullatzelsperger force-pushed the bugfix/1775_avoid_cyclic_dependency_retrypolicy_okhttpclient branch from 9897bc6 to 6ed1904 Compare August 3, 2022 13:30
@paullatzelsperger paullatzelsperger force-pushed the bugfix/1775_avoid_cyclic_dependency_retrypolicy_okhttpclient branch from 6ed1904 to 91c2923 Compare August 3, 2022 13:49
@paullatzelsperger paullatzelsperger merged commit b5fc6ec into eclipse-edc:main Aug 3, 2022
diegogomez-zf pushed a commit to diegogomez-zf/DataSpaceConnector that referenced this pull request Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: RetryPolicy and OkHttpClient should be moved out of CoreServicesExtension
4 participants