Skip to content

Commit

Permalink
Jakarta (#63)
Browse files Browse the repository at this point in the history
* Prepare IFixes release 9.0.0.1 (#59)

* Decisions convergence (#48)

* Implement support for both Decisions products and refactoring

- Made service compatible with ODM and ADS
- Integrated metering model for simplified dependencies
- Renamed packages, options, produced jar file
- Adapted, refactored and reviewed documentation accordingly

* Update copyright notices

* Deliver next release - 8.12.0 (#45)

* Switch to the next version

* Change copyright year: DBACLD-90119

* Pre delivery 812 (#44)

* Prepare new release.

* increase time to run test

* Change liberty version for the next release

* Use a pre-deploy ruleset

* Adapt test after moving to the new rule set

* Prepare next delivery

* Update Chart.yaml - Fix bad odm version

* fix bad version

* Update test.sh

* Update docker-compose.yml Try to add network

* Update docker-compose.yml - Remove network

* Update build-and-test.yml

* Update build-and-test.yml debug

* Update test.sh

* Update test.sh

* Take the new jar file name into account

* Trigger new action build

---------

Co-authored-by: Anthony Acremann <anthony.acremann@fr.ibm.com>

* Prepare next release

* Update Liberty version

* Update build-and-test.yml

* Update build-and-test.yml

* Update build-and-test.yml - Revert

* Bad reference url

* Update build-and-test.yml - Change Liberty version

* Change for the next release

* Update build-and-test.yml

* Try to workaround issue DBACLD-118818

* Fix location

* Update Chart.yaml

* Update values.yaml

* Update values.yaml

* Move to the new release name 9.0.0

* Linter failed

* DBACLD-125217 Metering service does not store correctly the metrics

* Override delivery to fix issue

* New description for the dockerjub

* DBACLD-125376 Change copyright

* Dbacld 125217 (#50)

* Fix configuration of the service

* DBACLD-125217

* Try to fix Github action

* Fix initVariable syntax

* Fix shell syntax.

* no message

* Debug

* Fix metrics check

* Move to JDK 17

* improve logging

* DBACLD-134790 Change License for the next release

* Prepare next release

* Preprare next release

* Prepare next release

* Update README_ODM.md

* Update Chart.yaml

* Update kuberentes version

* Fix Kubernetes requirement

* Change home url + Kubernetes version

* Try to add artifacthub verified status

* Add markdown link check (#53)

* DBACLD-139987 - Put in place checker link

* ignore some broken links

* ignore broken links with localhost URL

---------

Co-authored-by: Frederic Mercier <f.mercier@fr.ibm.com>

* Fix broken link

* Fix broken link

* prepare next release 24.1.0 (#55)

* DBACLD-148300 Enable detect secret

* DBACLD-148300 Enable detect secret

* Update README.md

* add GitHub action running detect-secrets

* send notification to Slack if detect-secrets failed

* Prep delivery - First pass fix linter (#56)

* Prepare next release

* Move to a CV new version

* Try to fix build. Improve certification level.

* Fix remaining linter issues

* Fix ODM version to be able to test

* Prep delivery (#57)

* Prepare next release

* Move to a CV new version

* Try to fix build. Improve certification level.

* Fix remaining linter issues

* Fix ODM version to be able to test

* Switch Java version to jdk 17 + update the linter version.

* Remove duplicate entry

* Fix liberty location image

* Prep delivery 2401 (#58)

* Switch Java version to jdk 17 + update the linter version.

* Remove duplicate entry

* Fix liberty location image

* Preparing new delivery of the helm charts

---------

Co-authored-by: Anthony Acremann <anthony.acremann@fr.ibm.com>
Co-authored-by: Frederic Mercier <frederic.mercier@gmx.net>
Co-authored-by: Frederic Mercier <f.mercier@fr.ibm.com>
Co-authored-by: siasin <siasin.tay@fr.ibm.com>

* move to spring-boot-2.7.18

* move to spring-boot-2.7.18

* Value too long for column issue

* move to spring-boot-3.0

* uses java 17

* sprint boot 3.1.5

* sprint boot 3.1.12

* issue on hibernate

* tentative null comparison

* move to SB 3.40

* remove deprecation

---------

Co-authored-by: Laurent GRATEAU <laurent.grateau@fr.ibm.com>
Co-authored-by: Anthony Acremann <anthony.acremann@fr.ibm.com>
Co-authored-by: Frederic Mercier <frederic.mercier@gmx.net>
Co-authored-by: Frederic Mercier <f.mercier@fr.ibm.com>
Co-authored-by: siasin <siasin.tay@fr.ibm.com>
  • Loading branch information
6 people authored Dec 19, 2024
1 parent 86074bf commit 4589280
Show file tree
Hide file tree
Showing 18 changed files with 57 additions and 48 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ jobs:
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
ODM_URL: ${{ secrets.ODM_URL }}
- uses: actions/setup-java@v1
with:
java-version: 17
- run: bash build.sh
- run: echo "${{ secrets.ARTIFACTORY_PASSWORD }}" | docker login ${{ secrets.ARTIFACTORY_URL }} --username ${{ secrets.ARTIFACTORY_USER }} --password-stdin
- run: sudo docker-compose build
Expand Down
4 changes: 2 additions & 2 deletions docker/config/featureManager.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<server>
<!-- Enable features -->
<featureManager>
<feature>servlet-4.0</feature>
<feature>springBoot-2.0</feature>
<feature>servlet-6.0</feature>
<feature>springBoot-3.0</feature>
<feature>transportSecurity-1.0</feature>
</featureManager>

Expand Down
2 changes: 1 addition & 1 deletion docker/installscripts/installFeatures.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -x
# Install the driver for Derby
echo "Install the feature list for ODM on Liberty"
ROOTFEATUREDIR=/opt/wlppackage
PACKAGELIST="servlet-4.0 springBoot-2.0 transportSecurity-1.0"
PACKAGELIST="servlet-6.0 springBoot-3.0 transportSecurity-1.0"
ls /opt/wlppackage/
rm /opt/wlppackage/.donotremoved
if [ ! -d $ROOTFEATUREDIR/features ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ public int hashCode() {
+ (operatingSystemVersion == null ? 0 : operatingSystemVersion
.hashCode())
+ (cloudServicesUsed == null ? 0 : cloudServicesUsed.hashCode())
+ new Long(startTime).hashCode()
+ new Long(sendTime).hashCode()
+ Long.valueOf(startTime).hashCode()
+ Long.valueOf(sendTime).hashCode()
+ (customerTagData == null ? 0 : customerTagData.hashCode())
+ (products == null ? 0 : products.hashCode())
+ (metrics == null ? 0 : metrics.hashCode())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ public boolean equals(Object object) {
public int hashCode() {
return 37
+ super.hashCode()
+ new Long(startTime).hashCode()
+ new Long(endTime).hashCode()
+ Long.valueOf(startTime).hashCode()
+ Long.valueOf(endTime).hashCode()
+ (environmentType == null ? 0 : environmentType.hashCode())
+ (usageList == null ? 0 : usageList.hashCode())
+ (productSpecificData == null ? 0 : productSpecificData
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>

<modules>
<module>model</module>
<module>service</module>
</modules>
</project>
</project>
20 changes: 11 additions & 9 deletions service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.4.RELEASE</version>
<version>3.4.0</version>
<relativePath/>
</parent>
<groupId>com.ibm.decision</groupId>
Expand All @@ -16,7 +16,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<java.version>17</java.version>
<odm.home>${env.ODMHOME}</odm.home>
<ilmt.jar.file.path>${env.ILMT_JAR_PATH}</ilmt.jar.file.path>
</properties>
Expand Down Expand Up @@ -63,6 +63,12 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -76,14 +82,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.200</version>
<version>2.2.224</version>
<scope>runtime</scope>
</dependency>

Expand Down Expand Up @@ -116,7 +118,7 @@
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>2.9.6</version>
<version>2.15.2</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -168,4 +170,4 @@
</plugins>
<finalName>metering-service-no-dependencies</finalName>
</build>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
package com.ibm.decision.metering.ilmt.service.application;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;

import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.stereotype.Controller;
Expand All @@ -33,8 +33,7 @@ public String handleError(HttpServletRequest request) {
return GlobalErrorHandler.handleError(request, null);
}

@Override
public String getErrorPath() {
return "/error";
return null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
package com.ibm.decision.metering.ilmt.service.application;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
*/
package com.ibm.decision.metering.ilmt.service.application;

import javax.servlet.RequestDispatcher;
import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.RequestDispatcher;
import jakarta.servlet.http.HttpServletRequest;

import org.slf4j.Logger;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;

import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.util.Properties;
import java.util.stream.Collectors;

import javax.annotation.PostConstruct;
import jakarta.annotation.PostConstruct;

import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@

import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;

@Entity
@Table(name = "METRIC")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
*/
package com.ibm.decision.metering.ilmt.service.registration.repository;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Lob;
import jakarta.persistence.Table;

import org.slf4j.Logger;

Expand All @@ -34,13 +35,15 @@
public class RegistrationEntity {
private final static Logger LOGGER = Environment.getLogger();

@Id
@Id
@Column(name="ID")
private String id;


@Column(name="LAST_UPDATE")
private long lastUpdate;

@Lob
@Column(name="DEFINITION")
private String definition;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
import java.time.Instant;
import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;

@Entity
@Table(name = "REPORT")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
import java.time.Instant;
import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Lob;
import jakarta.persistence.Table;

import org.slf4j.Logger;

Expand All @@ -46,6 +47,7 @@ public class UsageEntity {
@Column(name="TIMESTAMP")
private long timestamp;

@Lob
@Column(name="DEFINITION")
private String definition;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ public interface UsageRepository extends CrudRepository<UsageEntity, String> {
@Query("SELECT u FROM UsageEntity u WHERE u.id = ?1")
List<UsageEntity> findByInstanceId(String instanceId);

@Query("SELECT m FROM UsageEntity m WHERE m.instanceId = ?1 AND m.report = null")
@Query("SELECT m FROM UsageEntity m WHERE m.instanceId = ?1 AND m.report IS null")
List<UsageEntity> findByInstanceIdWhereNoReport(String instanceId);

@Query("SELECT m FROM UsageEntity m WHERE m.report = null")
@Query("SELECT m FROM UsageEntity m WHERE m.report IS null")
List<UsageEntity> finAllUsagesNotReported();

@Query("SELECT m FROM UsageEntity m WHERE m.report IS NOT null")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.test.context.junit4.SpringRunner;

import com.ibm.decision.metering.ilmt.service.application.util.RequestFactory;
Expand Down

0 comments on commit 4589280

Please sign in to comment.