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

core: replace policies with ids in ContractDefinition #1144

Merged
merged 3 commits into from
Apr 21, 2022
Merged

core: replace policies with ids in ContractDefinition #1144

merged 3 commits into from
Apr 21, 2022

Conversation

ndr-brt
Copy link
Member

@ndr-brt ndr-brt commented Apr 13, 2022

What this PR changes/adds

Replace the fields accessPolicy and contractPolicy with accessPolicyId and contractPolicyId on ContractDefinition, and inject PolicyStore to ContractDefinitionServiceImpl, ContractValidationServiceImpl and ContractOfferServiceImpl

Why it does that

Because policies are stored separately from contract definitions and they can be referenced by their id

Further notes

  • removed NullAssetIndex as its use was impossible to reach.
  • probably data-loader-cli needs further work but seemed too much for this PR. Since data-management api is in place is it still useful?

Linked Issue(s)

Closes #1137
Part 3. of #828

Checklist

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

@codecov-commenter
Copy link

Codecov Report

Merging #1144 (89773f3) into main (24956ec) will increase coverage by 0.13%.
The diff coverage is 88.75%.

@@             Coverage Diff              @@
##               main    #1144      +/-   ##
============================================
+ Coverage     62.63%   62.76%   +0.13%     
- Complexity     2973     2978       +5     
============================================
  Files           694      693       -1     
  Lines         15420    15406      -14     
  Branches       1043     1040       -3     
============================================
+ Hits           9658     9670      +12     
+ Misses         5332     5307      -25     
+ Partials        430      429       -1     
Impacted Files Coverage Δ
...ceconnector/contract/ContractServiceExtension.java 0.00% <0.00%> (ø)
...ion/store/SqlContractDefinitionStoreExtension.java 0.00% <0.00%> (ø)
...ypes/domain/contract/offer/ContractDefinition.java 80.76% <60.00%> (+25.50%) ⬆️
...ract/validation/ContractValidationServiceImpl.java 60.78% <90.90%> (+2.45%) ⬆️
.../contract/offer/ContractDefinitionServiceImpl.java 100.00% <100.00%> (+4.76%) ⬆️
...ector/contract/offer/ContractOfferServiceImpl.java 100.00% <100.00%> (+10.52%) ⬆️
...tDefinitionDtoToContractDefinitionTransformer.java 100.00% <100.00%> (ø)
...tDefinitionToContractDefinitionDtoTransformer.java 100.00% <100.00%> (ø)
...tamanagement/policy/service/PolicyServiceImpl.java 87.09% <100.00%> (ø)
...definition/store/ContractDefinitionStatements.java 100.00% <100.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 24956ec...89773f3. Read the comment docs.

@bscholtes1A bscholtes1A merged commit 0b8de69 into eclipse-edc:main Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ContractDefinitionDtoToContractDefinitionTransformer does not transform Policies
4 participants