Skip to content

Sync branch 4.0.x with main to release 4.0.5 #273

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

Merged
merged 33 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9a03964
Removing gson and everit dependencies
fjtirado Jul 6, 2023
6fc1408
Changing to networknt
fjtirado Jul 6, 2023
159c15d
Enable dependabot to upgrade libs (#240)
ricardozanini Jul 10, 2023
c2c0122
Review comments
fjtirado Jul 7, 2023
7891b9f
Validation Error Test
fjtirado Jul 12, 2023
fd35a9e
Changing validator back to List
fjtirado Jul 13, 2023
078a930
Bump org.apache.commons:commons-lang3 from 3.9 to 3.13.0
dependabot[bot] Jul 31, 2023
6a84c9e
add missing support for contextAttributes in ProduceEvent
visheshruparelia Aug 5, 2023
1133bbb
Bump ch.qos.logback:logback-classic from 1.4.8 to 1.4.9
dependabot[bot] Aug 7, 2023
ac9af39
Update Code of Conduct to follow the new standard
ricardozanini Sep 28, 2023
7ca919e
Bump org.thymeleaf:thymeleaf from 3.0.11.RELEASE to 3.1.2.RELEASE
dependabot[bot] Oct 11, 2023
b2cbb09
Bump com.networknt:json-schema-validator from 1.0.86 to 1.0.87
dependabot[bot] Oct 16, 2023
d14eac4
Bump org.mockito:mockito-core from 3.0.0 to 5.6.0
dependabot[bot] Oct 16, 2023
5a8b6f3
Bump com.coveo:fmt-maven-plugin from 2.9 to 2.13
dependabot[bot] Oct 16, 2023
2fc7d7f
Bump version.com.fasterxml.jackson from 2.15.2 to 2.15.3
dependabot[bot] Oct 16, 2023
e237470
Bump org.apache.maven.plugins:maven-failsafe-plugin from 2.22.0 to 3.1.2
dependabot[bot] Oct 16, 2023
f849d18
Introduce Release Workflow
ricardozanini Jul 28, 2023
24c6569
Remove gpg, deploy workflow
ricardozanini Jul 28, 2023
873033b
formatting yml files
ricardozanini Jul 28, 2023
9df5702
Remove unneeded attrs
ricardozanini Jul 28, 2023
12db914
Fix commons-lang3 property version
ricardozanini Oct 11, 2023
d85b198
Removing unused property versions
ricardozanini Oct 11, 2023
8483f17
Fix formatting, replace fmt for spotify group, rebase
ricardozanini Oct 19, 2023
b332fc8
Sync main with 4.0.x
ricardozanini Oct 20, 2023
67a6634
Downgrade to Java 1.8
ricardozanini Oct 20, 2023
4431edd
Align workflow to run on 4.0.* branch
ricardozanini Oct 20, 2023
432a7a1
Fix java version in setup-java action
ricardozanini Oct 20, 2023
7a9d0b3
Downgrading fmt plugin to cope with Java 1.8
ricardozanini Oct 20, 2023
b4a187a
Fix fmt downgrading
ricardozanini Oct 20, 2023
271cc0b
Change WorkflowValidatorImpl to match Java 8 API
ricardozanini Oct 20, 2023
dca3b9a
Prepare for 4.0.5
ricardozanini Oct 20, 2023
985790f
Keep id as mandatory for backward compatibility.
fjtirado Oct 25, 2023
d8cb9b7
Force id to be mandatory
fjtirado Oct 27, 2023
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
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "maven" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
assignees:
- ricardozanini
- tsurdilo
3 changes: 3 additions & 0 deletions .github/project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
release:
current-version: 4.0.5
next-version: 5.0.0-SNAPSHOT
26 changes: 0 additions & 26 deletions .github/workflows/maven-deploy.yml

This file was deleted.

32 changes: 15 additions & 17 deletions .github/workflows/maven-verify.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Verify JAVA SDK
name: sdk-java Verify

on:
push:
branches:
- main
- 4.0.*
pull_request:
branches:
- main
- 4.0.*
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Verify with Maven
run: |
mvn -B -f pom.xml clean install verify
- uses: actions/checkout@v2

- name: Set up JDK 1.8
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 8
cache: 'maven'

- name: Verify with Maven
run: |
mvn -B -f pom.xml clean install verify
25 changes: 25 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: sdk-java Pre Release

on:
pull_request:
paths:
- '.github/project.yml'

jobs:
release:
runs-on: ubuntu-latest
name: pre release

steps:
- uses: radcortez/project-metadata-action@master
name: retrieve project metadata
id: metadata
with:
github-token: ${{secrets.GITHUB_TOKEN}}
metadata-file-path: '.github/project.yml'

- name: Validate version
if: contains(steps.metadata.outputs.current-version, 'SNAPSHOT')
run: |
echo '::error::Cannot release a SNAPSHOT version.'
exit 1
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: sdk-java Release

on:
pull_request:
types: [closed]
paths:
- '.github/project.yml'

jobs:
release:
runs-on: ubuntu-latest
name: release
if: ${{github.event.pull_request.merged == true}}

steps:
- uses: radcortez/project-metadata-action@main
name: Retrieve project metadata
id: metadata
with:
github-token: ${{secrets.GITHUB_TOKEN}}
metadata-file-path: '.github/project.yml'

- uses: actions/checkout@v3

- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}

- name: Set up JDK 1.8
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 8
cache: 'maven'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

- name: Configure Git author
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"

- name: Maven release ${{steps.metadata.outputs.current-version}}
run: |
mvn -B release:prepare -Prelease -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}}
mvn -B release:perform -Darguments=-DperformRelease -DperformRelease -Prelease
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

- name: Push changes to ${{github.base_ref}} branch
run: |
git push
git push origin ${{steps.metadata.outputs.current-version}}
12 changes: 0 additions & 12 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,19 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>[2.13.0,)</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>[2.13.0,)</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<version>[2.13.0,)</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
</dependency>
<dependency>
<groupId>com.github.erosb</groupId>
<artifactId>everit-json-schema</artifactId>
</dependency>

<!-- test -->
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,13 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import io.serverlessworkflow.api.auth.AuthDefinition;
import io.serverlessworkflow.api.interfaces.WorkflowPropertySource;
import io.serverlessworkflow.api.utils.Utils;
import io.serverlessworkflow.api.workflow.Auth;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -69,21 +67,8 @@ public Auth deserialize(JsonParser jp, DeserializationContext ctxt) throws IOExc
} else {
String authFileDef = node.asText();
String authFileSrc = Utils.getResourceFileAsString(authFileDef);
JsonNode authRefNode;
ObjectMapper jsonWriter = new ObjectMapper();
if (authFileSrc != null && authFileSrc.trim().length() > 0) {
// if its a yaml def convert to json first
if (!authFileSrc.trim().startsWith("{")) {
// convert yaml to json to validate
ObjectMapper yamlReader = new ObjectMapper(new YAMLFactory());
Object obj = yamlReader.readValue(authFileSrc, Object.class);

authRefNode =
jsonWriter.readTree(new JSONObject(jsonWriter.writeValueAsString(obj)).toString());
} else {
authRefNode = jsonWriter.readTree(new JSONObject(authFileSrc).toString());
}

JsonNode authRefNode = Utils.getNode(authFileSrc);
JsonNode refAuth = authRefNode.get("auth");
if (refAuth != null) {
for (final JsonNode nodeEle : refAuth) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import io.serverlessworkflow.api.interfaces.WorkflowPropertySource;
import io.serverlessworkflow.api.utils.Utils;
import io.serverlessworkflow.api.workflow.Constants;
import java.io.IOException;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -63,21 +60,8 @@ public Constants deserialize(JsonParser jp, DeserializationContext ctxt) throws
} else {
String constantsFileDef = node.asText();
String constantsFileSrc = Utils.getResourceFileAsString(constantsFileDef);
JsonNode constantsRefNode;
ObjectMapper jsonWriter = new ObjectMapper();
if (constantsFileSrc != null && constantsFileSrc.trim().length() > 0) {
// if its a yaml def convert to json first
if (!constantsFileSrc.trim().startsWith("{")) {
// convert yaml to json to validate
ObjectMapper yamlReader = new ObjectMapper(new YAMLFactory());
Object obj = yamlReader.readValue(constantsFileSrc, Object.class);

constantsRefNode =
jsonWriter.readTree(new JSONObject(jsonWriter.writeValueAsString(obj)).toString());
} else {
constantsRefNode = jsonWriter.readTree(new JSONObject(constantsFileSrc).toString());
}

JsonNode constantsRefNode = Utils.getNode(constantsFileSrc);
JsonNode refConstants = constantsRefNode.get("constants");
if (refConstants != null) {
constantsDefinition = refConstants;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,13 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import io.serverlessworkflow.api.error.ErrorDefinition;
import io.serverlessworkflow.api.interfaces.WorkflowPropertySource;
import io.serverlessworkflow.api.utils.Utils;
import io.serverlessworkflow.api.workflow.Errors;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -69,21 +67,8 @@ public Errors deserialize(JsonParser jp, DeserializationContext ctxt) throws IOE
} else {
String errorsFileDef = node.asText();
String errorsFileSrc = Utils.getResourceFileAsString(errorsFileDef);
JsonNode errorsRefNode;
ObjectMapper jsonWriter = new ObjectMapper();
if (errorsFileSrc != null && errorsFileSrc.trim().length() > 0) {
// if its a yaml def convert to json first
if (!errorsFileSrc.trim().startsWith("{")) {
// convert yaml to json to validate
ObjectMapper yamlReader = new ObjectMapper(new YAMLFactory());
Object obj = yamlReader.readValue(errorsFileSrc, Object.class);

errorsRefNode =
jsonWriter.readTree(new JSONObject(jsonWriter.writeValueAsString(obj)).toString());
} else {
errorsRefNode = jsonWriter.readTree(new JSONObject(errorsFileSrc).toString());
}

JsonNode errorsRefNode = Utils.getNode(errorsFileSrc);
JsonNode refErrors = errorsRefNode.get("errors");
if (refErrors != null) {
for (final JsonNode nodeEle : refErrors) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,13 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import io.serverlessworkflow.api.events.EventDefinition;
import io.serverlessworkflow.api.interfaces.WorkflowPropertySource;
import io.serverlessworkflow.api.utils.Utils;
import io.serverlessworkflow.api.workflow.Events;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -69,21 +67,9 @@ public Events deserialize(JsonParser jp, DeserializationContext ctxt) throws IOE
} else {
String eventsFileDef = node.asText();
String eventsFileSrc = Utils.getResourceFileAsString(eventsFileDef);
JsonNode eventsRefNode;
ObjectMapper jsonWriter = new ObjectMapper();
if (eventsFileSrc != null && eventsFileSrc.trim().length() > 0) {
// if its a yaml def convert to json first
if (!eventsFileSrc.trim().startsWith("{")) {
// convert yaml to json to validate
ObjectMapper yamlReader = new ObjectMapper(new YAMLFactory());
Object obj = yamlReader.readValue(eventsFileSrc, Object.class);

eventsRefNode =
jsonWriter.readTree(new JSONObject(jsonWriter.writeValueAsString(obj)).toString());
} else {
eventsRefNode = jsonWriter.readTree(new JSONObject(eventsFileSrc).toString());
}

JsonNode eventsRefNode = Utils.getNode(eventsFileSrc);
JsonNode refEvents = eventsRefNode.get("events");
if (refEvents != null) {
for (final JsonNode nodeEle : refEvents) {
Expand Down
Loading