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

feat(api, spi, storage): policy profile implementation #4332

Merged
merged 14 commits into from
Jul 17, 2024

Conversation

saschaisele-zf
Copy link
Contributor

@saschaisele-zf saschaisele-zf commented Jul 4, 2024

What this PR changes/adds

This PR adds the odrl:profile attribute to the policy model.
This includes the necessary changes to the api, validation, transformation, spi and storage.
BREAKING CHANGE: a new profiles JSON column has been added to the edc_policydefinitions table

Why it does that

The change is necessary to conform to ODRL v2.2

Further notes

For better validation, a new array validator named 'MandatoryIdArray' was added that ensures the array is a list of 'id' values.
To accomodate the transformation, the 'AbstractJsonLdTransformer' was extended with the 'transformIdStringArray' method.

Linked Issue(s)

Closes #3691

Please be sure to take a look at the contributing guidelines and our etiquette for pull requests.

@saschaisele-zf saschaisele-zf changed the title Feat/policy profile feat(api, spi, storage): policy profile implementation Jul 4, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jul 4, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 82.60870% with 12 lines in your changes missing coverage. Please review.

Project coverage is 74.91%. Comparing base (7f20ba5) to head (47ffe65).
Report is 358 commits behind head on main.

Files Patch % Lines
...lidator/jsonobject/validators/OptionalIdArray.java 85.18% 2 Missing and 2 partials ⚠️
...ore/schema/postgres/PostgresDialectStatements.java 0.00% 2 Missing and 1 partial ⚠️
...main/java/org/eclipse/edc/policy/model/Policy.java 62.50% 3 Missing ⚠️
...t/policy/v31alpha/PolicyDefinitionApiV31Alpha.java 0.00% 2 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4332      +/-   ##
==========================================
+ Coverage   71.74%   74.91%   +3.17%     
==========================================
  Files         919     1066     +147     
  Lines       18457    21389    +2932     
  Branches     1037     1172     +135     
==========================================
+ Hits        13242    16024    +2782     
- Misses       4756     4839      +83     
- Partials      459      526      +67     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@saschaisele-zf
Copy link
Contributor Author

saschaisele-zf commented Jul 4, 2024

fyi @ndr-brt

@ndr-brt ndr-brt self-requested a review July 4, 2024 11:44
@saschaisele-zf saschaisele-zf marked this pull request as ready for review July 9, 2024 07:59
@paullatzelsperger
Copy link
Member

paullatzelsperger commented Jul 9, 2024

@saschaisele-zf I am currently working on adding the /v3.1alpha version to the management API, because I will need that for another work item too, and I want to avoid duplicated work.

I assume i'll have this done shortly. Could you wait a little, and rebase on that once i'm finished?

@paullatzelsperger paullatzelsperger added enhancement New feature or request api Feature related to the (REST) api labels Jul 9, 2024
@saschaisele-zf
Copy link
Contributor Author

Can do that.
I will just revert the last commit then.

@paullatzelsperger
Copy link
Member

#4343 is merged, good to rebase

Copy link
Member

@ndr-brt ndr-brt left a comment

Choose a reason for hiding this comment

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

please add a test on PolicyDefinitionStoreTestBase as well, to ensure that the persistence is working correctly

@ndr-brt ndr-brt added the breaking-change Will require manual intervention for version update label Jul 16, 2024
@ndr-brt ndr-brt merged commit 908be42 into eclipse-edc:main Jul 17, 2024
22 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Feature related to the (REST) api breaking-change Will require manual intervention for version update enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Policy "profile" cannot be retrieved
4 participants