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

Feat/micronaut 4 #86

Merged
merged 3 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 17 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ plugins {
def isBuildSnapshot = version.toString().endsWith("-SNAPSHOT")

repositories {
mavenLocal()
mavenCentral()
if (isBuildSnapshot) {
maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots/" }
Expand All @@ -31,24 +32,21 @@ tasks.withType(JavaCompile) {
options.compilerArgs.add("-parameters")
}

configurations.all {
resolutionStrategy {
force("org.slf4j:slf4j-api:1.7.36")
}
}

dependencies {
// lombok
annotationProcessor "org.projectlombok:lombok:$lombokVersion"
compileOnly "org.projectlombok:lombok:$lombokVersion"

// micronaut
annotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion")
annotationProcessor platform("io.micronaut.platform:micronaut-platform:$micronautVersion")
annotationProcessor "io.micronaut:micronaut-inject-java"
annotationProcessor "io.micronaut:micronaut-validation"
compileOnly platform("io.micronaut:micronaut-bom:$micronautVersion")
annotationProcessor "io.micronaut.validation:micronaut-validation-processor"

compileOnly platform("io.micronaut.platform:micronaut-platform:$micronautVersion")
compileOnly "io.micronaut:micronaut-inject"
compileOnly "io.micronaut:micronaut-validation"
compileOnly "io.micronaut.validation:micronaut-validation"
compileOnly "io.micronaut:micronaut-http-client"
compileOnly "io.micronaut.reactor:micronaut-reactor"

// kestra
compileOnly group: "io.kestra", name: "core", version: kestraVersion
Expand All @@ -73,9 +71,16 @@ testlogger {
}

dependencies {
testAnnotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion")
// lombok
testAnnotationProcessor "org.projectlombok:lombok:" + lombokVersion
testCompileOnly 'org.projectlombok:lombok:' + lombokVersion

// micronaut
testAnnotationProcessor platform("io.micronaut.platform:micronaut-platform:$micronautVersion")
testAnnotationProcessor "io.micronaut:micronaut-inject-java"
testImplementation platform("io.micronaut:micronaut-bom:$micronautVersion")
testAnnotationProcessor "io.micronaut.validation:micronaut-validation-processor"

testImplementation platform("io.micronaut.platform:micronaut-platform:$micronautVersion")
testImplementation "io.micronaut.test:micronaut-test-junit5"

// test deps needed only for to have a runner
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=0.15.0-SNAPSHOT
kestraVersion=[0.15,)
micronautVersion=3.10.1
micronautVersion=4.2.2
lombokVersion=1.18.30
10 changes: 3 additions & 7 deletions src/main/java/io/kestra/plugin/dbt/cli/AbstractDbt.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import io.kestra.core.models.annotations.PluginProperty;
import io.kestra.core.models.tasks.*;
import io.kestra.core.runners.RunContext;
import io.kestra.core.tasks.PluginUtilsService;
import io.kestra.plugin.dbt.ResultParser;
import io.kestra.plugin.scripts.exec.scripts.models.DockerOptions;
import io.kestra.plugin.scripts.exec.scripts.models.RunnerType;
Expand All @@ -24,12 +23,10 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;

@SuperBuilder
@ToString
Expand Down Expand Up @@ -89,7 +86,6 @@ public abstract class AbstractDbt extends Task implements RunnableTask<ScriptOut
)
@PluginProperty
@NotNull
@NotEmpty
protected RunnerType runner = RunnerType.PROCESS;

@Schema(
Expand Down Expand Up @@ -150,7 +146,7 @@ public ScriptOutput run(RunContext runContext) throws Exception {
.withDockerOptions(this.getDocker())
.withLogConsumer(new AbstractLogConsumer() {
@Override
public void accept(String line, Boolean isStdErr) throws Exception {
public void accept(String line, Boolean isStdErr) {
LogService.parse(runContext, line);
}
});
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/io/kestra/plugin/dbt/cli/DbtCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
import java.util.Collections;
import java.util.List;
import java.util.Map;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;

@SuperBuilder
@ToString
Expand Down Expand Up @@ -128,7 +128,7 @@ public ScriptOutput run(RunContext runContext) throws Exception {
CommandsWrapper commands = this.commands(runContext)
.withLogConsumer(new AbstractLogConsumer() {
@Override
public void accept(String line, Boolean isStdErr) throws Exception {
public void accept(String line, Boolean isStdErr) {
LogService.parse(runContext, line);
}
});
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/io/kestra/plugin/dbt/cli/Setup.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;

@SuperBuilder
@ToString
Expand Down Expand Up @@ -93,7 +93,6 @@ public class Setup extends AbstractExecScript implements RunnableTask<ScriptOutp
)
@PluginProperty(dynamic = true)
@NotNull
@NotEmpty
Object profiles;

@Builder.Default
Expand Down Expand Up @@ -143,7 +142,6 @@ public class Setup extends AbstractExecScript implements RunnableTask<ScriptOutp
)
@PluginProperty
@NotNull
@NotEmpty
protected RunnerType runner = RunnerType.PROCESS;

@Schema(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.time.Duration;
import javax.validation.constraints.NotNull;
import jakarta.validation.constraints.NotNull;

@SuperBuilder
@ToString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import lombok.extern.jackson.Jacksonized;

import java.util.List;
import javax.validation.Valid;
import jakarta.validation.Valid;

@Value
@Jacksonized
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import lombok.extern.jackson.Jacksonized;

import java.util.List;
import javax.validation.Valid;
import jakarta.validation.Valid;

@Value
@Jacksonized
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/io/kestra/plugin/dbt/cloud/TriggerRun.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.kestra.plugin.dbt.cloud;

import io.kestra.core.exceptions.IllegalVariableEvaluationException;
import io.kestra.core.models.annotations.Example;
import io.kestra.core.models.annotations.Plugin;
import io.kestra.core.models.annotations.PluginProperty;
Expand All @@ -20,7 +19,7 @@
import java.net.URI;
import java.time.Duration;
import java.util.*;
import javax.validation.constraints.NotNull;
import jakarta.validation.constraints.NotNull;

@SuperBuilder
@ToString
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/kestra/plugin/dbt/cloud/models/Job.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import java.util.ArrayList;
import java.util.List;
import javax.validation.Valid;
import jakarta.validation.Valid;

@Value
@Jacksonized
Expand Down
7 changes: 0 additions & 7 deletions src/main/java/io/kestra/plugin/dbt/cloud/models/Status.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
package io.kestra.plugin.dbt.cloud.models;

import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.v3.oas.annotations.media.Schema;
import io.micronaut.validation.Validated;
import lombok.Value;
import lombok.experimental.SuperBuilder;
import lombok.extern.jackson.Jacksonized;

import javax.validation.Valid;
import javax.validation.constraints.*;

@Value
@Jacksonized
@SuperBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import java.time.ZonedDateTime;
import java.util.List;
import javax.validation.Valid;
import jakarta.validation.Valid;

@Value
@Jacksonized
Expand Down
Loading