-
Notifications
You must be signed in to change notification settings - Fork 509
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 updates #194
Merged
Merged
Core updates #194
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7198ed2
update from Orkes
v1r3n 498e1da
clean up
v1r3n e78e569
update tests
v1r3n ce42329
updates to the classes
v1r3n 52f0ddb
updates
v1r3n 8947e67
back to async
v1r3n b0efce7
update tests
v1r3n 81ab5ee
add AfterburnerModule
v1r3n ac6f13f
formatting
v1r3n bf024b8
fix tests
v1r3n File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
common/src/main/java/com/netflix/conductor/annotations/protogen/ProtoEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright 2022 Conductor Authors. | ||
* <p> | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
package com.netflix.conductor.annotations.protogen; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* ProtoEnum annotates an enum type that will be exposed via the GRPC API as a native Protocol | ||
* Buffers enum. | ||
*/ | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.TYPE) | ||
public @interface ProtoEnum {} |
36 changes: 36 additions & 0 deletions
36
common/src/main/java/com/netflix/conductor/annotations/protogen/ProtoField.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright 2022 Conductor Authors. | ||
* <p> | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
package com.netflix.conductor.annotations.protogen; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* ProtoField annotates a field inside an struct with metadata on how to expose it on its | ||
* corresponding Protocol Buffers struct. For a field to be exposed in a ProtoBuf struct, the | ||
* containing struct must also be annotated with a {@link ProtoMessage} or {@link ProtoEnum} tag. | ||
*/ | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.FIELD) | ||
public @interface ProtoField { | ||
/** | ||
* Mandatory. Sets the Protocol Buffer ID for this specific field. Once a field has been | ||
* annotated with a given ID, the ID can never change to a different value or the resulting | ||
* Protocol Buffer struct will not be backwards compatible. | ||
* | ||
* @return the numeric ID for the field | ||
*/ | ||
int id(); | ||
} |
51 changes: 51 additions & 0 deletions
51
common/src/main/java/com/netflix/conductor/annotations/protogen/ProtoMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright 2022 Conductor Authors. | ||
* <p> | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
package com.netflix.conductor.annotations.protogen; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* ProtoMessage annotates a given Java class so it becomes exposed via the GRPC API as a native | ||
* Protocol Buffers struct. The annotated class must be a POJO. | ||
*/ | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.TYPE) | ||
public @interface ProtoMessage { | ||
/** | ||
* Sets whether the generated mapping code will contain a helper to translate the POJO for this | ||
* class into the equivalent ProtoBuf object. | ||
* | ||
* @return whether this class will generate a mapper to ProtoBuf objects | ||
*/ | ||
boolean toProto() default true; | ||
|
||
/** | ||
* Sets whether the generated mapping code will contain a helper to translate the ProtoBuf | ||
* object for this class into the equivalent POJO. | ||
* | ||
* @return whether this class will generate a mapper from ProtoBuf objects | ||
*/ | ||
boolean fromProto() default true; | ||
|
||
/** | ||
* Sets whether this is a wrapper class that will be used to encapsulate complex nested type | ||
* interfaces. Wrapper classes are not directly exposed by the ProtoBuf API and must be mapped | ||
* manually. | ||
* | ||
* @return whether this is a wrapper class | ||
*/ | ||
boolean wrapper() default false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,6 @@ | |
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.module.afterburner.AfterburnerModule; | ||
import jakarta.annotation.PostConstruct; | ||
|
||
@Configuration | ||
|
@@ -34,6 +33,5 @@ public void customizeDefaultObjectMapper() { | |
objectMapper.setDefaultPropertyInclusion( | ||
JsonInclude.Value.construct( | ||
JsonInclude.Include.NON_NULL, JsonInclude.Include.ALWAYS)); | ||
objectMapper.registerModule(new AfterburnerModule()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this module removed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Found issues with JDK17 + SB3 and other dependencies. |
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
common/src/main/java/com/netflix/conductor/common/metadata/SchemaDef.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright 2024 Conductor Authors. | ||
* <p> | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
package com.netflix.conductor.common.metadata; | ||
|
||
import java.util.Map; | ||
|
||
import com.netflix.conductor.annotations.protogen.ProtoEnum; | ||
import com.netflix.conductor.annotations.protogen.ProtoField; | ||
import com.netflix.conductor.annotations.protogen.ProtoMessage; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.NoArgsConstructor; | ||
|
||
@EqualsAndHashCode(callSuper = true) | ||
@Builder | ||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@ProtoMessage | ||
public class SchemaDef extends Auditable { | ||
|
||
@ProtoEnum | ||
public enum Type { | ||
JSON, | ||
AVRO, | ||
PROTOBUF | ||
} | ||
|
||
@ProtoField(id = 1) | ||
@NotNull | ||
private String name; | ||
|
||
@ProtoField(id = 2) | ||
@NotNull | ||
@Builder.Default | ||
private int version = 1; | ||
|
||
@ProtoField(id = 3) | ||
@NotNull | ||
private Type type; | ||
|
||
// Schema definition stored here | ||
private Map<String, Object> data; | ||
|
||
// Externalized schema definition (eg. via AVRO, Protobuf registry) | ||
// If using Orkes Schema registry, this points to the name of the schema in the registry | ||
private String externalRef; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why are these test removed?
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.
it compared specific serialization for JSON like removing empty values etc - this is likely to break and is breaking after object mapper changes. Not relevant to the feature but I guess was added in the past for some unknown reason.