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: introduce typed transformation problem reporting #3004

Merged
merged 4 commits into from
May 15, 2023

Conversation

jimmarino
Copy link
Contributor

What this PR changes/adds

In an effort to make transformation problem reporting consistent across the codebase, this PR introduces the PoblemBuilder, which provides a way to construct transformation problems in a typed way.

Specifically, TransformationContext now includes a problem() method that returns a ProblemBuilder. The build can be used to report transformation errors:

       context.problem()
                    .missingProperty()
                    .type(DSPACE_NEGOTIATION_CONTRACT_REQUEST_MESSAGE)
                    .property(DSPACE_NEGOTIATION_PROPERTY_PROCESS_ID)
                    .report();

The builder will then construct the problem string and report it to the context. Different categories of problems can be reported: MISSING PROPERTY, NULL PROPERTY, INVALID PROPERTY, UNEXPECTED TYPE.

All transformers have been updated to use this typed access. Only a few, specialized cases use the existing reportProblem(String problem) method.

This PR also fixes a few bugs in the transformers encountered when updated to typed problem reporting.

Linked Issue(s)

Closes #2909

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 Etiquette for pull requests for details)

@jimmarino jimmarino added this to the Milestone 9 milestone May 15, 2023
@jimmarino jimmarino self-assigned this May 15, 2023
@jimmarino jimmarino temporarily deployed to Azure-dev May 15, 2023 09:29 — with GitHub Actions Inactive
@jimmarino jimmarino added the enhancement New feature or request label May 15, 2023
@jimmarino jimmarino temporarily deployed to Azure-dev May 15, 2023 12:20 — with GitHub Actions Inactive
@jimmarino jimmarino merged commit cb5a4f3 into eclipse-edc:main May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core feature enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make transformation problem messages consistent
3 participants