Skip to content

feat: support DSP correct state in deprovisioning #5040

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

Merged

Conversation

wolf4ood
Copy link
Contributor

@wolf4ood wolf4ood commented Jun 13, 2025

What this PR changes/adds

Fixes dsp-tck tests:

  • TP:01-01
  • TP:01-03
  • TP:01-05

We will base the decision if a TP is TERMINATED or COMPLETED only by checking the errorDetail field as a temporary workaround. This will not require any changes for users.

We can revisit this behavior once #4793 is in.

Why it does that

dsp-compliance

Further notes

List other areas of code that have changed but are not necessarily linked to the main feature. This could be method
signature changes, package declarations, bugs that were encountered and were fixed inline, etc.

Who will sponsor this feature?

Please @-mention the committer that will sponsor your feature.

Linked Issue(s)

Closes #5032

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

@wolf4ood wolf4ood added enhancement New feature or request breaking-change Will require manual intervention for version update labels Jun 13, 2025
@wolf4ood wolf4ood force-pushed the feat/5032_complete_dsp_tck_integration branch 2 times, most recently from 870c7dc to b32fedb Compare June 13, 2025 12:30
@wolf4ood wolf4ood marked this pull request as ready for review June 13, 2025 12:54
@wolf4ood wolf4ood requested a review from jimmarino June 13, 2025 12:54
@@ -143,6 +143,8 @@ public class TransferProcess extends StatefulEntity<TransferProcess> {
private String transferType;
private String dataPlaneId;

private Integer previousState;
Copy link
Contributor

Choose a reason for hiding this comment

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

just a nit: for other state-related fields we use int instead of Integer, maybe worth to have this aligned

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.

Woulnd't be a more "holistic" approach to just keep memory of all the state changes? That will permit other logic based on the entity history to be evaluated in a better way (see the <action>WasRequestedByTheCounterParty), because a previousState field that's only set in particular occasions could be misunderstood easily.

@wolf4ood
Copy link
Contributor Author

We could discuss about naming, but I don't think memory will fit the purpose. Currently we have a the deprovisining states that are considered completed for DSP, which is wrong. For us deprovisioning is also considered a final state and we don't know how to map the deprovisioning in the correct DSP state unless we know which is the origination or the cause of the deprovisioning eg the transfer as either terminated or completed.

@ndr-brt
Copy link
Member

ndr-brt commented Jun 13, 2025

We could discuss about naming, but I don't think memory will fit the purpose. Currently we have a the deprovisining states that are considered completed for DSP, which is wrong. For us deprovisioning is also considered a final state and we don't know how to map the deprovisioning in the correct DSP state unless we know which is the origination or the cause of the deprovisioning eg the transfer as either terminated or completed.

My proposal wasn't just to rename the field, but to not to have a simple field that stores only (eventually) the previous state, instead to keep a record of the state changes, from which we can understand if the transfer has been COMPLETED or TERMINATED, and it could also be used for other logic conditionals.
It would have been to catch the opportunity, once we have to migrate the database, to achieve more at one go.

in any case, theoretically provisioning/deprovisioning states should go away once #4793 is completed (I'm still working on it... slowly!)

@wolf4ood
Copy link
Contributor Author

Then if they are going we could think about leaving those DSP failing tests as allowed for the time being if we do not want to dirty the DB just for this

For the history of changes it would be ok for me but only in memory will not solve this use case and probably others.
and probably would be a not so smol change :)

@jimmarino
Copy link
Contributor

Then if they are going we could think about leaving those DSP failing tests as allowed for the time being if we do not want to dirty the DB just for this

For the history of changes it would be ok for me but only in memory will not solve this use case and probably others. and probably would be a not so smol change :)

We need to pass the tests. I think we should put the simple fix in for now as we are under pressure to complete the TCK in the next couple of days. We can work on a loner-term solution later.

@ndr-brt
Copy link
Member

ndr-brt commented Jun 16, 2025

Since it is a patch to have tests working, could we base the decision "has it been completed or terminated" on the value of the "errorDetail" variable? it should be set only with terminated transfers, that will save us a potentially unnecessary schema migration

@wolf4ood
Copy link
Contributor Author

we could try but if I remember correctly the errorDetail is optional

@jimmarino
Copy link
Contributor

we could try but if I remember correctly the errorDetail is optional

Yes, and that can vary by implementation.

@wolf4ood
Copy link
Contributor Author

Also I tried this workaround, We'd have to clean the errorDetail field on completion to make the tck work otherwise the flow with suspended would fail

@wolf4ood
Copy link
Contributor Author

Here's the changeset with just the workaround

main...wolf4ood:DataSpaceConnector:feat/5032_complete_dsp_tck_integration_workaround

@wolf4ood wolf4ood force-pushed the feat/5032_complete_dsp_tck_integration branch from b32fedb to 921b138 Compare June 16, 2025 09:19
@wolf4ood
Copy link
Contributor Author

I've applied the changeset to this PR. Now it does not require a migration and It only check the errorDetail field when serializing for DSP

@wolf4ood wolf4ood removed breaking-change Will require manual intervention for version update labels Jun 16, 2025
@wolf4ood wolf4ood requested review from ndr-brt and ronjaquensel June 16, 2025 09:54
@wolf4ood wolf4ood merged commit 7347e52 into eclipse-edc:main Jun 16, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprovision related state considered completed
4 participants