Skip to content

Commit

Permalink
Version bump (#631)
Browse files Browse the repository at this point in the history
* Version bump

* BUmp caniuse-browser-check-db

* Fix compiler warnings

* Bit of javadoc tuning. But clearly lot of warnings still to be fixed at later time

* tune nflow-tests pom

* Actually bump minium java version to 17 as claimed in previous release. Test against java 21

* Lower maven requirement to match github codebuild

* Plugin updates + spotbugs fixes/ignores

* update java versions in eclipse project files

* remove redundant type definitions

* Improve text reliablity on slow machines

* Run integration tests single-threaded to see if they are more stable

* Force CXF http client back to old non-buggy implementation

* Try with xe version again

* revert changes to oracle db setup

* Trying to stabilize integration tests

---------

Co-authored-by: Edvard Fonsell <[email protected]>
  • Loading branch information
gmokki and efonsell authored Apr 10, 2024
1 parent 8ba1747 commit f91dca7
Show file tree
Hide file tree
Showing 82 changed files with 421 additions and 220 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
if: always()
strategy:
matrix:
java: [ '17', '20' ]
java: [ '17', '21' ]
runs-on: ubuntu-latest
steps:
- name: Check out
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
if: always()
strategy:
matrix:
java: [ '17', '20' ]
java: [ '17', '21' ]
db: [ 'h2', 'mariadb', 'postgresql', 'mysql', 'sqlserver', 'db2', 'oracle' ]
runs-on: ubuntu-latest
env:
Expand All @@ -102,7 +102,7 @@ jobs:
- name: Build
run: mvn -T1C --color=always -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true --am -pl nflow-tests install
- name: Run the integration tests
run: mvn -T1C -Dsurefire.forkcount=2C --color=always -P ${{ matrix.db }} -rf :nflow-tests surefire:test
run: mvn -T1C -Dsurefire.forkcount=1 --color=always -rf :nflow-tests surefire:test
- name: Publish JUnit test report
uses: scacap/action-surefire-report@v1
if: always()
Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,27 @@

**Details**

- Dependency updates:
- Jetty 11.0.20
- Apache CFX 4.0.4
- Dropwizard metrics 4.2.19
- logback 1.5.3
- jackson 2.17.0
- h2 2.2.224
- protobuf 3.25.1
- db2 jcc 11.5.9.0
- mssql-jdbc 12.6.1
- mysql-connector 8.3.0
- ojdbc11 23.3.0.23.09
- postgresql 42.7.3
- mariadb-java-client 3.3.3
- HikariCP 5.1.0
- netty 4.1.107
- joda-time 2.12.5
- commons-lang3 3.14.0
- slf4j 2.0.12


## 9.0.0 (2023-08-30)

**Highlights**
Expand Down
3 changes: 3 additions & 0 deletions findbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
<Match>
<Bug pattern="THROWS_METHOD_THROWS_RUNTIMEEXCEPTION"/>
</Match>
<Match>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
</Match>
<Match>
<!--
https://github.com/spotbugs/spotbugs/issues/2040 - the new detector has too much false positives,
Expand Down
20 changes: 20 additions & 0 deletions maven-version-rules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,31 @@
<ignoreVersion type="regex">.*-b[0-9]+.*</ignoreVersion>
</ignoreVersions>
</rule>
<rule groupId="jakarta.annotation">
<ignoreVersions>
<ignoreVersion type="regex">.*M[0-9].*</ignoreVersion>
</ignoreVersions>
</rule>
<rule groupId="jakarta.inject" artifactId="jakarta.inject-api">
<ignoreVersions>
<ignoreVersion type="regex">.*\.(MR|RC[0-9]+).*</ignoreVersion>
</ignoreVersions>
</rule>
<rule groupId="jakarta.servlet">
<ignoreVersions>
<ignoreVersion type="regex">.*M[0-9].*</ignoreVersion>
</ignoreVersions>
</rule>
<rule groupId="jakarta.validation">
<ignoreVersions>
<ignoreVersion type="regex">.*M[0-9].*</ignoreVersion>
</ignoreVersions>
</rule>
<rule groupId="jakarta.ws.rs">
<ignoreVersions>
<ignoreVersion type="regex">.*M[0-9].*</ignoreVersion>
</ignoreVersions>
</rule>
<rule groupId="org.glassfish" artifactId="jakarta.el">
<ignoreVersions>
<ignoreVersion type="regex">.*-M[0-9]+.*</ignoreVersion>
Expand Down
7 changes: 4 additions & 3 deletions nflow-engine/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#Sun Apr 07 10:53:41 EEST 2024
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
Expand All @@ -10,9 +11,9 @@ org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
Expand Down Expand Up @@ -106,7 +107,7 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=11
org.eclipse.jdt.core.compiler.source=17
org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false
org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.io.InputStream;
import java.util.Properties;

import edu.umd.cs.findbugs.annotations.NonNull;
import org.springframework.core.env.Environment;
import org.springframework.core.env.MutablePropertySources;
import org.springframework.core.env.PropertiesPropertySource;
Expand Down Expand Up @@ -52,7 +53,7 @@ protected Properties getClassPathConfigurationProperties() {
protected void configure() {
bind(Environment.class).toInstance(new StandardEnvironment() {
@Override
protected void customizePropertySources(MutablePropertySources propertySources) {
protected void customizePropertySources(@NonNull MutablePropertySources propertySources) {
customizeEnvironment(propertySources);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Stream;

import jakarta.inject.Inject;
import jakarta.inject.Singleton;

import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.springframework.core.env.Environment;
Expand Down Expand Up @@ -90,6 +87,8 @@
import io.nflow.engine.workflow.instance.WorkflowInstanceAction;
import io.nflow.engine.workflow.instance.WorkflowInstanceAction.WorkflowActionType;
import io.nflow.engine.workflow.instance.WorkflowInstanceFactory;
import jakarta.inject.Inject;
import jakarta.inject.Singleton;

/**
* Use setter injection because constructor injection may not work when nFlow is used in some legacy systems.
Expand Down Expand Up @@ -910,7 +909,7 @@ public WorkflowInstance.Builder mapRow(ResultSet rs, int rowNum) throws SQLExcep
.setExternalId(rs.getString("external_id"))
.setState(rs.getString("state"))
.setStateText(rs.getString("state_text"))
.setActions(new ArrayList<WorkflowInstanceAction>())
.setActions(new ArrayList<>())
.setNextActivation(sqlVariants.getDateTime(rs, "next_activation"))
.setRetries(rs.getInt("retries"))
.setCreated(sqlVariants.getDateTime(rs, "created"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public void run() {
var graceful = shutdownPool();
executorDao.markShutdown(graceful);
running.set(false);
logger.info("Shutdown completed.");
logger.info("Shutdown completed (" + (graceful?"":"not ") +"graceful).");
shutdownDone.countDown();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

import io.nflow.engine.workflow.instance.WorkflowInstance.WorkflowInstanceStatus;

/**
* Abstracts the differences of different SQL backends.
*/
public interface SQLVariants {
String currentTimePlusSeconds(int seconds);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.nflow.engine.model.ModelObject;

@SuppressFBWarnings(value = {"URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD","UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"}, justification = "used by rest apis")
public class StoredWorkflowDefinition extends ModelObject {

public String type;
public String description;
public String onError;
public List<State> states;
public List<State> states = new ArrayList<>();
public List<Signal> supportedSignals = new ArrayList<>();

@SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD", justification = "serialized to database with object mapper")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import io.nflow.engine.workflow.definition.WorkflowStateType;

public class StoredWorkflowDefinitionWrapper extends WorkflowDefinition {
@SuppressWarnings("this-escape")
public StoredWorkflowDefinitionWrapper(StoredWorkflowDefinition stored) {
super(stored.type, getInitialState(stored), getErrorState(stored), new WorkflowSettings.Builder().build(), emptyMap(), allStates(stored), false);
setDescription(stored.description);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public class BulkWorkflow extends WorkflowDefinition {
* @param type
* The type of the workflow.
*/
@SuppressWarnings("this-escape")
protected BulkWorkflow(String type) {
super(type, SPLIT_WORK, ERROR, new Builder().setMaxRetries(Integer.MAX_VALUE).build());
setDescription("Executes child workflows in bulk but gracefully without effecting non-bulk tasks.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public abstract class CronWorkflow extends WorkflowDefinition {
* @param settings
* The workflow settings.
*/
@SuppressWarnings("this-escape")
protected CronWorkflow(String type, WorkflowSettings settings) {
super(type, SCHEDULE, HANDLE_FAILURE, settings);
permit(SCHEDULE, DO_WORK);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class MaintenanceWorkflow extends CronWorkflow {
/**
* Create maintenance workflow definition.
*/
@SuppressWarnings("this-escape")
public MaintenanceWorkflow() {
super(MAINTENANCE_WORKFLOW_TYPE);
setDescription("Clean up workflow instances periodically.");
Expand All @@ -41,6 +42,7 @@ public MaintenanceWorkflow() {
* @param settings
* The workflow settings.
*/
@SuppressWarnings("this-escape")
protected MaintenanceWorkflow(String type, WorkflowSettings settings) {
super(type, settings);
setDescription("Clean up workflow instances periodically.");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.nflow.engine.workflow.definition;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import java.util.Objects;

/**
Expand All @@ -12,6 +14,7 @@ public class Mutable<T> {
/**
* The wrapped value.
*/
@SuppressFBWarnings(value = "PA_PUBLIC_PRIMITIVE_ATTRIBUTE", justification = "this is just a wrapper class around the single field")
public T val;

/**
Expand Down
2 changes: 1 addition & 1 deletion nflow-engine/src/main/resources/nflow-engine.properties
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ nflow.db.db2.password=nflow
nflow.db.db2.timezone=UTC

nflow.db.oracle.driver=oracle.jdbc.OracleDriver
nflow.db.oracle.url=jdbc:oracle:thin:@//localhost:1521/XEPDB1
nflow.db.oracle.url=jdbc:oracle:thin:@//localhost:1521/nflow
nflow.db.oracle.user=nflow
nflow.db.oracle.password=nflow

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
import java.util.List;
import java.util.Map.Entry;

import jakarta.inject.Inject;

import org.junit.jupiter.api.Test;

import io.nflow.engine.internal.workflow.StoredWorkflowDefinition;
import io.nflow.engine.service.DummyTestWorkflow;
import io.nflow.engine.workflow.definition.WorkflowState;
import jakarta.inject.Inject;

public class WorkflowDefinitionDaoTest extends BaseDaoTest {

Expand All @@ -32,7 +31,7 @@ public void storeAndLoadRequestedDefinitionFromDatabaseWorks() {

@Test
public void storeAndLoadAllDefinitionsFromDatabaseWorks() {
roundTrip(new ArrayList<String>());
roundTrip(new ArrayList<>());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@
import java.util.Optional;
import java.util.concurrent.CountDownLatch;

import jakarta.inject.Inject;

import org.joda.time.DateTime;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor;
Expand All @@ -76,6 +74,7 @@
import io.nflow.engine.workflow.instance.WorkflowInstanceAction;
import io.nflow.engine.workflow.instance.WorkflowInstanceAction.WorkflowActionType;
import io.nflow.engine.workflow.instance.WorkflowInstanceFactory;
import jakarta.inject.Inject;

public class WorkflowInstanceDaoTest extends BaseDaoTest {

Expand Down Expand Up @@ -796,7 +795,7 @@ public void wakesUpSleepingWorkflow() {
WorkflowInstance i1 = constructWorkflowInstanceBuilder().setNextActivation(null).build();
long id = dao.insertWorkflowInstance(i1);
assertThat(dao.getWorkflowInstance(id, emptySet(), null, false).nextActivation, nullValue());
dao.wakeupWorkflowInstanceIfNotExecuting(id, new ArrayList<String>());
dao.wakeupWorkflowInstanceIfNotExecuting(id, new ArrayList<>());
assertThat(dao.getWorkflowInstance(id, emptySet(), null, false).nextActivation, notNullValue());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
import io.nflow.engine.workflow.instance.WorkflowInstanceAction;
import io.nflow.engine.workflow.instance.WorkflowInstanceAction.WorkflowActionType;

@SuppressWarnings("this-escape")
public class WorkflowStateProcessorTest extends BaseNflowTest {

@Mock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class StaticStateFieldsWorkflow extends WorkflowDefinition {
protected WorkflowState protectedState = new State("protected", WorkflowStateType.manual);
public WorkflowState publicState = new State("public", WorkflowStateType.manual);

@SuppressWarnings("this-escape")
public StaticStateFieldsWorkflow() {
super("staticStateFields", BEGIN, ERROR);
permit(new State("origin", WorkflowStateType.manual), new State("target", WorkflowStateType.manual),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import io.nflow.engine.workflow.definition.WorkflowDefinition;
import io.nflow.engine.workflow.definition.WorkflowSettings;

@SuppressWarnings("this-escape")
public class DummyTestWorkflow extends WorkflowDefinition {

public static final String DUMMY_TYPE = "dummy";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
@Profile("nflow-engine-test")
public class SpringDummyTestWorkflow extends WorkflowDefinition {

@SuppressWarnings("this-escape")
protected SpringDummyTestWorkflow() {
super("springdummy", BEGIN, DONE);
permit(BEGIN, DONE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import io.nflow.engine.workflow.curated.State;

@SuppressWarnings("this-escape")
public class TestDefinition extends WorkflowDefinition {

public static final WorkflowState START_1 = new State("start1", WorkflowStateType.start);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class TestDefinitionWithStateTypes extends WorkflowDefinition {
static final WorkflowState STATE_1 = new State("state1");
static final WorkflowState STATE_2 = new State("state2");

@SuppressWarnings("this-escape")
public TestDefinitionWithStateTypes(String type, WorkflowState initialState) {
super(type, initialState, ERROR);
permit(BEGIN, DONE, ERROR);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class TestWorkflow extends WorkflowDefinition {
public static final WorkflowState START_WITHOUT_FAILURE = new State("startWithoutFailure", WorkflowStateType.start);
public static final WorkflowState FAILED = new State("failed", WorkflowStateType.end);

@SuppressWarnings("this-escape")
public TestWorkflow() {
super("test", BEGIN, ERROR);
permit(BEGIN, DONE, FAILED);
Expand Down
Loading

0 comments on commit f91dca7

Please sign in to comment.