-
Notifications
You must be signed in to change notification settings - Fork 206
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
[KOGITO-9145] Create an implementation of the Service Discovery catal… #3166
Closed
Closed
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
455b2a3
[KOGITO-9145] Create an implementation of the Service Discovery catal…
VaniHaripriya c409a15
[KOGITO-9145] - Create an implementation of the Service Discovery cat…
VaniHaripriya 045b847
[KOGITO-9145] - Fixed sonar issues
VaniHaripriya fe2978d
KOGITO-9676 CI: Promote call setup-branch job (#3162)
radtriste f4a0473
Quarkus 3: update patches (#3168)
radtriste bfe03c7
KOGITO-9692 Fix release generation (#3170)
radtriste f94e0ea
KOGITO-9158 Use RestWorkItemHandler as HTTP client in Knative custom …
hbelmiro 623dab7
[Quarkus 3] Updated rewrite data
459e5a7
Update version to Kogito 2.0.0-SNAPSHOT / Drools 8.44.0-SNAPSHOT
70b8e9d
Fixing metadata key (#3173)
fjtirado ffe57f6
[Quarkus 3] Updated rewrite data
46bb068
[KOGITO-9145]- Updated as per comments
VaniHaripriya 5619273
[KOGITO-9145] Removed extra space
VaniHaripriya 70e5115
Merge branch 'main' into KOGITO-9145
VaniHaripriya ecc5e52
[KOGITO-9145]
VaniHaripriya ef27a2f
[KOGITO-9145] formatted file
VaniHaripriya 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
43 changes: 43 additions & 0 deletions
43
quarkus/addons/microprofile-config-service-catalog/deployment/pom.xml
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,43 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.kie.kogito</groupId> | ||
<artifactId>kogito-addons-quarkus-microprofile-config-service-catalog-parent</artifactId> | ||
<version>2.0.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>kogito-addons-quarkus-microprofile-config-service-catalog-deployment</artifactId> | ||
<name>Kogito Add-On MicroProfile Config Service Catalog - Deployment</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.kie.kogito</groupId> | ||
<artifactId>kogito-addons-quarkus-microprofile-config-service-catalog</artifactId> | ||
<version>2.0.0-SNAPSHOT</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-arc-deployment</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<annotationProcessorPaths> | ||
<path> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-extension-processor</artifactId> | ||
<version>${version.io.quarkus}</version> | ||
</path> | ||
</annotationProcessorPaths> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
136 changes: 136 additions & 0 deletions
136
quarkus/addons/microprofile-config-service-catalog/integration-tests/pom.xml
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,136 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.kie.kogito</groupId> | ||
<artifactId>kogito-addons-quarkus-microprofile-config-service-catalog-parent</artifactId> | ||
<version>2.0.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>kogito-addons-quarkus-microprofile-config-service-catalog-integration-tests</artifactId> | ||
<name>Kogito Add-On Microprofile Config Service Catalog - Integration Tests</name> | ||
<description>Microprofile Config Service Catalog Kogito Add-On Integration Tests.</description> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.kie.kogito</groupId> | ||
<artifactId>kogito-quarkus-bom</artifactId> | ||
<version>${project.version}</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-smallrye-openapi</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.kie.kogito</groupId> | ||
<artifactId>kogito-quarkus-serverless-workflow</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-resteasy</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-resteasy-jackson</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.kie.kogito</groupId> | ||
<artifactId>kogito-addons-quarkus-knative-serving</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.kie.kogito</groupId> | ||
<artifactId>kogito-addons-quarkus-kubernetes</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.kie.kogito</groupId> | ||
<artifactId>kogito-addons-quarkus-fabric8-kubernetes-service-catalog</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-kubernetes</artifactId> | ||
</dependency> | ||
|
||
<!-- Test --> | ||
<dependency> | ||
<groupId>org.assertj</groupId> | ||
<artifactId>assertj-core</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-junit5</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.rest-assured</groupId> | ||
<artifactId>rest-assured</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.github.tomakehurst</groupId> | ||
<artifactId>wiremock-jre8</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-test-kubernetes-client</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.kie.kogito</groupId> | ||
<artifactId>kogito-addons-quarkus-fabric8-kubernetes-service-catalog-test-utils</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-maven-plugin</artifactId> | ||
<configuration> | ||
<noDeps>true</noDeps> | ||
<skip>${skipTests}</skip> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>build</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<profiles> | ||
<profile> | ||
<id>native</id> | ||
<activation> | ||
<property> | ||
<name>native</name> | ||
</property> | ||
</activation> | ||
<properties> | ||
<quarkus.package.type>native</quarkus.package.type> | ||
</properties> | ||
</profile> | ||
</profiles> | ||
</project> |
104 changes: 104 additions & 0 deletions
104
...dons/quarkus/microprofile/config/service/catalog/it/MicroProfileConfigServiceAddonIT.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,104 @@ | ||
/* | ||
* Copyright 2023 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* 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 | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* 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 org.kie.kogito.addons.quarkus.microprofile.config.service.catalog.it; | ||
|
||
import java.net.HttpURLConnection; | ||
|
||
import org.junit.jupiter.api.AfterAll; | ||
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import com.fasterxml.jackson.databind.node.JsonNodeFactory; | ||
import com.github.tomakehurst.wiremock.WireMockServer; | ||
import com.github.tomakehurst.wiremock.core.WireMockConfiguration; | ||
|
||
import io.fabric8.kubernetes.client.server.mock.KubernetesServer; | ||
import io.quarkus.test.junit.QuarkusTest; | ||
import io.quarkus.test.kubernetes.client.KubernetesTestServer; | ||
import io.quarkus.test.kubernetes.client.WithKubernetesTestServer; | ||
import io.restassured.http.ContentType; | ||
|
||
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; | ||
import static com.github.tomakehurst.wiremock.client.WireMock.post; | ||
import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; | ||
import static io.restassured.RestAssured.given; | ||
import static org.hamcrest.CoreMatchers.is; | ||
import static org.kie.kogito.addons.quarkus.k8s.test.utils.KnativeResourceDiscoveryTestUtil.createServiceIfNotExists; | ||
|
||
@QuarkusTest | ||
@WithKubernetesTestServer | ||
class MicroProfileConfigServiceAddonIT { | ||
|
||
private static final String NAMESPACE = "default"; | ||
|
||
private static final String SERVICENAME = "serverless-workflow-greeting-quarkus"; | ||
|
||
private static WireMockServer wireMockServer; | ||
|
||
private static String remoteServiceUrl; | ||
|
||
@KubernetesTestServer | ||
KubernetesServer mockServer; | ||
|
||
@BeforeAll | ||
static void beforeAll() { | ||
createWiremockServer(); | ||
} | ||
|
||
@BeforeEach | ||
void beforeEach() { | ||
createServiceIfNotExists(mockServer, "knative/quarkus-greeting.yaml", NAMESPACE, SERVICENAME, remoteServiceUrl); | ||
} | ||
|
||
@AfterAll | ||
static void afterAll() { | ||
if (wireMockServer != null) { | ||
wireMockServer.stop(); | ||
} | ||
} | ||
|
||
@Test | ||
void executeWithEmptyParameters() { | ||
mockExecuteWithEmptyParametersEndpoint(); | ||
|
||
given() | ||
.contentType(ContentType.JSON) | ||
.accept(ContentType.JSON) | ||
.body("{\"workflowdata\":{}}").when() | ||
.post("/emptyParamsKnativeFunction") | ||
.then() | ||
.statusCode(HttpURLConnection.HTTP_CREATED) | ||
.body("workflowdata.org", is("Acme")) | ||
.body("workflowdata.project", is("Kogito")); | ||
} | ||
|
||
private void mockExecuteWithEmptyParametersEndpoint() { | ||
wireMockServer.stubFor(post(urlEqualTo("/emptyParamsKnativeFunction")) | ||
.willReturn(aResponse() | ||
.withStatus(HttpURLConnection.HTTP_OK) | ||
.withHeader("Content-Type", "application/json") | ||
.withJsonBody(JsonNodeFactory.instance.objectNode() | ||
.put("org", "Acme") | ||
.put("project", "Kogito")))); | ||
} | ||
|
||
private static void createWiremockServer() { | ||
wireMockServer = new WireMockServer(WireMockConfiguration.wireMockConfig().dynamicPort()); | ||
wireMockServer.start(); | ||
remoteServiceUrl = wireMockServer.baseUrl(); | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
...config-service-catalog/integration-tests/src/test/resources/knative/quarkus-greeting.yaml
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,54 @@ | ||
apiVersion: serving.knative.dev/v1 | ||
kind: Service | ||
metadata: | ||
annotations: | ||
serving.knative.dev/creator: minikube-user | ||
serving.knative.dev/lastModifier: minikube-user | ||
creationTimestamp: '2022-08-17T13:58:53Z' | ||
generation: 1 | ||
name: serverless-workflow-greeting-quarkus | ||
resourceVersion: '43817' | ||
uid: 98530cb6-3274-4d0c-b654-a82645cda058 | ||
spec: | ||
template: | ||
metadata: | ||
annotations: | ||
client.knative.dev/updateTimestamp: '2022-08-17T13:58:53Z' | ||
client.knative.dev/user-image: kiegroup/serverless-workflow-greeting-quarkus:1.0 | ||
creationTimestamp: | ||
spec: | ||
containerConcurrency: 0 | ||
containers: | ||
- image: kiegroup/serverless-workflow-greeting-quarkus:1.0 | ||
name: user-container | ||
readinessProbe: | ||
successThreshold: 1 | ||
tcpSocket: | ||
port: 0 | ||
resources: { } | ||
enableServiceLinks: false | ||
timeoutSeconds: 300 | ||
traffic: | ||
- latestRevision: true | ||
percent: 100 | ||
status: | ||
address: | ||
url: http://serverless-workflow-greeting-quarkus.test.svc.cluster.local | ||
conditions: | ||
- lastTransitionTime: '2022-08-17T13:59:00Z' | ||
status: 'True' | ||
type: ConfigurationsReady | ||
- lastTransitionTime: '2022-08-17T13:59:00Z' | ||
status: 'True' | ||
type: Ready | ||
- lastTransitionTime: '2022-08-17T13:59:00Z' | ||
status: 'True' | ||
type: RoutesReady | ||
latestCreatedRevisionName: serverless-workflow-greeting-quarkus-00001 | ||
latestReadyRevisionName: serverless-workflow-greeting-quarkus-00001 | ||
observedGeneration: 1 | ||
traffic: | ||
- latestRevision: true | ||
percent: 100 | ||
revisionName: serverless-workflow-greeting-quarkus-00001 | ||
url: http://serverless-workflow-greeting-quarkus.test.10.99.154.147.sslip.io |
21 changes: 21 additions & 0 deletions
21
quarkus/addons/microprofile-config-service-catalog/pom.xml
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,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.kie.kogito</groupId> | ||
<artifactId>kogito-addons-quarkus-parent</artifactId> | ||
<version>2.0.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>kogito-addons-quarkus-microprofile-config-service-catalog-parent</artifactId> | ||
<name>Kogito Add-On MicroProfile Config Service Catalog - Parent</name> | ||
<packaging>pom</packaging> | ||
|
||
<modules> | ||
<module>deployment</module> | ||
<module>runtime</module> | ||
<module>integration-tests</module> | ||
</modules> | ||
</project> |
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.
You need to register these modules in the kogito-bom. Take a look at https://github.com/kiegroup/kogito-runtimes/blob/e37b961eb5fec25b4545a7937b5f067fee331ade/kogito-bom/pom.xml#L318 to use the Fabric8 implementation as a reference.