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

(WIP) Upgrade to v7.9.2 (closes #143) #144

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"project": "./tsconfig.json"
"project": ["./tsconfig.app.json", "./tsconfig.spec.json"]
},
"rules": {
"@angular-eslint/component-selector": [
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
script-shell=bash
3 changes: 0 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,3 @@ package-lock.json
.mvn
gradle
.gradle
### MODIFICATION-START ###
contrib
### MODIFICATION-END ###
2 changes: 1 addition & 1 deletion .yo-rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
],
"entitySuffix": "",
"jhiPrefix": "jhi",
"jhipsterVersion": "7.8.1",
"jhipsterVersion": "7.9.2",
"languages": ["en", "de"],
"lastLiquibaseTimestamp": 1649348442000,
"messageBroker": false,
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ all: help
.PHONY: prerequisites
prerequisites: ## Install prerequisite npm tools.
@echo "Installing prerequisites with JHipster ..."
npm install -g generator-jhipster@7.8.1
npm install -g generator-jhipster@7.9.2
npm install -g yo
npm install -g rimraf

Expand Down Expand Up @@ -80,7 +80,7 @@ start-keycloak: ## Start the Keycloak container for authentication.
$(TOOLS_DIR)/wait-for-container.sh \
'Keycloak' \
$(COMPOSE_FILES)/keycloak.yml \
'Admin console listening on'
'Keycloak 18.0.0 on JVM'

.PHONY: stop-keycloak
stop-keycloak: ## Stop the Keycloak container.
Expand Down
88 changes: 29 additions & 59 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ test {
testLogging {
events 'FAILED', 'SKIPPED'
}
jvmArgs += '-Djava.security.egd=file:/dev/./urandom -Xmx256m'
jvmArgs += '-Djava.security.egd=file:/dev/./urandom -Xmx512m'
// uncomment if the tests reports are not generated
// see https://github.com/jhipster/generator-jhipster/pull/2771 and https://github.com/jhipster/generator-jhipster/pull/4484
// ignoreFailures true
Expand All @@ -109,24 +109,7 @@ modernizer {
includeTestClasses = true
}

task integrationTest(type: Test) {
useJUnitPlatform()
description = "Execute integration tests."
group = "verification"
include "**/*IT*", "**/*IntTest*"
testLogging {
events 'FAILED', 'SKIPPED'
}
jvmArgs += '-Djava.security.egd=file:/dev/./urandom -Xmx256m'
if (project.hasProperty('testcontainers')) {
environment 'spring.profiles.active', 'testcontainers'
}

// uncomment if the tests reports are not generated
// see https://github.com/jhipster/generator-jhipster/pull/2771 and https://github.com/jhipster/generator-jhipster/pull/4484
// ignoreFailures true
reports.html.enabled = false
}

check.dependsOn integrationTest
task testReport(type: TestReport) {
Expand Down Expand Up @@ -195,7 +178,7 @@ configurations {
resolutionStrategy {
// Inherited version from Spring Boot can't be used because of regressions:
// To be removed as soon as spring-boot use the same version
force 'org.liquibase:liquibase-core:4.6.1'
force 'org.liquibase:liquibase-core:4.12.0'
}
}
}
Expand All @@ -218,62 +201,49 @@ dependencies {
implementation group: "tech.jhipster", name: "jhipster-framework"
implementation "javax.annotation:javax.annotation-api"
implementation "org.springframework.boot:spring-boot-starter-cache"
implementation "io.dropwizard.metrics:metrics-core"
implementation "io.micrometer:micrometer-registry-prometheus"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-hppc"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
implementation "com.fasterxml.jackson.module:jackson-module-jaxb-annotations"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-hibernate5"
implementation "com.fasterxml.jackson.core:jackson-annotations"
implementation "com.fasterxml.jackson.core:jackson-databind"
implementation "javax.cache:cache-api"
implementation "org.hibernate:hibernate-core"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-hppc"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
testImplementation "org.testcontainers:junit-jupiter"
testImplementation "org.testcontainers:testcontainers"
implementation "org.springdoc:springdoc-openapi-webmvc-core"
implementation "com.zaxxer:HikariCP"
implementation "org.apache.commons:commons-lang3"
implementation "org.openapitools:jackson-databind-nullable:${jacksonDatabindNullableVersion}"
implementation "javax.transaction:javax.transaction-api"
implementation "javax.cache:cache-api"
implementation "org.ehcache:ehcache"
implementation "org.hibernate:hibernate-jcache"
implementation "org.hibernate:hibernate-entitymanager"
annotationProcessor "org.hibernate:hibernate-jpamodelgen:${hibernateVersion}"
implementation "org.hibernate:hibernate-core"
implementation "org.hibernate.validator:hibernate-validator"
implementation "org.liquibase:liquibase-core"
liquibaseRuntime "org.liquibase:liquibase-core"
liquibaseRuntime "org.liquibase.ext:liquibase-hibernate5:${liquibaseHibernate5Version}"
liquibaseRuntime sourceSets.main.compileClasspath
implementation "org.mapstruct:mapstruct:${mapstructVersion}"
annotationProcessor "org.mapstruct:mapstruct-processor:${mapstructVersion}"
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-loader-tools"
implementation "org.springframework.boot:spring-boot-starter-mail"
implementation "org.springframework.boot:spring-boot-starter-logging"
implementation "org.springframework.boot:spring-boot-starter-actuator"
implementation "org.springframework.boot:spring-boot-starter-data-jpa"
testImplementation "org.testcontainers:postgresql"
implementation "org.springframework.boot:spring-boot-starter-security"
implementation ("org.springframework.boot:spring-boot-starter-web") {
exclude module: "spring-boot-starter-tomcat"
}
implementation "org.springframework.boot:spring-boot-starter-undertow"
testImplementation "org.testcontainers:jdbc"
implementation "org.springframework.boot:spring-boot-starter-logging"
implementation "org.springframework.boot:spring-boot-starter-mail"
implementation "org.springframework.boot:spring-boot-starter-thymeleaf"
implementation "org.zalando:problem-spring-web"
implementation "org.springframework.security:spring-security-config"
implementation "org.springframework.security:spring-security-data"
implementation "org.springframework.security:spring-security-web"
implementation "org.springframework.boot:spring-boot-starter-oauth2-client"
implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server"
implementation ("org.springdoc:springdoc-openapi-webmvc-core")
implementation "org.postgresql:postgresql"
liquibaseRuntime "org.postgresql:postgresql"
implementation "org.mapstruct:mapstruct:${mapstructVersion}"
annotationProcessor "org.mapstruct:mapstruct-processor:${mapstructVersion}"
annotationProcessor "org.hibernate:hibernate-jpamodelgen:${hibernateVersion}"
annotationProcessor "org.glassfish.jaxb:jaxb-runtime:${jaxbRuntimeVersion}"
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-web"
testImplementation "org.springframework.boot:spring-boot-starter-test"
testImplementation "org.springframework.security:spring-security-test"
testImplementation "org.springframework.boot:spring-boot-test"
testImplementation "org.springframework.security:spring-security-test"
testImplementation "com.tngtech.archunit:archunit-junit5-api:${archunitJunit5Version}"
testRuntimeOnly "com.tngtech.archunit:archunit-junit5-engine:${archunitJunit5Version}"
testImplementation "com.h2database:h2"
liquibaseRuntime "com.h2database:h2"
developmentOnly "org.springframework.boot:spring-boot-devtools:${springBootVersion}"
implementation "org.zalando:problem-spring-web"
implementation "org.springframework.boot:spring-boot-starter-undertow"
implementation "org.springframework.boot:spring-boot-starter-oauth2-client"
implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server"
implementation "org.springframework.security:spring-security-data"
implementation "io.micrometer:micrometer-registry-prometheus"
implementation "io.dropwizard.metrics:metrics-core"
liquibaseRuntime sourceSets.main.compileClasspath
liquibaseRuntime "org.liquibase.ext:liquibase-hibernate5:${liquibaseHibernate5Version}"
//jhipster-needle-gradle-dependency - JHipster will add additional dependencies here
}

Expand Down Expand Up @@ -307,8 +277,8 @@ if (project.hasProperty("nodeInstall")) {
Architecture arch = org.gradle.nativeplatform.platform.internal.DefaultNativePlatform.getCurrentArchitecture();
Boolean downloadNode = !os.isMacOsX() || arch.isAmd64()
node {
version = "16.14.0"
npmVersion = "8.6.0"
version = "16.16.0"
npmVersion = "8.15.1"
download = downloadNode
}

Expand Down
50 changes: 50 additions & 0 deletions contrib/7.9.x_migration/Migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# sed 's/new \([^(]*\)(\([^)]*\))/New\1{\2}/g'


ENTITY_NAMES = ["Activity",
"Badge",
"BadgeSkillComment",
"Dimension",
"Image",
"Level",
"LevelSkillReport",
"Skill",
"Team",
"TeamSkill",
"Training",
"TeamGroup",
"PersistentAuditEvent",
"PersistentAuditEventData"]

from os import walk
import os
import re

def get_files_to_edit():
for (dirpath, dirnames, filenames) in walk("."):
for file in filenames:
if file.endswith('.ts'):
yield os.path.join(dirpath, file)


def substitute(matchobj):
# print("group1:",matchobj.group(0), "group2", matchobj.group(1), "group3", matchobj.group(2))
return "".join(['New', matchobj.group(1), "{", matchobj.group(2), "}"])

def edit_file(filepath):
with open(filepath, 'r+') as f:
filecontent = f.readlines()
str = "".join(filecontent)
for entity in ENTITY_NAMES:
str = re.sub(r'new ({})[\s]*\(([^)]*)\)'.format(entity), substitute, str)
f.seek(0)
f.truncate(0)
f.write(str)


def migrate_entity_instanciations():
for file in get_files_to_edit():
edit_file(file)

if __name__ == "__main__":
migrate_entity_instanciations()
2 changes: 2 additions & 0 deletions contrib/7.9.x_migration/test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# hjello
let skill = new Skill();
1 change: 1 addition & 0 deletions contrib/7.9.x_migration/test/foo/nestedInstanciation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let skill = new Skill( 2, "hello", new Training("Foo fight train"));
13 changes: 13 additions & 0 deletions contrib/7.9.x_migration/test/multipleInstanciations.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* TODO test*/
let skill = new Skill("Hello", 2,3 );


// test
function instanciated_newSkill(newskill: Skill) {
return new Skill("Hello", [2]);
}

function instanciateNewActivity() {
let comp = new SkillComponent("test");
return new Activity();
}
2 changes: 2 additions & 0 deletions contrib/7.9.x_migration/test/testTest/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
'test'
let skill = new Skill("Hello", 3, [3,3]);
4 changes: 4 additions & 0 deletions contrib/7.9.x_migration/testMultiLine.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
let team = new Team ("Hello",
34, "world",
[2,3,4],
"test", {test : 1, foo :2, bar: [3,4]} );
29 changes: 15 additions & 14 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,34 @@ rootProject.name=team-dojo
profile=dev

# Dependency versions
jhipsterDependenciesVersion=7.8.1
jhipsterDependenciesVersion=7.9.2
# The spring-boot version should match the one managed by
# https://mvnrepository.com/artifact/tech.jhipster/jhipster-dependencies/7.8.1
springBootVersion=2.6.6
# https://mvnrepository.com/artifact/tech.jhipster/jhipster-dependencies/7.9.2
springBootVersion=2.7.2
# The hibernate version should match the one managed by
# https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/2.6.6 -->
hibernateVersion=5.6.7.Final
mapstructVersion=1.4.2.Final
# https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/2.7.2 -->
hibernateVersion=5.6.10.Final
mapstructVersion=1.5.2.Final
archunitJunit5Version=0.22.0
jacksonDatabindNullableVersion=0.2.2
liquibaseHibernate5Version=4.6.1
jacksonDatabindNullableVersion=0.2.3
liquibaseHibernate5Version=4.12.0
liquibaseTaskPrefix=liquibase



jaxbRuntimeVersion=2.3.3
jaxbRuntimeVersion=4.0.0

# gradle plugin version
jibPluginVersion=3.2.1
gitPropertiesPluginVersion=2.4.0
gradleNodePluginVersion=3.2.1
gitPropertiesPluginVersion=2.4.1
gradleNodePluginVersion=3.4.0
liquibasePluginVersion=2.1.1
sonarqubePluginVersion=3.3
openapiPluginVersion=5.4.0
sonarqubePluginVersion=3.4.0.2513
openapiPluginVersion=6.0.1
noHttpCheckstyleVersion=0.0.10
checkstyleVersion=10.1
checkstyleVersion=10.3.1
modernizerPluginVersion=1.6.2

# jhipster-needle-gradle-property - JHipster will add additional properties here

## below are some of the gradle performance improvement settings that can be used as required, these are not enabled by default
Expand Down
8 changes: 7 additions & 1 deletion gradle/docker.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
jib {
from {
image = "eclipse-temurin:17-jre-focal"
image = "eclipse-temurin:11-jre-focal"
platforms {
platform {
architecture = "${findProperty('jibArchitecture') ?: 'amd64'}"
os = "linux"
}
}
}
to {
image = "teamdojo:latest"
Expand Down
28 changes: 27 additions & 1 deletion gradle/profile_dev.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
sourceSets {
test {
java {
exclude 'com/iteratec/teamdojo/config/PostgreSqlTestContainer.java'
}
}
}
dependencies {
developmentOnly "org.springframework.boot:spring-boot-devtools:${springBootVersion}"
implementation "com.h2database:h2"
testImplementation "org.testcontainers:postgresql"
}

def profiles = "dev"
Expand All @@ -20,7 +28,7 @@ springBoot {
}

bootRun {
args = []
args = ["--spring.profiles.active=${profiles}"]
}

task webapp(type: NpmTask) {
Expand Down Expand Up @@ -65,5 +73,23 @@ processResources {
}
}

task integrationTest(type: Test) {
maxHeapSize = "1G"
useJUnitPlatform()
description = "Execute integration tests."
group = "verification"
include "**/*IT*", "**/*IntTest*"
testLogging {
events 'FAILED', 'SKIPPED'
}
systemProperty('spring.profiles.active', 'testdev')
systemProperty('java.security.egd', 'file:/dev/./urandom')
// uncomment if the tests reports are not generated
// see https://github.com/jhipster/generator-jhipster/pull/2771 and https://github.com/jhipster/generator-jhipster/pull/4484
// ignoreFailures true
reports.html.enabled = false
}
integrationTest.dependsOn test

processResources.dependsOn webapp
bootJar.dependsOn processResources
Loading