Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 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
123 changes: 92 additions & 31 deletions Jenkinsfile.split
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ properties([
booleanParam(name: 'skipJsLibraries', defaultValue: false, description: "Whether to skip deployment of Javascript/Typescript libraries"),
string( name: 'testingVersion', defaultValue: "", description: "Version for testing"),
string( name: 'meshVersion', defaultValue: "", description: "Override Mesh version"),
string( name: 'meshJsVersion', defaultValue: "", description: "Override Mesh JS version for the testing deployment"),
])
])

Expand Down Expand Up @@ -64,12 +65,15 @@ final def testPart(partName, current, branches) {
if (Boolean.valueOf(params.testHsqlm)) {
noHsqldb = false
}
withCredentials([usernamePassword(credentialsId: 'docker.gentics.com', usernameVariable: 'repoUsername', passwordVariable: 'repoPassword'),usernamePassword(credentialsId: 'gentics.gpg', usernameVariable: 'gpgKeyName', passwordVariable: 'gpgKeyPass')]) {
withCredentials([
usernamePassword(credentialsId: 'docker.gentics.com', usernameVariable: 'repoUsername', passwordVariable: 'repoPassword'),
usernamePassword(credentialsId: 'gentics.gpg', usernameVariable: 'gpgKeyName', passwordVariable: 'gpgKeyPass')
]) {
try {
// prior to starting the tests, start the docker containers with the db and the testdb-manager
sh 'docker login -u $repoUsername -p $repoPassword docker.gentics.com'
if (Boolean.valueOf(params.testMaria)) {
sh "mvn -pl :mesh-database-connector-mariadb docker:start -Dskip.mariadb.tests=${noMariadb} "
sh "mvn -pl :mesh-database-connector-mariadb docker:start -Dskip.mariadb.tests=${noMariadb} "
}
// run the tests
withEnv(["TESTCONTAINERS_RYUK_DISABLED=true", "MESH_CONSISTENCY_CHECKS=" + (Boolean.valueOf(params.consistencyChecks) ? "true" : "false"), "MAVEN_OPTS=-Xmx1g -XX:MaxMetaspaceSize=128m "]) {
Expand All @@ -78,10 +82,10 @@ final def testPart(partName, current, branches) {
} finally {
// finally stop the docker containers
if (Boolean.valueOf(params.testMaria)) {
sh "mvn -pl :mesh-database-connector-mariadb docker:stop -Dskip.mariadb.tests=${noMariadb} "
sh "mvn -pl :mesh-database-connector-mariadb docker:stop -Dskip.mariadb.tests=${noMariadb} "
}
}
}
}
stash name: "jacoco" + current, includes: "**/jacoco-partial.exec", allowEmpty: true
} finally {
step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/*.xml'])
Expand All @@ -94,7 +98,7 @@ final def testPart(partName, current, branches) {
}

stage("Setup Build Environment") {
node("mesh-root-worker-3.2") {
node("mesh-root-worker-3.3") {
githubBuildStarted()
try {
stage("Checkout") {
Expand Down Expand Up @@ -127,10 +131,8 @@ stage("Setup Build Environment") {
version = MavenHelper.transformSnapshotToReleaseVersion(version)
MavenHelper.setVersion(version)
}
//TODO only add pom.xml files
sh 'git add .'
sh "git commit -m 'Raise version'"
GitHelper.addTag(version, 'Release of version ' + version)
sh 'git add **/pom.xml'
// Committing the changes is done later in git-push, as the JS packages also need to update their versions
} else if (Boolean.valueOf(params.setBranchAsVersion)) {
version = branchName + "-SNAPSHOT"
echo "Building version " + version
Expand Down Expand Up @@ -231,6 +233,50 @@ stage("Setup Build Environment") {
}
}

stage("Javascript Packages") {
if (env.BUILD_SKIPPED != "true" && !Boolean.valueOf(params.skipJsLibraries)) {
environment {
// Disable colors/special characters, if projects do properly check it
TERM="dumb"
// Disable node based color libraries
FORCE_COLOR="0"
// Mark this as a CI build
CI="true"
}

dir("js") {
// Patch test version, if requested
def jsVersion = version
if (params.meshJsVersion?.trim()) {
jsVersion = params.meshJsVersion.trim()
}

// Install dependencies
sh 'npm ci --no-audit --no-fund'

if (
// If the version isn't semver, we can't set it, as NX just explodes
(jsVersion ==~ /[\d]+\.[\d]+\.[\d]+[a-zA-Z0-9-]*/)
// Or if we just do a testing deployment
|| !Boolean.valueOf(params.runDeployTesting)
) {
// Set the version for the packages
sh "npm run nx -- release version ${jsVersion}"
}

// Build all JS packages
sh 'npm run nx -- run-many --targets=build --configuration=ci'

// Run the tests if enabled
if (Boolean.valueOf(params.runTests)) {
sh 'npm run nx -- run-many --targets=test --configuration=ci'
}
}
} else {
echo "Javascript Packages skipped.."
}
}

stage("Unstable Tests") {
if (env.BUILD_SKIPPED != "true" && Boolean.valueOf(params.runUnstableTests)) {
sshagent(["git"]) {
Expand Down Expand Up @@ -258,7 +304,10 @@ stage("Setup Build Environment") {
} else {
echo "MariaDB skipped.."
}
withCredentials([usernamePassword(credentialsId: 'docker.gentics.com', usernameVariable: 'repoUsername', passwordVariable: 'repoPassword'), usernamePassword(credentialsId: 'gentics.gpg', usernameVariable: 'gpgKeyName', passwordVariable: 'gpgKeyPass')]) {
withCredentials([
usernamePassword(credentialsId: 'docker.gentics.com', usernameVariable: 'repoUsername', passwordVariable: 'repoPassword'),
usernamePassword(credentialsId: 'gentics.gpg', usernameVariable: 'gpgKeyName', passwordVariable: 'gpgKeyPass')
]) {
try {
// first we start the test db manager
sh 'docker login -u $repoUsername -p $repoPassword docker.gentics.com'
Expand Down Expand Up @@ -287,26 +336,38 @@ stage("Setup Build Environment") {
// echo "Setup of GPG"
// sh "gpg --no-tty --batch --import /mnt/credentials/gpg/gpg-public-key.asc"
// sh "gpg --no-tty --batch --import /mnt/credentials/gpg/gpg-secret-key.asc"
withCredentials([usernamePassword(credentialsId: 'docker.gentics.com', usernameVariable: 'repoUsername', passwordVariable: 'repoPassword'),usernamePassword(credentialsId: 'gentics.gpg', usernameVariable: 'gpgKeyName', passwordVariable: 'gpgKeyPass')]) {
withCredentials([
usernamePassword(credentialsId: 'docker.gentics.com', usernameVariable: 'repoUsername', passwordVariable: 'repoPassword'),
usernamePassword(credentialsId: 'gentics.gpg', usernameVariable: 'gpgKeyName', passwordVariable: 'gpgKeyPass')
]) {
sh "mvn -B -DskipTests -Dskip.unit.tests -am -pl 'server,:mesh-database-connector-mariadb,:mesh-database-connector-hsqldb,bom,plugin-bom,plugin-parent' clean deploy"
}
} else if (Boolean.valueOf(params.runDeploy)) {
// echo "Setup of GPG"
// sh "gpg --no-tty --batch --import /mnt/credentials/gpg/gpg-public-key.asc"
// sh "gpg --no-tty --batch --import /mnt/credentials/gpg/gpg-secret-key.asc"
withCredentials([usernamePassword(credentialsId: 'docker.gentics.com', usernameVariable: 'repoUsername', passwordVariable: 'repoPassword'),usernamePassword(credentialsId: 'gentics.gpg', usernameVariable: 'gpgKeyName', passwordVariable: 'gpgKeyPass')]) {
withCredentials([
usernamePassword(credentialsId: 'docker.gentics.com', usernameVariable: 'repoUsername', passwordVariable: 'repoPassword'),
usernamePassword(credentialsId: 'gentics.gpg', usernameVariable: 'gpgKeyName', passwordVariable: 'gpgKeyPass')
]) {
sh "mvn -U -B -DskipTests -Dgpg.skip=false clean deploy"
}
} else if (Boolean.valueOf(params.setBranchAsVersion)) {
withCredentials([usernamePassword(credentialsId: 'docker.gentics.com', usernameVariable: 'repoUsername', passwordVariable: 'repoPassword'),usernamePassword(credentialsId: 'gentics.gpg', usernameVariable: 'gpgKeyName', passwordVariable: 'gpgKeyPass')]) {
withCredentials([
usernamePassword(credentialsId: 'docker.gentics.com', usernameVariable: 'repoUsername',
passwordVariable: 'repoPassword'),usernamePassword(credentialsId: 'gentics.gpg', usernameVariable: 'gpgKeyName', passwordVariable: 'gpgKeyPass')
]) {
sh "mvn -U -B -DskipTests -Dgpg.skip=false -pl '!doc,!changelog' clean install"
}
} else {
withCredentials([usernamePassword(credentialsId: 'docker.gentics.com', usernameVariable: 'repoUsername', passwordVariable: 'repoPassword'),usernamePassword(credentialsId: 'gentics.gpg', usernameVariable: 'gpgKeyName', passwordVariable: 'gpgKeyPass')]) {
withCredentials([
usernamePassword(credentialsId: 'docker.gentics.com', usernameVariable: 'repoUsername', passwordVariable: 'repoPassword'),
usernamePassword(credentialsId: 'gentics.gpg', usernameVariable: 'gpgKeyName', passwordVariable: 'gpgKeyPass')
]) {
sh "mvn -B -DskipTests clean package"
}
}
}
}
} else {
echo "Maven build skipped.."
}
Expand Down Expand Up @@ -424,31 +485,23 @@ stage("Setup Build Environment") {
}
}

if (Boolean.valueOf(params.runDeploy) && !Boolean.valueOf(params.skipJsLibraries)) {
sh "echo @gentics:registry=https://repo.gentics.com/repository/npm-products/ > js/.npmrc"
sh "echo 'git-tag-version = false' >> js/.npmrc"
sh "echo 'allow-same-version = true' >> js/.npmrc"
if (!Boolean.valueOf(params.skipJsLibraries) && (Boolean.valueOf(params.runDeploy) || Boolean.valueOf(params.runDeployTesting))) {
environment {
// Disable colors/special characters, if projects do properly check it
TERM="dumb"
// Disable node based color libraries
FORCE_COLOR="0"
}

// Add private repository credentials and scopes
withCredentials([string(credentialsId: 'nexus-npm', variable: 'NPM_TOKEN')]) {
sh "echo //repo.gentics.com/repository/npm-products/:_auth=${env.NPM_TOKEN} >> js/.npmrc"
sh "echo //repo.gentics.com/repository/npm-products/:_auth=${env.NPM_TOKEN} >> ~/.npmrc"
}

dir(path: 'js') {
// Install dependencies
sh 'npm ci --no-audit --no-fund'

// Set the version for the packages
sh "npm run nx -- release version ${version}"

// Build all JS packages
sh 'npm run nx -- run-many --targets build'

// Publish the pacakges to artifactory
sh "npm run nx -- release publish"
}

sh "rm js/.npmrc"
}
} else {
echo "Deploy skipped.."
Expand All @@ -458,9 +511,17 @@ stage("Setup Build Environment") {
stage("Git push") {
if (env.BUILD_SKIPPED != "true" && Boolean.valueOf(params.runDeploy)) {
sshagent(["git"]) {
// First we want to commit + tag the changes pom.xml and package.json files,
// where the verison has changed from x.y.z-SNAPSHOT to just x.y.z for a release.
GitHelper.addCommit('.', gitCommitTag + ' Release of version (' + version + ')')
GitHelper.addTag(version, 'Release of version ' + version)

// Then update all the pom.xml files again to add the -SNAPSHOT suffix again,
// and commit that as a new develop iteration.
def snapshotVersion = MavenHelper.getNextSnapShotVersion(version)
MavenHelper.setVersion(snapshotVersion)
GitHelper.addCommit('.', gitCommitTag + ' Prepare for the next development iteration (' + snapshotVersion + ')')

GitHelper.pushBranch(branchName)
GitHelper.pushTag(version)
}
Expand Down
37 changes: 22 additions & 15 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<!-- when updating version, don't forget to update administration-guide.asciidoc -->
<!-- when updating version, don't forget to update
administration-guide.asciidoc -->
<graphql.version>21.5</graphql.version>
<graphql-scalars.version>21.0</graphql-scalars.version>
<graphql-dataloader.version>3.2.2</graphql-dataloader.version>
<graphql-filter.version>3.0.7</graphql-filter.version>
<graphql-filter.version>3.0.8</graphql-filter.version>
<pf4j.version>3.14.1</pf4j.version>
<asm.version>3.3.1</asm.version>
<spring.security.version>6.3.5</spring.security.version>
Expand Down Expand Up @@ -49,7 +50,8 @@
<micrometer.version>1.15.5</micrometer.version>
</properties>

<!-- IMPORTANT: Always keep dependencies in-sync with mesh-plugin-parent pom in order to avoid duplicate libraries in shaded plugin jars -->
<!-- IMPORTANT: Always keep dependencies in-sync with mesh-plugin-parent pom
in order to avoid duplicate libraries in shaded plugin jars -->
<dependencyManagement>
<dependencies>
<!-- Logging -->
Expand Down Expand Up @@ -183,11 +185,11 @@
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<artifactId>jcl-over-slf4j</artifactId>
</exclusion>
</exclusions>
</dependency>
Expand All @@ -198,11 +200,11 @@
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<artifactId>jcl-over-slf4j</artifactId>
</exclusion>
</exclusions>
</dependency>
Expand Down Expand Up @@ -270,7 +272,7 @@
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>2.9.0</version>
<version>2.10.0</version>
</dependency>
<dependency>
<groupId>org.skyscreamer</groupId>
Expand All @@ -283,7 +285,7 @@
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>${testcontainers.version}</version>
</dependency>
Expand Down Expand Up @@ -381,6 +383,11 @@
<artifactId>vertx-hazelcast</artifactId>
<version>${vertx.version}</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-json-schema</artifactId>
<version>${vertx.version}</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-auth-common</artifactId>
Expand Down Expand Up @@ -808,9 +815,9 @@
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
<version>3.2.0</version>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>com.squareup.inject</groupId>
Expand All @@ -833,9 +840,9 @@
<version>${hazelcast-hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-jcache</artifactId>
<version>${hibernate.version}</version>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-jcache</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate.orm</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Core: A new field type, `JSON`, has been added. Having a string in its base, it provides such additional functionality, as JSON structure / schema verification, and extended JsonPath filtering in GraphQL requests.
1 change: 1 addition & 0 deletions common/src/main/resources/i18n/translations_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ node_error_invalid_microschema_field_value=Der Wert für das Feld "{0}" darf nic
node_list_item_not_found=Der in der Liste angegebene Node mit der uuid {0} konnte nicht gefunden werden.
node_update_failed=Aktualisierung des Node "{0}" ist fehlgeschlagen.
node_error_invalid_string_field_value=Das String Feld "{0}" darf nicht mit dem Wert "{1}" befüllt werden.
node_error_invalid_json_field_value=Das JSON Feld "{0}" darf nicht mit dem Wert "{1}" befüllt werden.
node_error_string_field_value_too_long=Das String Feld "{0}" kann höchstens {1} Zeichen enthalten, übergeben wurden {2} Zeichen.
node_conflicting_segmentfield_update=Das Segmentfeld "{0}" kann nicht mit dem Wert "{1}" befüllt werden, weil dieser Wert bereits verwendet wird.
node_conflicting_segmentfield_upload=Die Datei "{1}" kann nicht in das Segmentfeld "{0}" geladen werden, weil der Dateiname bereits verwendet wird.
Expand Down
1 change: 1 addition & 0 deletions common/src/main/resources/i18n/translations_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ node_error_invalid_schema_field_value=The field "{0}" is not allowed to use sche
node_list_item_not_found=Node within node list with uuid {0} could not be found.
node_update_failed=Update of node "{0}" failed.
node_error_invalid_string_field_value=The string field "{0}" must not be set to value "{1}".
node_error_invalid_json_field_value=The JSON field "{0}" must not be set to value "{1}".
node_error_string_field_value_too_long=The string Feld "{0}" can only hold up to {1} characters, but {2} characters were given.
node_conflicting_segmentfield_update=The segment field "{0}" must not be set to value "{1}" because this value is already used.
node_conflicting_segmentfield_upload=The file "{1}" cannot be uploaded into the segment field "{0}" because the filename is already in use.
Expand Down
1 change: 1 addition & 0 deletions common/src/main/resources/i18n/translations_zh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ node_error_invalid_microschema_field_value=字段“{0}”的值不得使用内
node_list_item_not_found=在uuid为{0}的节点列表中找不到节点。
node_update_failed=节点“{0}”更新失败。
node_error_invalid_string_field_value=字符串字段“{0}”不得设置为值“{1}”。
node_error_invalid_json_field_value=JSON 字段“{0}”不能设置为值“{1}”。
node_conflicting_segmentfield_update=分节字段“{0}”不得设置为值“{1}”,因为该值已被使用。
node_conflicting_segmentfield_upload=文件“{1}”无法上传到分节字段“{0}”中,因为文件名已被使用。
node_conflicting_segmentfield_move=无法移动节点,因为分节字段“{0}”中的值“{1}”发生冲突。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.hibernate.query.Query;
import org.hibernate.query.internal.QueryOptionsImpl;
import org.hibernate.query.spi.Limit;
import org.hibernate.type.SqlTypes;
import org.hibernate.type.spi.TypeConfiguration;
import org.slf4j.Logger;

Expand All @@ -46,6 +47,7 @@
import com.gentics.mesh.core.data.project.HibProject;
import com.gentics.mesh.core.data.schema.HibFieldSchemaVersionElement;
import com.gentics.mesh.core.rest.common.FieldTypes;
import com.gentics.mesh.core.rest.node.field.JsonContent;
import com.gentics.mesh.database.HibernateTx;
import com.gentics.mesh.etc.config.HibernateMeshOptions;
import com.gentics.mesh.hibernate.MeshTablePrefixStrategy;
Expand Down Expand Up @@ -385,6 +387,11 @@ public String getSqlTypeName(FieldTypes type, String uuidTypeName) {
TypeConfiguration typeConfig = getSessionMetadataIntegrator().getSessionFactoryImplementor().getTypeConfiguration();
Dialect dialect = getHibernateDialect();
switch (type) {
case JSON:
return typeConfig.getDdlTypeRegistry().getTypeName(
SqlTypes.JSON,
new Size(getSqlTypePrecision(type), getSqlTypeScale(type), getSqlTypeLength(type)),
typeConfig.getBasicTypeForJavaType(JsonContent.class));
case STRING:
case HTML:
return typeConfig.getDdlTypeRegistry().getTypeName(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@
<includeAll path="entries-3.0.x" relativeToChangelogFile="true" errorIfMissingOrEmpty="false"/>
<!-- 3.1.x changes -->
<includeAll path="entries-3.1.x" relativeToChangelogFile="true" errorIfMissingOrEmpty="false"/>
<!-- 3.3.x changes -->
<includeAll path="entries-3.3.x" relativeToChangelogFile="true" errorIfMissingOrEmpty="false"/>
</databaseChangeLog>
Loading