Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
loicmathieu authored Jun 26, 2024
1 parent 9daf2f9 commit 0d7fd70
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 29 deletions.
3 changes: 0 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ dependencies {
// test deps needed only for to have a runner
testAnnotationProcessor group: "io.kestra", name: "processor", version: kestraVersion
testImplementation group: "io.kestra", name: "core", version: kestraVersion
testImplementation group: "io.kestra", name: "core", version: kestraVersion, classifier: "tests"
testImplementation group: "io.kestra", name: "repository-memory", version: kestraVersion
testImplementation group: "io.kestra", name: "runner-memory", version: kestraVersion
testImplementation group: "io.kestra", name: "storage-local", version: kestraVersion
Expand All @@ -120,8 +119,6 @@ dependencies {
testImplementation "org.testcontainers:minio:1.19.8"
testImplementation "org.testcontainers:localstack:1.19.8"

testImplementation 'io.minio:minio:8.5.10'

testImplementation 'com.fasterxml.jackson.core:jackson-databind:2.17.1'
testImplementation 'com.fasterxml.jackson.core:jackson-annotations:2.17.1'
testImplementation 'com.fasterxml.jackson.core:jackson-core:2.17.1'
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/kestra/plugin/minio/Copy.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
}
)
@Schema(
title = "Copy a file between S3 service."
title = "Copy a file between buckets."
)
public class Copy extends AbstractMinioObject implements RunnableTask<Copy.Output> {

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/kestra/plugin/minio/CreateBucket.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
public class CreateBucket extends AbstractMinioObject implements RunnableTask<CreateBucket.Output> {

@Schema(
title = "Specifies whether you want S3 Object Lock to be enabled for the new bucket."
title = "Specifies whether you want Object Lock to be enabled for the new bucket."
)
@PluginProperty
private Boolean objectLockEnabledForBucket;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/kestra/plugin/minio/Delete.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
}
)
@Schema(
title = "Delete a file from S3 service."
title = "Delete a file from a bucket."
)
public class Delete extends AbstractMinioObject implements RunnableTask<Delete.Output> {

Expand All @@ -41,7 +41,7 @@ public class Delete extends AbstractMinioObject implements RunnableTask<Delete.O
private String key;

@Schema(
title = "Indicates whether S3 Object Lock should bypass Governance-mode restrictions to process this operation."
title = "Indicates whether Object Lock should bypass Governance-mode restrictions to process this operation."
)
@PluginProperty
private Boolean bypassGovernanceRetention;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/kestra/plugin/minio/DeleteList.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
}
)
@Schema(
title = "Delete a list of keys on a S3 service."
title = "Delete a list of keys on a bucket."
)
public class DeleteList extends AbstractMinioObject implements RunnableTask<DeleteList.Output> {

Expand Down Expand Up @@ -100,7 +100,7 @@ public class DeleteList extends AbstractMinioObject implements RunnableTask<Dele
@Schema(
title = "raise an error if the file is not found"
)
@PluginProperty(dynamic = true)
@PluginProperty
@Builder.Default
private final Boolean errorOnEmpty = false;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/kestra/plugin/minio/Download.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
}
)
@Schema(
title = "Download a file from S3 service."
title = "Download a file from a bucket."
)
public class Download extends AbstractMinioObject implements RunnableTask<Download.Output> {

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/io/kestra/plugin/minio/Downloads.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
}
)
@Schema(
title = "Downloads multiple files from a S3 service."
title = "Downloads multiple files from a bucket."
)
public class Downloads extends AbstractMinioObject implements RunnableTask<Downloads.Output> {

Expand All @@ -63,8 +63,8 @@ public enum Action {
private String delimiter;

@Schema(
title = "Marker is where you want Amazon S3 to start listing from.",
description = "Amazon S3 starts listing after this specified key. Marker can be any key in the bucket."
title = "Marker is where you want to start listing from.",
description = "Start listing after this specified key. Marker can be any key in the bucket."
)
@PluginProperty(dynamic = true)
private String marker;
Expand Down Expand Up @@ -170,7 +170,7 @@ public Output run(RunContext runContext) throws Exception {
public static class Output implements io.kestra.core.models.tasks.Output {
@JsonInclude
@Schema(
title = "The list of S3 objects."
title = "The list of objects."
)
private final java.util.List<MinioObject> objects;

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/io/kestra/plugin/minio/List.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
}
)
@Schema(
title = "List keys on a S3 service."
title = "List keys on a bucket."
)
public class List extends AbstractMinioObject implements RunnableTask<List.Output> {

Expand Down Expand Up @@ -69,8 +69,8 @@ public enum Filter {
private String delimiter;

@Schema(
title = "Marker is where you want Amazon S3 to start listing from.",
description = "Amazon S3 starts listing after this specified key. Marker can be any key in the bucket."
title = "Marker is where you want to start listing from.",
description = "Start listing after this specified key. Marker can be any key in the bucket."
)
@PluginProperty(dynamic = true)
private String marker;
Expand Down Expand Up @@ -203,7 +203,7 @@ private boolean filter(Item object, String regExp) {
public static class Output implements io.kestra.core.models.tasks.Output {
@JsonInclude
@Schema(
title = "The list of S3 objects."
title = "The list of objects."
)
private final java.util.List<MinioObject> objects;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
public interface MinioConnectionInterface {

@Schema(
title = "URL to S3 service."
title = "URL to the MinIO endpoint."
)
@PluginProperty(dynamic = true)
String getEndpoint();

@Schema(
title = "Access Key Id in order to connect to S3 service."
title = "Access Key Id for authentication."
)
@PluginProperty(dynamic = true)
String getAccessKeyId();

@Schema(
title = "Secret Key Id in order to connect to S3 service."
title = "Secret Key Id for authentication."
)
@PluginProperty(dynamic = true)
String getSecretKeyId();
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/io/kestra/plugin/minio/Trigger.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
@Getter
@NoArgsConstructor
@Schema(
title = "Wait for files on S3 service.",
description = "This trigger will poll every `interval` s3 service. " +
title = "Wait for files on a bucket.",
description = "This trigger will list every `interval` a bucket. " +
"You can search for all files in a bucket or directory in `from` or you can filter the files with a `regExp`. " +
"The detection is atomic, internally we do a list and interact only with files listed.\n" +
"Once a file is detected, we download the file on internal storage and processed with declared `action` " +
Expand All @@ -34,10 +34,10 @@
@Plugin(
examples = {
@Example(
title = "Wait for a list of files on a s3 service and iterate through the files.",
title = "Wait for a list of files on a bucket and iterate through the files.",
full = true,
code = {
"id: s3-listen",
"id: minio-listen",
"namespace: company.team",
"",
"tasks:",
Expand All @@ -64,10 +64,10 @@
}
),
@Example(
title = "Wait for a list of files on a s3 service and iterate through the files. Delete files manually after processing to prevent infinite triggering.",
title = "Wait for a list of files on a bucket and iterate through the files. Delete files manually after processing to prevent infinite triggering.",
full = true,
code = {
"id: s3-listen",
"id: minio-listen",
"namespace: company.team",
"",
"tasks:",
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/kestra/plugin/minio/Upload.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
}
)
@Schema(
title = "Upload a file to S3."
title = "Upload a file to a bucket."
)
public class Upload extends AbstractMinioObject implements RunnableTask<Upload.Output> {

Expand All @@ -76,7 +76,7 @@ public class Upload extends AbstractMinioObject implements RunnableTask<Upload.O
private String contentType;

@Schema(
title = "A map of metadata to store with the object in S3."
title = "A map of metadata to store with the object."
)
@PluginProperty(dynamic = true)
private Map<String, String> metadata;
Expand Down

0 comments on commit 0d7fd70

Please sign in to comment.