-
Notifications
You must be signed in to change notification settings - Fork 567
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
Introduce new immutable protocol #8945
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work again @npepinpe
As I've reviewed most of this before, I haven't got much to say about it anymore.
LGTM 👍
e1c0fe7
to
88bd57b
Compare
13ccb2e
to
5ed71b9
Compare
bors merge |
bors r- |
Canceled. |
I think it might be better to postpone this for the next release, primarily because this will cause additional effort for the Operate team which is already using this, and I will check in with them, and if they tell me it's fine we can go ahead anyway, but let's see. |
Adds immutable protocol generation to the Zeebe record protocol. This is done via an annotation process, Immutables, which requires two annotations on each leaf types: - `@Value.Immutable` - `@ImmutableProtocol` All leaf types - that is, types expected to have a single, direct, concrete implementations - need to be annotated with both values to ensure that there is always one immutable variant available, especially for deserialization. Meta-types such as `ProcessInstanceRelated`, for example, do not need to be annotated but can be left as is. This may of course change in the future. This commit is the first step to removing the immutable protocol from protocol-jackson, but for now both are existing at the same time.
Generates flat assertions for each protocol type as opposed to hierarchical ones, omitting generated immutable variants. This should solve some compile time issues related to code generation, and simplify usage. No more need to use RecordValueWithVariables.hasVariables when dealing with a JobRecordValue - instead you can keep using `JobRecordValueAssert.hasVariables`.
Adds an ArchUnit tests which ensures all protocol leaf types are annotated, guaranteeing an immutable variant will be generated for each of these types. At the moment, this means `Record` and type under `record.value` package or one of its sub-packages, except `ProcessInstanceRelated`.
5ed71b9
to
b1bfc42
Compare
bors merge |
Build succeeded:
|
Description
Introduces a new immutable protocol directly under
protocol
, which annotates the types directly. This has several advantages:Record
, which is a special case due to its generic typing)This is the first step for #8837 - the next step will remove the immutable variants in
protocol-jackson
and replace them with this.Related issues
related to #8837
Definition of Done
Not all items need to be done depending on the issue and the pull request.
Code changes:
backport stable/1.3
) to the PR, in case that fails you need to create backports manually.Testing:
Documentation: