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

Update for MP6 #494

Merged
merged 23 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/it/java/org/eclipse/microprofile/starter/APITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ public class APITest {
final Client client = ClientBuilder.newBuilder().build();

private WebTarget target;
private File v7Matrix;
private File v7MatrixServers;
private File v6Matrix;
private File v6MatrixServers;
private File v5Matrix;
Expand All @@ -63,6 +65,8 @@ public class APITest {
@Before
public void before() {
target = client.target(API_URL);
v7Matrix = new File(getClass().getClassLoader().getResource("json_examples/v7/supportMatrix.json.segments").getFile());
v7MatrixServers = new File(getClass().getClassLoader().getResource("json_examples/v7/supportMatrix_servers.json.segments").getFile());
v6Matrix = new File(getClass().getClassLoader().getResource("json_examples/v6/supportMatrix.json.segments").getFile());
v6MatrixServers = new File(getClass().getClassLoader().getResource("json_examples/v6/supportMatrix_servers.json.segments").getFile());
v5Matrix = new File(getClass().getClassLoader().getResource("json_examples/v5/supportMatrix.json.segments").getFile());
Expand All @@ -87,6 +91,8 @@ public void test(File segments, String uri) throws FileNotFoundException {
@Test
@RunAsClient
public void supportMatrix() throws FileNotFoundException {
test(v7Matrix, "/7/supportMatrix");
test(v7MatrixServers, "/7/supportMatrix/servers");
test(v6Matrix, "/6/supportMatrix");
test(v6MatrixServers, "/6/supportMatrix/servers");
test(v5Matrix, "/5/supportMatrix");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,42 +35,42 @@ public enum MicroprofileSpec {
Arrays.asList(MicroProfileVersion.MP12, MicroProfileVersion.MP13, MicroProfileVersion.MP14,
MicroProfileVersion.MP20, MicroProfileVersion.MP21, MicroProfileVersion.MP22,
MicroProfileVersion.MP30, MicroProfileVersion.MP32, MicroProfileVersion.MP33,
MicroProfileVersion.MP40, MicroProfileVersion.MP41, MicroProfileVersion.MP50))
MicroProfileVersion.MP40, MicroProfileVersion.MP41, MicroProfileVersion.MP50, MicroProfileVersion.MP60))
, FAULT_TOLERANCE("fault_tolerance", "Fault Tolerance",
"Fault Tolerance - all about bulkheads, timeouts, circuit breakers, retries, etc. for your microservices",
"https://github.com/eclipse/microprofile-fault-tolerance/releases/tag/%s",
Arrays.asList(MicroProfileVersion.MP12, MicroProfileVersion.MP13, MicroProfileVersion.MP14,
MicroProfileVersion.MP20, MicroProfileVersion.MP21, MicroProfileVersion.MP22,
MicroProfileVersion.MP30, MicroProfileVersion.MP32, MicroProfileVersion.MP33,
MicroProfileVersion.MP40, MicroProfileVersion.MP41, MicroProfileVersion.MP50))
MicroProfileVersion.MP40, MicroProfileVersion.MP41, MicroProfileVersion.MP50, MicroProfileVersion.MP60))
, JWT_AUTH("JWT_auth", "JWT Auth",
"JWT Propagation - propagate security across your microservices",
"https://github.com/eclipse/microprofile-jwt-auth/releases/tag/%s",
Arrays.asList(MicroProfileVersion.MP12, MicroProfileVersion.MP13, MicroProfileVersion.MP14,
MicroProfileVersion.MP20, MicroProfileVersion.MP21, MicroProfileVersion.MP22,
MicroProfileVersion.MP30, MicroProfileVersion.MP32, MicroProfileVersion.MP33,
MicroProfileVersion.MP40, MicroProfileVersion.MP41, MicroProfileVersion.MP50))
MicroProfileVersion.MP40, MicroProfileVersion.MP41, MicroProfileVersion.MP50, MicroProfileVersion.MP60))
, METRICS("metrics", "Metrics",
"Metrics - Gather and create operational and business measurements for your microservices",
"https://github.com/eclipse/microprofile-metrics/releases/tag/%s",
Arrays.asList(MicroProfileVersion.MP12, MicroProfileVersion.MP13, MicroProfileVersion.MP14,
MicroProfileVersion.MP20, MicroProfileVersion.MP21, MicroProfileVersion.MP22,
MicroProfileVersion.MP30, MicroProfileVersion.MP32, MicroProfileVersion.MP33,
MicroProfileVersion.MP40, MicroProfileVersion.MP41, MicroProfileVersion.MP50))
MicroProfileVersion.MP40, MicroProfileVersion.MP41, MicroProfileVersion.MP50, MicroProfileVersion.MP60))
, HEALTH_CHECKS("health_checks", "Health",
"Health - Verify the health of your microservices with custom verifications",
"https://github.com/eclipse/microprofile-metrics/releases/tag/%s",
Arrays.asList(MicroProfileVersion.MP12, MicroProfileVersion.MP13, MicroProfileVersion.MP14,
MicroProfileVersion.MP20, MicroProfileVersion.MP21, MicroProfileVersion.MP22,
MicroProfileVersion.MP30, MicroProfileVersion.MP32, MicroProfileVersion.MP33,
MicroProfileVersion.MP40, MicroProfileVersion.MP41, MicroProfileVersion.MP50))
MicroProfileVersion.MP40, MicroProfileVersion.MP41, MicroProfileVersion.MP50, MicroProfileVersion.MP60))
, OPEN_API("open_API", "OpenAPI",
"Open API - Generate OpenAPI-compliant API documentation for your microservices",
"https://github.com/eclipse/microprofile-open-api/releases/tag/%s",
Arrays.asList(MicroProfileVersion.MP13, MicroProfileVersion.MP14, MicroProfileVersion.MP20,
MicroProfileVersion.MP21, MicroProfileVersion.MP22,
MicroProfileVersion.MP30, MicroProfileVersion.MP32, MicroProfileVersion.MP33,
MicroProfileVersion.MP40, MicroProfileVersion.MP41, MicroProfileVersion.MP50))
MicroProfileVersion.MP40, MicroProfileVersion.MP41, MicroProfileVersion.MP50, MicroProfileVersion.MP60))
, OPEN_TRACING("open_tracing", "OpenTracing",
"Open Tracing - trace the flow of requests as they traverse your microservices",
"https://github.com/eclipse/microprofile-opentracing/releases/tag/%s",
Expand All @@ -84,7 +84,10 @@ public enum MicroprofileSpec {
Arrays.asList(MicroProfileVersion.MP13, MicroProfileVersion.MP14, MicroProfileVersion.MP20,
MicroProfileVersion.MP21, MicroProfileVersion.MP22,
MicroProfileVersion.MP30, MicroProfileVersion.MP32, MicroProfileVersion.MP33,
MicroProfileVersion.MP40, MicroProfileVersion.MP41, MicroProfileVersion.MP50))
MicroProfileVersion.MP40, MicroProfileVersion.MP41, MicroProfileVersion.MP50, MicroProfileVersion.MP60))
,TELEMETRY("telemetry","Telemetry"
,"Telemetry - pulls in OpenTelemetry Tracing and integrate with CDI and Jakarta RESTful Web Services",
"https://github.com/eclipse/microprofile-telemetry/releases/tag/%s", Arrays.asList( MicroProfileVersion.MP60));
;
// @formatter:on

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public enum SupportedServer {
Arrays.asList(MicroProfileVersion.MP12, MicroProfileVersion.MP13, MicroProfileVersion.MP14,
MicroProfileVersion.MP20, MicroProfileVersion.MP21, MicroProfileVersion.MP22,
MicroProfileVersion.MP30, MicroProfileVersion.MP32, MicroProfileVersion.MP33,
MicroProfileVersion.MP40, MicroProfileVersion.MP41, MicroProfileVersion.MP50)
MicroProfileVersion.MP40, MicroProfileVersion.MP41, MicroProfileVersion.MP50,MicroProfileVersion.MP60)
, "%s.jar" //jarFileName
, "" //jarParameters // Hard coded in server.xml since no way of overriding a default.
, "9080" //portServiceA
Expand All @@ -88,7 +88,8 @@ public enum SupportedServer {
, PAYARA_MICRO("payara-micro", "Payara Micro",
Arrays.asList(MicroProfileVersion.MP12, MicroProfileVersion.MP13, MicroProfileVersion.MP14,
MicroProfileVersion.MP20, MicroProfileVersion.MP21, MicroProfileVersion.MP22
, MicroProfileVersion.MP32, MicroProfileVersion.MP33, MicroProfileVersion.MP40)
, MicroProfileVersion.MP32, MicroProfileVersion.MP33, MicroProfileVersion.MP40,
MicroProfileVersion.MP50)
, "%s-microbundle.jar" //jarFileName
, "--port 8180" //jarParameters
, "8080" //portServiceA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,16 @@ private void init() {
.add(MicroprofileSpec.REST_CLIENT, "3.0.0")
.add(MicroprofileSpec.OPEN_TRACING, "3.0")
.add(MicroprofileSpec.METRICS, "4.0"));
data.put(MicroProfileVersion.MP60,
new EnumMapBuilder()
.add(MicroprofileSpec.CONFIG, "3.0")
.add(MicroprofileSpec.FAULT_TOLERANCE, "4.0")
.add(MicroprofileSpec.JWT_AUTH, "2.1")
.add(MicroprofileSpec.HEALTH_CHECKS, "4.0")
.add(MicroprofileSpec.OPEN_API, "3.1")
.add(MicroprofileSpec.REST_CLIENT, "3.0.0")
.add(MicroprofileSpec.METRICS, "5.0")
.add(MicroprofileSpec.TELEMETRY,"1.0"));
}

public Map<MicroprofileSpec, String> getSpecData(MicroProfileVersion version) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ private void init() {
data.put(MicroProfileVersion.MP50,
new VersionStandaloneMatrix.EnumMapBuilder()
.add(StandaloneMPSpec.GRAPHQL, "2.0"));
data.put(MicroProfileVersion.MP60,
new VersionStandaloneMatrix.EnumMapBuilder()
.add(StandaloneMPSpec.GRAPHQL, "2.0"));
}

public Map<StandaloneMPSpec, String> getSpecData(MicroProfileVersion version) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public Map<String, String> determineVariables(JessieModel model) {
result.put("se_version", seVersion.getCode());
}

if (model.getSpecification().getMicroProfileVersion() == MicroProfileVersion.MP50) {
if (model.getSpecification().getMicroProfileVersion() == MicroProfileVersion.MP50
|| model.getSpecification().getMicroProfileVersion() == MicroProfileVersion.MP60) {
result.put("jakarta_ee_package", "jakarta");

} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public enum MicroProfileVersion {
// Order is important as it determines the order in the Dropdown on the screen.
// @formatter:off
NONE(null, "")
, MP60("6.0", "MP 6.0", Collections.singletonList(Constants.MP6X_ALTERNATIVE))
, MP50("5.0", "MP 5.0", Collections.singletonList(Constants.MP5X_ALTERNATIVE))
, MP41("4.1", "MP 4.1", Collections.singletonList(Constants.MP41_ALTERNATIVE))
, MP40("4.0", "MP 4.0", "4.0.1", Collections.singletonList(Constants.MP3X_ALTERNATIVE))
Expand Down Expand Up @@ -101,5 +102,7 @@ public static class Constants {
public static final String MP3X_ALTERNATIVE = "mp3_x";
public static final String MP41_ALTERNATIVE = "mp4_1";
public static final String MP5X_ALTERNATIVE = "mp5_x";
public static final String MP6X_ALTERNATIVE = "mp6_x";
public static final String MP61_ALTERNATIVE = "mp6_1";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.eclipse.microprofile.starter.rest;

import javax.ws.rs.Path;
Emily-Jiang marked this conversation as resolved.
Show resolved Hide resolved

@Path("/7")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on my understanding from @rdebusscher , there is no need to do this change.

public class APIEndpointV7 extends APIEndpointLatest {
// The current latest version
}
7 changes: 5 additions & 2 deletions src/main/resources/files/ServiceHealthCheck.java.tpl
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package [# th:text="${java_package}"/].health;

import org.eclipse.microprofile.health.Health;
import org.eclipse.microprofile.health.Liveness;
import org.eclipse.microprofile.health.Readiness;
import org.eclipse.microprofile.health.HealthCheck;
import org.eclipse.microprofile.health.HealthCheckResponse;

import [# th:text="${jakarta_ee_package}"/].enterprise.context.ApplicationScoped;

@Health


@Liveness
@ApplicationScoped
public class ServiceHealthCheck implements HealthCheck {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{"configs":{"
MP33":{"supportedServers":["
]},"MP32":{"supportedServers":[
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure this file. Do you need to just mention MP60?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rdebusscher we are stuck on this failure. Can you please shed some lights on this? Your help is very much appreciated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Emily-Jiang What is the issue exactly? From the failed test run, it just seems a problem with some assertions on text values.
Not much time to go in detail for the moment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@luiseufrasio luiseufrasio Apr 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried the URL locally running on liberty:
image

So after I called:
http://127.0.0.1:9080/mp-starter/api/project?supportedServer=LIBERTY&selectedSpecs=CONFIG&selectedSpecs=FAULT_TOLERANCE&selectedSpecs=HEALTH_CHECKS&selectedSpecs=METRICS&selectedSpecs=OPEN_TRACING&selectedSpecs=OPEN_API&artifactId=liberty&buildTool=MAVEN

I received back:

{
	"error": "One or more selectedSpecs is not available for the given mpVersion",
	"code": "ERROR003"
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure the version combination.
What about the error for APITest?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error in the API test is due to the addition of the Telemetry option. Please update the test to the new expected values.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which file needs to be updated? @rdebusscher

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the log of the test

https://github.com/eclipse/microprofile-starter/pull/494/checks#step:7:17864

This is the failure

supportMatrix(org.eclipse.microprofile.starter.APITest)  Time elapsed: 0.319 sec  <<< FAILURE!
java.lang.AssertionError: Response of /7/supportMatrix 

And from the test method APITest#supportMatrix

    public void supportMatrix() throws FileNotFoundException {
        test(v7Matrix, "/7/supportMatrix");

we see that the contents of this file os compared to the response

v7Matrix = new File(getClass().getClassLoader().getResource("json_examples/v7/supportMatrix.json.segments").getFile());        

]}},"descriptions":{"CONFIG":"Configuration - externalize and manage your configuration parameters outside your microservices","OPEN_API":"Open API - Generate OpenAPI-compliant API documentation for your microservices","HEALTH_CHECKS":"Health - Verify the health of your microservices with custom verifications","REST_CLIENT":"Rest Client - Invoke RESTful services in a type-safe manner","FAULT_TOLERANCE":"Fault Tolerance - all about bulkheads, timeouts, circuit breakers, retries, etc. for your microservices","JWT_AUTH":"JWT Propagation - propagate security across your microservices","TELEMETRY":" Telemetry - pulls in Telemetry Tracing and integrate with CDI and Jakarta RESTful Web Services","METRICS":"Metrics - Gather and create operational and business measurements for your microservices","GRAPHQL":"GraphQL - GraphQL is a query language for APIs and a library for fulfilling those queries with your existing data."}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"LIBERTY":[{"mpVersion":"MP12","mpSpecs":["CONFIG","FAULT_TOLERANCE","JWT_AUTH","METRICS","HEALTH_CHECKS","GRAPHQL"],"javaSEVersions":["SE8","SE11"],"buildTools":["MAVEN","GRADLE"]}
"WILDFLY_SWARM":[{"mpVersion":"MP12","mpSpecs":["CONFIG","FAULT_TOLERANCE","JWT_AUTH","METRICS","HEALTH_CHECKS"],"javaSEVersions":["SE8"],"buildTools":["MAVEN"]}]
"QUARKUS":[{"mpVersion":"MP32","mpSpecs":["CONFIG","FAULT_TOLERANCE","JWT_AUTH","METRICS","HEALTH_CHECKS","OPEN_API","TELEMETRY","REST_CLIENT"],"javaSEVersions":["SE8","SE11"],"buildTools":["MAVEN","GRADLE"]}]
Loading