Skip to content

Commit

Permalink
Merge pull request #151 from OpenLiberty/staging
Browse files Browse the repository at this point in the history
Merge staging to prod - Version update mp5  (20220525) (#149)
  • Loading branch information
gkwan-ibm authored May 26, 2022
2 parents 09c1a0a + 25b72b7 commit 0666e42
Show file tree
Hide file tree
Showing 10 changed files with 94 additions and 94 deletions.
24 changes: 12 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@

Anyone can contribute to the Open Liberty guides and we welcome your contributions!

There are multiple ways to contribute: report bugs, fix bugs, contribute code, improve upon documentation, etc.
There are multiple ways to contribute: report bugs, fix bugs, contribute code, improve upon documentation, etc.

## Raising issues

Please raise any bug reports in this [guide repository](../../issues). For new topics, large updates to existing guides, or general suggestions and ideas, report your issue in the [Open Liberty common guides repository](https://github.com/OpenLiberty/guides-common/issues). Be sure to search the list of open issues to see if your issue has already been raised.

A good bug report makes it easy for everyone to understand what you were trying to do and what went wrong. Provide as much context as possible so we can try to recreate the issue.

## Contributions
## Contributions

Contributing to an Open Liberty guide is simple. All you need to do is create your own branch to include your contribution and open a pull request to the `qa` (quality assurance) branch.
Contributing to an Open Liberty guide is simple. All you need to do is create your own branch to include your contribution and open a pull request to the `staging` (quality assurance) branch.

### Text or content contributions

If you are contributing text or content changes via a pull request, you need to certify that the originality of the work follows the [Developer Certificate of Origin (DCO)](https://developercertificate.org).

Add a line to the end of the Git commit message to sign your work:

```
```text
Signed-off-by: Jane Williams <jane.williams@gmail.com>
```

The sign-off is just a line at the end of the commit message that certifies that you wrote it or otherwise have the right to pass it on as an open source patch.

Use your real name when you sign. We can't accept pseudonyms or anonymous contributions.
Use your real name when you sign. We can't accept pseudonyms or anonymous contributions.

Many Git UI tools have support for adding the `Signed-off-by` line to the end of your commit message. This line can be automatically added by the `git commit` command by using the `-s` option.

Expand All @@ -37,22 +37,22 @@ If reviewers agree with your change, your change will be merged to the `master`
If you are contributing trivial code changes such as typos, redundant spaces, or minor formatting and spelling errors, follow the instructions under [Text or content contributions](./CONTRIBUTING.md#text-or-content-contributions).

If you are contributing code changes via a pull request for non-trivial changes, you must sign off on the [Individual Contributor License Agreement](https://github.com/OpenLiberty/open-liberty/blob/master/cla/open-liberty-cla-individual.pdf). An example of a non-trivial change could be adding a new
microservice to the backend application of the guide.
microservice to the backend application of the guide.

If you are contributing changes as part of your job, you may also wish to have your employer sign a [Corporate Contributor License Agreement](https://github.com/OpenLiberty/open-liberty/blob/master/cla/open-liberty-cla-corporate.pdf).

Instructions for how to sign and submit these agreements are located at the top of each document.
Instructions for how to sign and submit these agreements are located at the top of each document.

After we obtain the signed CLA, you are welcome to open a pull request against the `qa` branch, and the team will be notified for review. We ask you follow these steps through the submission process:
After we obtain the signed CLA, you are welcome to open a pull request against the `staging` branch, and the team will be notified for review. We ask you follow these steps through the submission process:

1. Open a pull request against the `qa` branch.
1. Open a pull request against the `staging` branch.
2. A "CLA signed" label will be manually added by the team.
3. The team will be notified and will review your change(s).
- If there are further changes to be made, the team will request changes on the pull request.
3. The team will be notified and will review your change(s).
- If there are further changes to be made, the team will request changes on the pull request.
- If the team does not agree with the change, the PR will be closed with an explanation and suggestion for follow-up.
4. If the team approves, a full Open Liberty site build will be run.
5. Based on the results of the build:
- If further review is needed, we will let you know about a pending review from our team and discuss any necessary improvements that need to be made to your change(s).
- If further review is needed, we will let you know about a pending review from our team and discuss any necessary improvements that need to be made to your change(s).
- If everything is successful, the team will merge your PR.

## Questions and concerns
Expand Down
24 changes: 12 additions & 12 deletions finish/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
<version>8.0.0</version>
<version>9.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>4.1</version>
<version>5.0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
Expand All @@ -46,25 +46,25 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.7.2</version>
<version>5.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-client</artifactId>
<version>3.4.5</version>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>6.0.0.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-extension-providers</artifactId>
<version>3.4.5</version>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-json-binding-provider</artifactId>
<version>6.0.0.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>1.1.4</version>
<artifactId>jakarta.json</artifactId>
<version>2.0.1</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -82,7 +82,7 @@
<plugin>
<groupId>io.openliberty.tools</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>3.5.1</version>
<version>3.5.2</version>
<!-- tag::configuration[] -->
<configuration>
<!-- Copy the hazelcast library -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// tag::copyright[]
/*******************************************************************************
* Copyright (c) 2019 IBM Corporation and others.
* Copyright (c) 2019, 2022 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand All @@ -12,8 +12,8 @@
// end::copyright[]
package io.openliberty.guides.cart;

import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
import jakarta.ws.rs.ApplicationPath;
import jakarta.ws.rs.core.Application;

@ApplicationPath("/")
public class CartApplication extends Application {
Expand Down
39 changes: 20 additions & 19 deletions finish/src/main/java/io/openliberty/guides/cart/CartResource.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// tag::copyright[]
/*******************************************************************************
* Copyright (c) 2019 IBM Corporation and others.
* Copyright (c) 2019, 2022 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand All @@ -14,19 +14,19 @@

import java.util.Enumeration;

import javax.json.Json;
import javax.json.JsonArrayBuilder;
import javax.json.JsonObject;
import javax.json.JsonObjectBuilder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import jakarta.json.Json;
import jakarta.json.JsonArrayBuilder;
import jakarta.json.JsonObject;
import jakarta.json.JsonObjectBuilder;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpSession;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.Context;
import jakarta.ws.rs.core.MediaType;

import org.eclipse.microprofile.openapi.annotations.Operation;
import org.eclipse.microprofile.openapi.annotations.parameters.Parameter;
Expand Down Expand Up @@ -71,8 +71,8 @@ public String addToCart(@Context HttpServletRequest request,
@Produces(MediaType.APPLICATION_JSON)
@APIResponse(responseCode = "200",
description = "Items successfully retrieved from your cart.")
@Operation(summary = "Return an JsonObject instance which contains " +
"the items in your cart and the subtotal.")
@Operation(summary = "Return an JsonObject instance which contains "
+ "the items in your cart and the subtotal.")
// tag::getCart[]
public JsonObject getCart(@Context HttpServletRequest request) {
HttpSession session = request.getSession();
Expand Down Expand Up @@ -102,8 +102,9 @@ public JsonObject getCart(@Context HttpServletRequest request) {

private String getHostname() {
String hostname = System.getenv("HOSTNAME");
if (hostname == null)
hostname = "localhost";
return hostname;
if (hostname == null) {
hostname = "localhost";
}
return hostname;
}
}
9 changes: 5 additions & 4 deletions finish/src/main/liberty/config/server.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
<server description="Liberty Server for Sessions Management">

<featureManager>
<feature>servlet-4.0</feature>
<feature>servlet-5.0</feature>
<!-- tag::sessionCache[] -->
<feature>sessionCache-1.0</feature>
<!-- end::sessionCache[] -->
<feature>jaxrs-2.1</feature>
<feature>jsonp-1.1</feature>
<feature>mpOpenAPI-2.0</feature>
<feature>restfulWS-3.0</feature>
<feature>jsonb-2.0</feature>
<feature>jsonp-2.0</feature>
<feature>mpOpenAPI-3.0</feature>
</featureManager>

<variable name="default.http.port" defaultValue="9080"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// tag::copyright[]
/*******************************************************************************
* Copyright (c) 2019, 2021 IBM Corporation and others.
* Copyright (c) 2019, 2022 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand All @@ -17,19 +17,18 @@

import java.util.Map;

import javax.json.JsonObject;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.Invocation.Builder;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Cookie;
import javax.ws.rs.core.Form;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.NewCookie;
import javax.ws.rs.core.Response;

import org.apache.cxf.jaxrs.provider.jsrjsonp.JsrJsonpProvider;
import jakarta.json.JsonObject;
import jakarta.ws.rs.client.Client;
import jakarta.ws.rs.client.ClientBuilder;
import jakarta.ws.rs.client.Entity;
import jakarta.ws.rs.client.Invocation.Builder;
import jakarta.ws.rs.client.WebTarget;
import jakarta.ws.rs.core.Cookie;
import jakarta.ws.rs.core.Form;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.NewCookie;
import jakarta.ws.rs.core.Response;

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand All @@ -45,7 +44,6 @@ public class CartSessionIT {
@BeforeEach
public void setup() {
client = ClientBuilder.newClient();
client.register(JsrJsonpProvider.class);
}

@AfterEach
Expand Down
2 changes: 0 additions & 2 deletions scripts/dailyBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,4 @@ cat pom.xml
sed -i "s;FROM icr.io/appcafe/open-liberty:full-java11-openj9-ubi;FROM $DOCKER_USERNAME/olguides:$BUILD;g" Dockerfile
cat Dockerfile

sudo ../scripts/startMinikube.sh
sudo ../scripts/testApp.sh
sudo ../scripts/stopMinikube.sh
4 changes: 4 additions & 0 deletions scripts/testApp.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash
set -euxo pipefail

../scripts/startMinikube.sh

# TEST 1: Building and running the application

# LMP 3.0+ goals are listed here: https://github.com/OpenLiberty/ci.maven#goals
Expand Down Expand Up @@ -58,6 +60,8 @@ echo "$runningPod"
kubectl exec "$runningPod" -- cat /logs/messages.log | grep product
kubectl exec "$runningPod" -- cat /logs/messages.log | grep java

../scripts/stopMinikube.sh

if [ "$postStatus" == "eggs added to your cart and costs \$2.29" ] && [ "$getStatus" == "200" ] && [ "$openApiStatus" == "200" ]
then
echo POST/GET OK
Expand Down
24 changes: 12 additions & 12 deletions start/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
<version>8.0.0</version>
<version>9.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>4.1</version>
<version>5.0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
Expand All @@ -46,25 +46,25 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.7.2</version>
<version>5.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-client</artifactId>
<version>3.4.5</version>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>6.0.0.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-extension-providers</artifactId>
<version>3.4.5</version>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-json-binding-provider</artifactId>
<version>6.0.0.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>1.1.4</version>
<artifactId>jakarta.json</artifactId>
<version>2.0.1</version>
<scope>test</scope>
</dependency>

Expand All @@ -83,7 +83,7 @@
<plugin>
<groupId>io.openliberty.tools</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>3.5.1</version>
<version>3.5.2</version>
<configuration>
<!-- Copy the hazelcast library -->
<copyDependencies>
Expand Down
Loading

0 comments on commit 0666e42

Please sign in to comment.