Skip to content
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

Infra: Add gradle p.1 #783

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
25dea60
Misc
Haarolean Oct 25, 2024
1e668f8
Impl authentication page backend
Haarolean Oct 25, 2024
7b6cf2e
Merge remote-tracking branch 'origin/main' into auth_page_be
Haarolean Oct 25, 2024
d91e8b9
Add POST auth endpoint
Haarolean Nov 17, 2024
5ec0abe
Merge branch 'main' into auth_page_be
Haarolean Dec 17, 2024
3e61608
resolves #72
Nilumilak May 20, 2024
09f2070
feat: auth page
Nilumilak Nov 17, 2024
09062ef
feat: auth page
Nilumilak Dec 17, 2024
92b7db6
Fix missing controller tag
Haarolean Dec 17, 2024
8e78c51
feat: auth page
Nilumilak Dec 17, 2024
b8161eb
feat: auth page
Nilumilak Dec 18, 2024
f65874a
Lint
Haarolean Dec 18, 2024
eae23e2
Fixed login page renderer
germanosin Dec 23, 2024
6cf3881
Initial gradle support
germanosin Jan 15, 2025
cbc96ff
Merge main
germanosin Jan 15, 2025
4a6ee2b
Plugins varion catalog
germanosin Jan 15, 2025
7c5fbd1
Plugins varion catalog
germanosin Jan 15, 2025
112ede0
Added jib and nexus publish
germanosin Jan 15, 2025
8085237
Update node version
germanosin Jan 16, 2025
4f568c5
Update default version
germanosin Jan 16, 2025
17e0624
Fixing comments
germanosin Jan 17, 2025
f828fd3
Fixing comments
germanosin Jan 17, 2025
336eb76
Version cleanup, minor refactoring
Haarolean Jan 17, 2025
ac99710
Simplify dep mngmnt, update libs
Haarolean Jan 17, 2025
f7183fa
Dedupe boot version
Haarolean Jan 23, 2025
808807e
Added e2e flags
germanosin Jan 29, 2025
436904b
Switched release flag instead of prod
germanosin Jan 29, 2025
21d2155
rm todo
Haarolean Jan 29, 2025
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,7 @@ build/
*.tgz

/docker/*.override.yaml
out/
node_modules/
.gradle
/e2e-tests/allure-results/
115 changes: 115 additions & 0 deletions api/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@

plugins {
id 'antlr'
id 'checkstyle'
id 'org.springframework.boot' version '3.4.1'
Haarolean marked this conversation as resolved.
Show resolved Hide resolved
id 'com.gorylenko.gradle-git-properties' version "2.4.2"
}

dependencies {
implementation project(":contract")
implementation project(":frontend")
Haarolean marked this conversation as resolved.
Show resolved Hide resolved
implementation project(":serde-api")

implementation libs.spring.starter.webflux
implementation libs.spring.starter.security
implementation libs.spring.starter.actuator
implementation libs.spring.starter.logging
implementation libs.spring.starter.oauth2.client
implementation libs.spring.boot.actuator
compileOnly libs.spring.boot.devtools

implementation libs.spring.security.ldap

implementation libs.kafka.clients

implementation libs.apache.avro
implementation libs.apache.commons
implementation libs.apache.commons.pool2
implementation libs.apache.datasketches

implementation libs.confluent.schema.registry.client
implementation libs.confluent.avro.serializer
implementation libs.confluent.protobuf.serializer
implementation libs.confluent.json.schema.serializer

implementation libs.aws.msk.auth
implementation (libs.azure.identity) {
exclude group: 'io.netty', module: 'netty-tcnative-boringssl-static'
germanosin marked this conversation as resolved.
Show resolved Hide resolved
}

implementation libs.jackson.databind.nullable
implementation libs.cel
antlr libs.antlr
implementation libs.antlr.runtime

implementation libs.opendatadiscovery.oddrn
implementation (libs.opendatadiscovery.client) {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-webflux'
exclude group: 'io.projectreactor', module: 'reactor-core'
exclude group: 'io.projectreactor.ipc', module: 'reactor-netty'
}

runtimeOnly libs.micrometer.registry.prometheus

// CVE Fixes
implementation libs.apache.commons.compress
implementation libs.okhttp3.logging.intercepter

// Annotation processors
implementation libs.lombok
implementation libs.mapstruct
annotationProcessor libs.lombok
annotationProcessor libs.mapstruct.processor
annotationProcessor libs.spring.boot.configuration.processor
testAnnotationProcessor libs.lombok
testAnnotationProcessor libs.mapstruct.processor

// Tests
testImplementation libs.spring.starter.test
testImplementation libs.reactor.test
testImplementation libs.testcontainers
testImplementation libs.testcontainers.kafka
testImplementation libs.testcontainers.jupiter
testImplementation libs.junit.jupiter.engine
testImplementation libs.mockito.core
testImplementation libs.mockito.jupiter
testImplementation libs.bytebuddy
testImplementation libs.assertj
testImplementation libs.jsonschemavalidator

testImplementation libs.okhttp3
testImplementation libs.okhttp3.mockwebserver
}

generateGrammarSource {
maxHeapSize = "64m"
arguments += ["-package", "ksql"]
}

sourceSets {
main {
antlr {
srcDirs = ["src/main/antlr4"]
}
java {
srcDirs += generateGrammarSource.outputDirectory
}
}
}

tasks.withType(Checkstyle) {
exclude '**/ksql/**'
}

checkstyle {
toolVersion '10.3.1'
germanosin marked this conversation as resolved.
Show resolved Hide resolved
configFile = rootProject.file('etc/checkstyle/checkstyle-e2e.xml')
germanosin marked this conversation as resolved.
Show resolved Hide resolved
ignoreFailures = false
maxWarnings = 0
maxErrors = 0
}

test {
useJUnitPlatform()
}
4 changes: 2 additions & 2 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,10 @@
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/classes/static</outputDirectory>
<outputDirectory>${basedir}/target/classes/</outputDirectory>
<resources>
<resource>
<directory>../frontend/build</directory>
<directory>../frontend/build/vite/static</directory>
</resource>
</resources>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.kafbat.ui.config;

import io.kafbat.ui.exception.ValidationException;
import javax.annotation.PostConstruct;
import jakarta.annotation.PostConstruct;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package io.kafbat.ui.config.auth;

import io.kafbat.ui.model.rbac.Role;
import jakarta.annotation.PostConstruct;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties("rbac")
Expand Down
31 changes: 31 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
subprojects {
apply plugin: "java"

repositories {
mavenCentral()
maven {
name = 'confluent'
url = 'https://packages.confluent.io/maven/'
}
}

group = 'io.kafbat'
version = version

java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
}

boolean resolveBooleanProperty(String propertyName, boolean defaultValue = false) {
def propertyValueStr = findProperty(propertyName)
return propertyValueStr == null ? defaultValue : propertyValueStr.toBoolean();
}

ext {
prod = resolveBooleanProperty("prod")
}



116 changes: 116 additions & 0 deletions contract/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
import org.openapitools.generator.gradle.plugin.tasks.GenerateTask

plugins {
id "java-library"
id 'org.openapi.generator' version '7.9.0'
germanosin marked this conversation as resolved.
Show resolved Hide resolved
}


def specDir = project.layout.projectDirectory.dir("src/main/resources/swagger/")
def targetDir = project.layout.buildDirectory.dir("generated").get()

dependencies {
implementation libs.spring.starter.webflux
implementation libs.spring.starter.validation
api libs.swagger.integration.jakarta
api libs.jackson.databind.nullable
api libs.annotation.api
compileOnly libs.lombok
annotationProcessor libs.lombok
}

tasks.register('generateUiClient', GenerateTask) {
generatorName = "java"
inputSpec = specDir.file("kafbat-ui-api.yaml").asFile.absolutePath
outputDir = targetDir.dir("kafbat-ui-client").asFile.absolutePath
apiPackage = "io.kafbat.ui.api.api"
invokerPackage = "io.kafbat.ui.api"
modelPackage = "io.kafbat.ui.api.model"

configOptions = [library : 'webclient',
asyncNative : 'true',
useBeanValidation: 'true',
dateLibrary : 'java8',
useJakartaEe : 'true',]
}

tasks.register('generateBackendApi', GenerateTask) {
generatorName = "spring"
inputSpec = specDir.file("kafbat-ui-api.yaml").asFile.absolutePath
outputDir = targetDir.dir("api").asFile.absolutePath
apiPackage = "io.kafbat.ui.api"
invokerPackage = "io.kafbat.ui.api"
modelPackage = "io.kafbat.ui.model"
modelNameSuffix = "DTO"

additionalProperties = [removeEnumValuePrefix: "false"]

configOptions = [reactive : "true",
interfaceOnly : "true",
skipDefaultInterface : "true",
useTags : "true",
useSpringBoot3 : "true",
dateLibrary : "java8",
generateConstructorWithAllArgs : "false",
generatedConstructorWithRequiredArgs: "false",
additionalModelTypeAnnotations : """
@lombok.experimental.SuperBuilder
@lombok.AllArgsConstructor
@lombok.NoArgsConstructor
"""]
}

tasks.register('generateConnectClient', GenerateTask) {
generatorName = "java"
inputSpec = specDir.file("kafka-connect-api.yaml").asFile.absolutePath
outputDir = targetDir.dir("kafka-connect-client").asFile.absolutePath
generateApiTests = false
generateModelTests = false
apiPackage = "io.kafbat.ui.connect.api"
modelPackage = "io.kafbat.ui.connect.model"
invokerPackage = "io.kafbat.ui.connect"


configOptions = [asyncNative : "true",
library : "webclient",
useJakartaEe : "true",
useBeanValidation: "true",
dateLibrary : "java8",]
}

tasks.register('generateSchemaRegistryClient', GenerateTask) {
generatorName = "java"
inputSpec = specDir.file("kafka-sr-api.yaml").asFile.absolutePath
outputDir = targetDir.dir("kafka-sr-client").asFile.absolutePath
generateApiTests = false
generateModelTests = false
apiPackage = "io.kafbat.ui.sr.api"
invokerPackage = "io.kafbat.ui.sr"
modelPackage = "io.kafbat.ui.sr.model"

configOptions = [asyncNative : "true",
library : "webclient",
useJakartaEe : "true",
useBeanValidation: "true",
dateLibrary : "java8",]
}

sourceSets {
main {
java {
srcDir targetDir.dir("api/src/main/java")
srcDir targetDir.dir("kafka-connect-client/src/main/java")
srcDir targetDir.dir("kafbat-ui-client/src/main/java")
srcDir targetDir.dir("kafka-sr-client/src/main/java")
}

resources {
srcDir specDir
}
}
}

compileJava.dependsOn generateUiClient, generateBackendApi, generateConnectClient, generateSchemaRegistryClient
processResources.dependsOn generateUiClient, generateBackendApi, generateConnectClient, generateSchemaRegistryClient


48 changes: 48 additions & 0 deletions e2e-tests/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
plugins {
id 'java'
id 'checkstyle'
id 'io.qameta.allure' version '2.10.0'
}

ext {
kafkaVersion = "3.8.0"
aspectjVersion = "1.9.21"
allureVersion = "2.27.0"
germanosin marked this conversation as resolved.
Show resolved Hide resolved
}

dependencies {
implementation project(":contract")
implementation "org.apache.kafka:kafka_2.13:${kafkaVersion}"
implementation "org.aspectj:aspectjweaver:${aspectjVersion}"
implementation "commons-io:commons-io:2.16.1"
implementation "org.testng:testng:7.10.0"
implementation "com.codeborne:selenide:7.2.3"
germanosin marked this conversation as resolved.
Show resolved Hide resolved
implementation "io.qameta.allure:allure-testng:${allureVersion}"
implementation "io.qameta.allure:allure-selenide:${allureVersion}"
implementation "io.github.bonigarcia:webdrivermanager:5.8.0"
implementation libs.spring.starter.webflux
implementation "io.netty:netty-resolver-dns-native-macos:4.1.116.Final"

implementation libs.lombok

annotationProcessor libs.lombok
testAnnotationProcessor libs.lombok
}

checkstyle {
toolVersion '10.3.1'
germanosin marked this conversation as resolved.
Show resolved Hide resolved
configFile = rootProject.file('etc/checkstyle/checkstyle.xml')
germanosin marked this conversation as resolved.
Show resolved Hide resolved
ignoreFailures = false
maxWarnings = 10
maxErrors = 0
}


test {
useTestNG()
}

tasks.named('test') {
enabled = prod
}

Loading
Loading