Skip to content

Commit

Permalink
DBZ-2985 Add license headers and add CI checks
Browse files Browse the repository at this point in the history
  • Loading branch information
rk3rn3r committed Feb 9, 2021
1 parent ee71d18 commit 16a7b59
Show file tree
Hide file tree
Showing 68 changed files with 467 additions and 42 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/backend-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Test Debezium UI Backend

on:
push:
branches:
- master
paths:
- 'backend/**'
- 'pom.xml'
pull_request:
branches:
- master
paths:
- 'backend/**'
- 'pom.xml'

jobs:
build:
runs-on: ubuntu-latest
env:
DEBEZIUM_VERSION: "v1.5.0.Alpha1"
steps:
- name: Checkout Debezium main repository
uses: actions/checkout@v2
with:
repository: debezium/debezium
ref: ${{ env.DEBEZIUM_VERSION }}
path: debezium
- name: Checkout Debezium UI
uses: actions/checkout@v2
with:
path: ui
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml', '**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build debezium-checkstyle
run: mvn clean install -f debezium/pom.xml -pl support/checkstyle -DskipTests -DskipITs
- name: Test Debezium UI
run: mvn clean install -f ui -B -Dformat.formatter.goal=validate -Dformat.imports.goal=check -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
34 changes: 34 additions & 0 deletions backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,40 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<dependencies>
<dependency>
<groupId>io.debezium</groupId>
<artifactId>debezium-checkstyle</artifactId>
<version>[${debezium.base.version}],[1.5.0-SNAPSHOT]</version>
</dependency>
</dependencies>
<configuration>
<configLocation>checkstyle.xml</configLocation>
<suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
<suppressionsFileExpression>checkstyle.suppressions.file</suppressionsFileExpression>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
<linkXRef>false</linkXRef>
<violationSeverity>error</violationSeverity>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<sourceDirectories>
<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
<sourceDirectory>${project.build.testSourceDirectory}</sourceDirectory>
</sourceDirectories>
</configuration>
<executions>
<execution>
<id>check-style</id>
<phase>verify</phase>
<goals>
<goal>checkstyle</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin.version}</version>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.debezium.configserver.model;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.debezium.configserver.model;

import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.debezium.configserver.model;

import javax.json.bind.annotation.JsonbProperty;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.debezium.configserver.model;

import javax.json.bind.annotation.JsonbProperty;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.debezium.configserver.model;

import javax.json.bind.annotation.JsonbProperty;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.debezium.configserver.model;

import java.util.Collections;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.debezium.configserver.model;

import java.util.List;
Expand Down Expand Up @@ -26,7 +31,7 @@ public ConnectorProperty(String name, String displayName, String description, Ty
this.displayName = displayName;
this.description = description;
this.type = type;
this.defaultValue = defaultValue instanceof Class ? ((Class<?>)defaultValue).getName() : defaultValue;
this.defaultValue = defaultValue instanceof Class ? ((Class<?>) defaultValue).getName() : defaultValue;
this.isMandatory = isMandatory;
this.category = category;
this.allowedValues = allowedValues;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.debezium.configserver.model;

import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.debezium.configserver.model;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.debezium.configserver.model;

public class DataCollection {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.debezium.configserver.model;

import java.util.Collections;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.debezium.configserver.model;

public class FrontendConfig {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.debezium.configserver.model;

public class FrontendConfigArtifacts {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.debezium.configserver.model;

public class GenericValidationResult {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.debezium.configserver.model;

import org.eclipse.microprofile.openapi.annotations.enums.SchemaType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.debezium.configserver.model;

import java.util.Collections;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.debezium.configserver.model;

public class PropertyValidationResult {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.debezium.configserver.model;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.debezium.configserver.rest;

import java.io.IOException;
Expand Down Expand Up @@ -310,7 +315,8 @@ public Response createConnector(
LOGGER.debug("Sending valid connector config: " + kafkaConnectConfig.getConfig());
try {
result = kafkaConnectClient.createConnector(kafkaConnectConfig);
} catch (ProcessingException | IOException e) {
}
catch (ProcessingException | IOException e) {
throw new KafkaConnectClientException(kafkaConnectURI, e);
}
LOGGER.debug("Kafka Connect response: " + result);
Expand Down Expand Up @@ -350,7 +356,8 @@ public Response listConnectors(@PathParam("cluster") int cluster)
List<String> activeConnectors;
try {
activeConnectors = kafkaConnectClient.listConnectors();
} catch (ProcessingException | IOException e) {
}
catch (ProcessingException | IOException e) {
throw new KafkaConnectClientException(kafkaConnectURI, e);
}

Expand Down Expand Up @@ -381,7 +388,8 @@ public Response listConnectors(@PathParam("cluster") int cluster)
)
));
return connectorState;
} catch (ProcessingException | IOException e) {
}
catch (ProcessingException | IOException e) {
LOGGER.error(e.getMessage(), e);
}
return null;
Expand Down Expand Up @@ -427,7 +435,8 @@ public Response deleteConnector(
Response kafkaConnectDeleteConnectorResponse;
try {
kafkaConnectDeleteConnectorResponse = kafkaConnectClient.deleteConnector(connectorName);
} catch (ProcessingException | IOException e) {
}
catch (ProcessingException | IOException e) {
throw new KafkaConnectClientException(kafkaConnectURI, e);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.debezium.configserver.rest;

public final class ConnectorURIs {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.debezium.configserver.rest;

import io.debezium.configserver.model.FrontendConfig;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.debezium.configserver.rest;

import java.net.URI;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.debezium.configserver.rest;

import io.debezium.configserver.rest.model.ServerError;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.debezium.configserver.rest;

import io.debezium.configserver.rest.client.KafkaConnectException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.debezium.configserver.rest;

import io.debezium.configserver.model.ConnectionValidationResult;
Expand Down Expand Up @@ -69,7 +74,8 @@ public Response pauseConnector(
Response result;
try {
result = kafkaConnectClient.pauseConnector(connectorName);
} catch (ProcessingException | IOException e) {
}
catch (ProcessingException | IOException e) {
throw new KafkaConnectClientException(kafkaConnectURI, e);
}
LOGGER.debug("Kafka Connect response: " + result.readEntity(String.class));
Expand Down Expand Up @@ -118,7 +124,8 @@ public Response resumeConnector(
Response result;
try {
result = kafkaConnectClient.resumeConnector(connectorName);
} catch (ProcessingException | IOException e) {
}
catch (ProcessingException | IOException e) {
throw new KafkaConnectClientException(kafkaConnectURI, e);
}
LOGGER.debug("Kafka Connect response: " + result.readEntity(String.class));
Expand Down Expand Up @@ -171,7 +178,8 @@ public Response restartConnector(
Response result;
try {
result = kafkaConnectClient.restartConnector(connectorName);
} catch (ProcessingException | IOException e) {
}
catch (ProcessingException | IOException e) {
throw new KafkaConnectClientException(kafkaConnectURI, e);
}
LOGGER.debug("Kafka Connect response: " + result.readEntity(String.class));
Expand Down Expand Up @@ -225,7 +233,8 @@ public Response restartTask(
Response result;
try {
result = kafkaConnectClient.restartConnectorTask(connectorName, taskNumber);
} catch (ProcessingException | IOException e) {
}
catch (ProcessingException | IOException e) {
throw new KafkaConnectClientException(kafkaConnectURI, e);
}
LOGGER.debug("Kafka Connect response: " + result.readEntity(String.class));
Expand Down

0 comments on commit 16a7b59

Please sign in to comment.