Skip to content

Commit

Permalink
Merge branch 'apache:main' into incubator-kie-issues#1478
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel-beniamin authored Oct 6, 2024
2 parents a713f41 + 5448192 commit 41cb9a1
Show file tree
Hide file tree
Showing 11 changed files with 356 additions and 21 deletions.
4 changes: 3 additions & 1 deletion .ci/jenkins/Jenkinsfile.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ pipeline {

if (isRelease()) {
release.gpgImportKeyFromStringWithoutPassword(getReleaseGpgSignKeyCredsId())
mavenCommand.withProfiles(['apache-release'])
mavenCommand
.withProfiles(['apache-release'])
.withProperty('only.reproducible')
mavenRunClosure()
} else {
mavenRunClosure()
Expand Down
44 changes: 36 additions & 8 deletions drools-drlonyaml-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,40 @@
<artifactId>drools-drlonyaml-parent</artifactId>
<name>Drools :: DRL on YAML</name>
<packaging>pom</packaging>
<modules>
<module>drools-drlonyaml-schemagen</module>
<module>drools-drlonyaml-model</module>
<module>drools-drlonyaml-todrl</module>
<module>drools-drlonyaml-cli</module>
<module>drools-drlonyaml-cli-tests</module>
<module>drools-drlonyaml-integration-tests</module>
</modules>

<profiles>
<profile>
<id>allSubmodules</id>
<activation>
<property>
<name>!only.reproducible</name>
</property>
</activation>
<modules>
<module>drools-drlonyaml-schemagen</module>
<module>drools-drlonyaml-model</module>
<module>drools-drlonyaml-todrl</module>
<module>drools-drlonyaml-cli</module>
<module>drools-drlonyaml-cli-tests</module>
<module>drools-drlonyaml-integration-tests</module>
</modules>
</profile>

<profile>
<id>onlyReproducible</id>
<activation>
<property>
<name>only.reproducible</name>
</property>
</activation>
<modules>
<module>drools-drlonyaml-schemagen</module>
<module>drools-drlonyaml-model</module>
<module>drools-drlonyaml-todrl</module>
<module>drools-drlonyaml-cli</module>
<module>drools-drlonyaml-cli-tests</module>
</modules>
</profile>
</profiles>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,12 @@

public interface ConstraintOperator {
<T, V> BiPredicate<T, V> asPredicate();

default boolean hasIndex() {
return false;
}

default Index.ConstraintType getIndexType() {
throw new UnsupportedOperationException();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,16 @@ public interface DroolsModelBuildContext {

String APPLICATION_PROPERTIES_FILE_NAME = "application.properties";
String DEFAULT_PACKAGE_NAME = "org.kie.kogito.app";
/**
* (boolean) enable/disable global rest endpoint generation (default true)
*
* kogito.generate.rest.(engine_name) -> (boolean) enable/disable engine rest endpoint generation (default true)
*
*/
String KOGITO_GENERATE_REST = "kogito.generate.rest";
/**
* (boolean) dependency injection is available and enabled (default true)
*/
String KOGITO_GENERATE_DI = "kogito.generate.di";

Optional<String> getApplicationProperty(String property);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,18 @@ default <T extends NodeWithAnnotations<?>> T withInjection(T node) {
*/
<T extends NodeWithAnnotations<?>> T withConfigInjection(T node, String configKey, String defaultValue);

/**
* Annotates given node with Transactional annotation
*
* @param node node to be annotated
*/
default <T extends NodeWithAnnotations<?>> T withTransactional(T node) {
node.addAnnotation(getTransactionalAnnotation());
return node;
}

String getTransactionalAnnotation();

/**
* Annotates and enhances method used to produce messages
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ public <T extends NodeWithAnnotations<?>> T withFactoryMethod(T node) {
return node;
}

@Override
public String getTransactionalAnnotation() {
return "jakarta.transaction.Transactional";
}

@Override
public <T extends NodeWithAnnotations<?>> T withTagAnnotation(T node, NodeList<MemberValuePair> attributes) {
node.addAnnotation(new NormalAnnotationExpr(new Name("org.eclipse.microprofile.openapi.annotations.tags.Tag"), attributes));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
*/
package org.drools.codegen.common.di.impl;

import java.util.Collection;
import java.util.Collections;
import java.util.Optional;

import com.github.javaparser.ast.NodeList;
import com.github.javaparser.ast.expr.BinaryExpr;
import com.github.javaparser.ast.expr.BooleanLiteralExpr;
Expand All @@ -36,10 +40,6 @@
import com.github.javaparser.ast.type.ClassOrInterfaceType;
import org.drools.codegen.common.di.DependencyInjectionAnnotator;

import java.util.Collection;
import java.util.Collections;
import java.util.Optional;

public class SpringDependencyInjectionAnnotator implements DependencyInjectionAnnotator {

@Override
Expand Down Expand Up @@ -181,6 +181,11 @@ public <T extends NodeWithAnnotations<?>> T withFactoryClass(T node) {
return node;
}

@Override
public String getTransactionalAnnotation() {
return "org.springframework.transaction.annotation.Transactional";
}

@Override
public <T extends NodeWithAnnotations<?>> T withFactoryMethod(T node) {
node.addAnnotation("org.springframework.context.annotation.Bean");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class CDIRestAnnotator implements RestAnnotator {

@Override
public <T extends NodeWithAnnotations<?>> boolean isRestAnnotated(T node) {
return Stream.of("POST", "GET", "PUT", "DELETE")
return Stream.of("POST", "GET", "PUT", "DELETE", "PATCH")
.map(node::getAnnotationByName)
.anyMatch(Optional::isPresent);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class SpringRestAnnotator implements RestAnnotator {

@Override
public <T extends NodeWithAnnotations<?>> boolean isRestAnnotated(T node) {
return Stream.of("PostMapping", "GetMapping", "PutMapping", "DeleteMapping")
return Stream.of("PostMapping", "GetMapping", "PutMapping", "DeleteMapping", "PatchMapping")
.map(node::getAnnotationByName)
.anyMatch(Optional::isPresent);
}
Expand Down
Loading

0 comments on commit 41cb9a1

Please sign in to comment.