Skip to content

Commit 0e6ec08

Browse files
feat: introduce cdc client library (#7)
* build: upgrade dependencies * build: add git hooks * feat: add pattern parser and initial cdc service api * style: update licenses and warnings * build: relax maven version to 3.6+ * style: fix formatting * First draft of a CDC message model and parse. * Implement client. * feat: some improvements * refactor: move stuff into java Signed-off-by: Ali Ince <ali.ince@neo4j.com> * refactor: make event classes immutable Make Jackson aware of the right properties to set in all-args constructors. * refactor: move ResultMapper to Java * refactor: move CDCClient to Java * refactor: implement patterns in java * style: spotless for java * refactor: manually map cypher result into domain objects * test: fix test * refactor: clean-up and better validation/conversion logic * style: apply spotless * test: add more tests * build: relax danger rules * build: update licenses * build: do not build dependent builds if dependencies fail * feat: implement stream and query on cdc client * build: update license texts * revert: revert configuration class * test: add integration test for selectors * build: detach cdc module from parent and upgrade dependencies * build: fix copy paste error * build: remove redundant conflict resolution * build: update module description * build: re-add redundant conflict resolution --------- Signed-off-by: Ali Ince <ali.ince@neo4j.com> Co-authored-by: Gerrit Meier <gerrit.meier@neo4j.com>
1 parent d5cc40e commit 0e6ec08

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+5479
-667
lines changed

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx --no -- commitlint --edit "$1"

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
./mvnw sortpom:sort spotless:apply

.mvn/wrapper/maven-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.1/apache-maven-3.9.1-bin.zip
17+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.3/apache-maven-3.9.3-bin.zip
1818
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar

.teamcity/builds/Build.kt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,22 @@ class Build(name: String, branchFilter: String, forPullRequests: Boolean) :
1010
this.id(name.toId())
1111
this.name = name
1212

13-
val packaging = Maven("${name}-package", "package", "package", "-pl :packaging -am -DskipTests")
13+
val packaging =
14+
Maven("${name}-package", "package", "package", "-pl :packaging -am -DskipTests")
1415

1516
val bts = sequential {
1617
if (forPullRequests)
1718
buildType(WhiteListCheck("${name}-whitelist-check", "white-list check"))
18-
if (forPullRequests) buildType(PRCheck("${name}-pr-check", "pr check"))
19-
buildType(Maven("${name}-build", "build", "test-compile"))
19+
if (forPullRequests) dependentBuildType(PRCheck("${name}-pr-check", "pr check"))
20+
dependentBuildType(Maven("${name}-build", "build", "test-compile"))
2021
parallel {
21-
buildType(Maven("${name}-unit-tests", "unit tests", "test"))
22-
buildType(
22+
dependentBuildType(Maven("${name}-unit-tests", "unit tests", "test"))
23+
dependentBuildType(
2324
Maven("${name}-integration-tests", "integration tests", "verify", "-DskipUnitTests"))
2425
}
25-
if (forPullRequests) buildType(packaging) else buildType(collectArtifacts(packaging))
26-
buildType(Empty("${name}-complete", "complete"))
26+
if (forPullRequests) dependentBuildType(packaging)
27+
else dependentBuildType(collectArtifacts(packaging))
28+
dependentBuildType(Empty("${name}-complete", "complete"))
2729
}
2830

2931
bts.buildTypes().forEach {

.teamcity/builds/Common.kt

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ package builds
22

33
import jetbrains.buildServer.configs.kotlin.BuildFeatures
44
import jetbrains.buildServer.configs.kotlin.BuildType
5+
import jetbrains.buildServer.configs.kotlin.CompoundStage
56
import jetbrains.buildServer.configs.kotlin.DslContext
7+
import jetbrains.buildServer.configs.kotlin.FailureAction
68
import jetbrains.buildServer.configs.kotlin.Requirements
79
import jetbrains.buildServer.configs.kotlin.buildFeatures.PullRequests
810
import jetbrains.buildServer.configs.kotlin.buildFeatures.commitStatusPublisher
@@ -13,49 +15,53 @@ const val GITHUB_OWNER = "neo4j"
1315
const val GITHUB_REPOSITORY = "neo4j-kafka-connector"
1416

1517
enum class LinuxSize(val value: String) {
16-
SMALL("small"),
17-
LARGE("large")
18+
SMALL("small"),
19+
LARGE("large")
1820
}
1921

2022
fun Requirements.runOnLinux(size: LinuxSize = LinuxSize.SMALL) {
21-
startsWith("cloud.amazon.agent-name-prefix", "linux-${size.value}")
23+
startsWith("cloud.amazon.agent-name-prefix", "linux-${size.value}")
2224
}
2325

2426
fun BuildType.thisVcs() = vcs {
25-
root(DslContext.settingsRoot)
26-
cleanCheckout = true
27+
root(DslContext.settingsRoot)
28+
cleanCheckout = true
2729
}
2830

2931
fun BuildFeatures.enableCommitStatusPublisher() = commitStatusPublisher {
30-
vcsRootExtId = DslContext.settingsRootId.toString()
31-
publisher = github {
32-
githubUrl = "https://api.github.com"
33-
authType = personalToken {
34-
token = "%github-commit-status-token%"
35-
}
36-
}
32+
vcsRootExtId = DslContext.settingsRootId.toString()
33+
publisher = github {
34+
githubUrl = "https://api.github.com"
35+
authType = personalToken { token = "%github-commit-status-token%" }
36+
}
3737
}
3838

3939
fun BuildFeatures.enablePullRequests() = pullRequests {
40-
vcsRootExtId = DslContext.settingsRootId.toString()
41-
provider = github {
42-
authType = token {
43-
token = "%github-pull-request-token%"
44-
}
45-
filterAuthorRole = PullRequests.GitHubRoleFilter.MEMBER
46-
}
40+
vcsRootExtId = DslContext.settingsRootId.toString()
41+
provider = github {
42+
authType = token { token = "%github-pull-request-token%" }
43+
filterAuthorRole = PullRequests.GitHubRoleFilter.MEMBER
44+
}
4745
}
4846

4947
fun BuildFeatures.requireDiskSpace(size: String = "3gb") = freeDiskSpace {
50-
requiredSpace = size
51-
failBuild = true
48+
requiredSpace = size
49+
failBuild = true
5250
}
5351

52+
fun CompoundStage.dependentBuildType(bt: BuildType) =
53+
buildType(bt) {
54+
onDependencyCancel = FailureAction.CANCEL
55+
onDependencyFailure = FailureAction.FAIL_TO_START
56+
}
57+
5458
fun collectArtifacts(buildType: BuildType): BuildType {
55-
buildType.artifactRules = """
59+
buildType.artifactRules =
60+
"""
5661
+:packaging/target/*.jar => packages
5762
+:packaging/target/*.zip => packages
58-
""".trimIndent()
63+
"""
64+
.trimIndent()
5965

60-
return buildType
66+
return buildType
6167
}

build-resources/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
44
<modelVersion>4.0.0</modelVersion>
55

6-
<groupId>org.neo4j.connectors.kafka</groupId>
6+
<groupId>org.neo4j.connectors</groupId>
77
<artifactId>build-resources</artifactId>
88
<version>1.0.0-SNAPSHOT</version>
99

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
The MIT No Attribution License
2+
3+
Copyright <YEAR> <COPYRIGHT HOLDER>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this
6+
software and associated documentation files (the "Software"), to deal in the Software
7+
without restriction, including without limitation the rights to use, copy, modify,
8+
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9+
permit persons to whom the Software is furnished to do so.
10+
11+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
12+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
13+
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
14+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
15+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
16+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

build-resources/src/main/resources/licensing/licensing-requirements-base.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<liked-license>Eclipse Public License v2.0</liked-license>
1717
<liked-license>GNU Lesser General Public License, Version 2.1</liked-license>
1818
<liked-license>MIT License</liked-license>
19+
<liked-license>MIT No Attribution License</liked-license>
1920
<liked-license>Mozilla Public License, Version 2.0</liked-license>
2021
<liked-license>SIL OFL 1.1</liked-license>
2122
<liked-license>ISC</liked-license>
@@ -111,6 +112,9 @@
111112
<aka>(MIT or Apache-2.0)</aka>
112113
<aka>(BSD-2-Clause OR MIT OR Apache-2.0)</aka>
113114
</license>
115+
<license name="MIT No Attribution License">
116+
<aka>MIT-0</aka>
117+
</license>
114118
<license name="Mozilla Public License, Version 2.0">
115119
<aka>Mozilla Public License, v. 2.0</aka>
116120
</license>

0 commit comments

Comments
 (0)