Skip to content
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
4 changes: 2 additions & 2 deletions src/main/java/io/kestra/plugin/github/code/Search.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public enum Fork {
"""
)
@Builder.Default
private Property<Order> order = Property.of(Order.ASC);
private Property<Order> order = Property.ofValue(Order.ASC);

@Schema(
name = "sort",
Expand All @@ -166,7 +166,7 @@ public enum Fork {
"""
)
@Builder.Default
private Property<Sort> sort = Property.of(Sort.BEST_MATCH);
private Property<Sort> sort = Property.ofValue(Sort.BEST_MATCH);

@Override
public Output run(RunContext runContext) throws Exception {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/kestra/plugin/github/commits/Search.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public enum Sort {
"""
)
@Builder.Default
private Property<Order> order = Property.of(Order.ASC);
private Property<Order> order = Property.ofValue(Order.ASC);

@Schema(
title = "Sort condition for the output.",
Expand All @@ -191,7 +191,7 @@ public enum Sort {
"""
)
@Builder.Default
private Property<Sort> sort = Property.of(Sort.COMMITTER_DATE);
private Property<Sort> sort = Property.ofValue(Sort.COMMITTER_DATE);

@Override
public Output run(RunContext runContext) throws Exception {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/kestra/plugin/github/issues/Search.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public enum Sort {
"""
)
@Builder.Default
private Property<Order> order = Property.of(Order.ASC);
private Property<Order> order = Property.ofValue(Order.ASC);

@Schema(
title = "Sort condition for the output.",
Expand All @@ -115,7 +115,7 @@ public enum Sort {
"""
)
@Builder.Default
private Property<Sort> sort = Property.of(Sort.CREATED);
private Property<Sort> sort = Property.ofValue(Sort.CREATED);

@Override
public FileOutput run(RunContext runContext) throws Exception {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/kestra/plugin/github/pulls/Create.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ public class Create extends GithubConnector implements RunnableTask<Create.Outpu
description = "Boolean value indicating whether maintainers can modify the pull request. Default is false."
)
@Builder.Default
private Property<Boolean> maintainerCanModify = Property.of(Boolean.FALSE);
private Property<Boolean> maintainerCanModify = Property.ofValue(Boolean.FALSE);

@Schema(
title = "Whether to create a draft pull request.",
description = "Boolean value indicates whether to create a draft pull request or not. Default is false."
)
@Builder.Default
private Property<Boolean> draft = Property.of(Boolean.FALSE);
private Property<Boolean> draft = Property.ofValue(Boolean.FALSE);

@Override
public Output run(RunContext runContext) throws Exception {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/kestra/plugin/github/pulls/Search.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public enum Sort {
"""
)
@Builder.Default
private Property<Order> order = Property.of(Order.ASC);
private Property<Order> order = Property.ofValue(Order.ASC);

@Schema(
title = "Sort condition for the output.",
Expand All @@ -183,7 +183,7 @@ public enum Sort {
"""
)
@Builder.Default
private Property<Sort> sort = Property.of(Sort.CREATED);
private Property<Sort> sort = Property.ofValue(Sort.CREATED);

@Override
public FileOutput run(RunContext runContext) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public enum Visibility {
"""
)
@Builder.Default
private Property<Order> order = Property.of(Order.ASC);
private Property<Order> order = Property.ofValue(Order.ASC);

@Schema(
title = "Sort condition of the output.",
Expand All @@ -172,7 +172,7 @@ public enum Visibility {
"""
)
@Builder.Default
private Property<Sort> sort = Property.of(Sort.UPDATED);
private Property<Sort> sort = Property.ofValue(Sort.UPDATED);

@Schema(
title = "Search repository that have specified repositories. By default, it's search for all repositories.",
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/kestra/plugin/github/topics/Search.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public String toString() {
"""
)
@Builder.Default
private Property<Order> order = Property.of(Order.ASC);
private Property<Order> order = Property.ofValue(Order.ASC);

@Override
public Output run(RunContext runContext) throws Exception {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/kestra/plugin/github/users/Search.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public enum Type {
"""
)
@Builder.Default
private Property<Order> order = Property.of(Order.ASC);
private Property<Order> order = Property.ofValue(Order.ASC);

@Schema(
title = "Sort condition of the output.",
Expand All @@ -155,7 +155,7 @@ public enum Type {
"""
)
@Builder.Default
private Property<Sort> sort = Property.of(Sort.JOINED);
private Property<Sort> sort = Property.ofValue(Sort.JOINED);

@Override
public FileOutput run(RunContext runContext) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ void testRunWorkflow() throws Exception {
var runContext = runContextFactory.of();

var runWorkflowTask = RunWorkflow.builder()
.oauthToken(Property.of(""))
.repository(Property.of("kestra-io/plugin-github"))
.workflowId(Property.of("105842276")) // https://api.github.com/repos/kestra-io/plugin-github/actions/workflows/105842276
.ref(Property.of("master"))
.oauthToken(Property.ofValue(""))
.repository(Property.ofValue("kestra-io/plugin-github"))
.workflowId(Property.ofValue("105842276")) // https://api.github.com/repos/kestra-io/plugin-github/actions/workflows/105842276
.ref(Property.ofValue("master"))
.build();

runWorkflowTask.run(runContext);
Expand Down
14 changes: 7 additions & 7 deletions src/test/java/io/kestra/plugin/github/code/SearchTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ void testQuery() throws Exception {
RunContext runContext = runContextFactory.of();

Search task = Search.builder()
.oauthToken(Property.of(""))
.query(Property.of("run in:file language:java repo:kestra-io/plugin-github"))
.oauthToken(Property.ofValue(""))
.query(Property.ofValue("run in:file language:java repo:kestra-io/plugin-github"))
.build();

Search.Output run = task.run(runContext);
Expand All @@ -55,11 +55,11 @@ void testParameters() throws Exception {
RunContext runContext = runContextFactory.of();

Search task = Search.builder()
.oauthToken(Property.of(""))
.query(Property.of("run"))
.in(Property.of("file"))
.language(Property.of("java"))
.repository(Property.of("kestra-io/plugin-github"))
.oauthToken(Property.ofValue(""))
.query(Property.ofValue("run"))
.in(Property.ofValue("file"))
.language(Property.ofValue("java"))
.repository(Property.ofValue("kestra-io/plugin-github"))
.build();

Search.Output run = task.run(runContext);
Expand Down
10 changes: 5 additions & 5 deletions src/test/java/io/kestra/plugin/github/commits/SearchTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ void testQuery() throws Exception {
RunContext runContext = runContextFactory.of();

Search task = Search.builder()
.oauthToken(Property.of(""))
.query(Property.of("Initial repo:kestra-io/plugin-github"))
.oauthToken(Property.ofValue(""))
.query(Property.ofValue("Initial repo:kestra-io/plugin-github"))
.build();

Search.Output run = task.run(runContext);
Expand All @@ -56,9 +56,9 @@ void testParameters() throws Exception {
RunContext runContext = runContextFactory.of();

Search task = Search.builder()
.oauthToken(Property.of(""))
.query(Property.of("Initial"))
.repository(Property.of("kestra-io/plugin-github"))
.oauthToken(Property.ofValue(""))
.query(Property.ofValue("Initial"))
.repository(Property.ofValue("kestra-io/plugin-github"))
.build();

Search.Output run = task.run(runContext);
Expand Down
20 changes: 10 additions & 10 deletions src/test/java/io/kestra/plugin/github/issues/CommentTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ void run() throws Exception {
RunContext runContext = runContextFactory.of();

Create createTask = Create.builder()
.oauthToken(Property.of(""))
.repository(Property.of("kestra-io/plugin-github"))
.title(Property.of("Test Kestra Github plugin"))
.body(Property.of("This is a test for creating a new issue in repository by oauth token"))
.labels(Property.of(List.of("kestra", "test")))
.assignees(Property.of(List.of("iNikitaGricenko")))
.oauthToken(Property.ofValue(""))
.repository(Property.ofValue("kestra-io/plugin-github"))
.title(Property.ofValue("Test Kestra Github plugin"))
.body(Property.ofValue("This is a test for creating a new issue in repository by oauth token"))
.labels(Property.ofValue(List.of("kestra", "test")))
.assignees(Property.ofValue(List.of("iNikitaGricenko")))
.build();

Create.Output createOutput = createTask.run(runContext);
Expand All @@ -40,10 +40,10 @@ void run() throws Exception {
int issueNumber = createOutput.getIssueNumber();

Comment commentTask = Comment.builder()
.oauthToken(Property.of(""))
.repository(Property.of("kestra-io/plugin-github"))
.issueNumber(Property.of(issueNumber))
.body(Property.of("This comment is a test for creating a new comment in repository issue by oauth token"))
.oauthToken(Property.ofValue(""))
.repository(Property.ofValue("kestra-io/plugin-github"))
.issueNumber(Property.ofValue(issueNumber))
.body(Property.ofValue("This comment is a test for creating a new comment in repository issue by oauth token"))
.build();

Comment.Output commentOutput = commentTask.run(runContext);
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/io/kestra/plugin/github/issues/CreateTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ void run() throws Exception {
RunContext runContext = runContextFactory.of();

Create task = Create.builder()
.oauthToken(Property.of(""))
.repository(Property.of("kestra-io/plugin-github"))
.title(Property.of("Test Kestra Github plugin"))
.body(Property.of("This is a test for creating a new issue in repository by oauth token"))
.labels(Property.of(List.of("kestra", "test")))
.assignees(Property.of(List.of("iNikitaGricenko")))
.oauthToken(Property.ofValue(""))
.repository(Property.ofValue("kestra-io/plugin-github"))
.title(Property.ofValue("Test Kestra Github plugin"))
.body(Property.ofValue("This is a test for creating a new issue in repository by oauth token"))
.labels(Property.ofValue(List.of("kestra", "test")))
.assignees(Property.ofValue(List.of("iNikitaGricenko")))
.build();

Create.Output run = task.run(runContext);
Expand Down
10 changes: 5 additions & 5 deletions src/test/java/io/kestra/plugin/github/issues/SearchTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ void testQuery() throws Exception {
RunContext runContext = runContextFactory.of();

Search task = Search.builder()
.query(Property.of("repo:kestra-io/plugin-github is:open"))
.sort(Property.of(Search.Sort.UPDATED))
.query(Property.ofValue("repo:kestra-io/plugin-github is:open"))
.sort(Property.ofValue(Search.Sort.UPDATED))
.build();

Search.FileOutput run = task.run(runContext);
Expand All @@ -53,9 +53,9 @@ void testParameters() throws Exception {
RunContext runContext = runContextFactory.of();

Search task = Search.builder()
.query(Property.of("repo:kestra-io/plugin-github"))
.open(Property.of(Boolean.TRUE))
.sort(Property.of(Search.Sort.UPDATED))
.query(Property.ofValue("repo:kestra-io/plugin-github"))
.open(Property.ofValue(Boolean.TRUE))
.sort(Property.ofValue(Search.Sort.UPDATED))
.build();

Search.FileOutput run = task.run(runContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ void run() throws Exception {
RunContext runContext = runContextFactory.of();

io.kestra.plugin.github.pulls.Create task = io.kestra.plugin.github.pulls.Create.builder()
.oauthToken(Property.of(""))
.repository(Property.of("kestra-io/plugin-github"))
.sourceBranch(Property.of("dev"))
.targetBranch(Property.of("test"))
.title(Property.of("Test Kestra Github plugin"))
.body(Property.of("This is a test for creating a new pull request in repository by oauth token"))
.maintainerCanModify(Property.of(true))
.oauthToken(Property.ofValue(""))
.repository(Property.ofValue("kestra-io/plugin-github"))
.sourceBranch(Property.ofValue("dev"))
.targetBranch(Property.ofValue("test"))
.title(Property.ofValue("Test Kestra Github plugin"))
.body(Property.ofValue("This is a test for creating a new pull request in repository by oauth token"))
.maintainerCanModify(Property.ofValue(true))
.build();

Create.Output run = task.run(runContext);
Expand Down
10 changes: 5 additions & 5 deletions src/test/java/io/kestra/plugin/github/pulls/SearchTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ void testQuery() throws Exception {
RunContext runContext = runContextFactory.of();

Search task = Search.builder()
.query(Property.of("repo:kestra-io/plugin-github is:closed"))
.sort(Property.of(Search.Sort.UPDATED))
.query(Property.ofValue("repo:kestra-io/plugin-github is:closed"))
.sort(Property.ofValue(Search.Sort.UPDATED))
.build();

Search.FileOutput run = task.run(runContext);
Expand All @@ -53,9 +53,9 @@ void testParameters() throws Exception {
RunContext runContext = runContextFactory.of();

Search task = Search.builder()
.query(Property.of("repo:kestra-io/plugin-github"))
.open(Property.of(Boolean.FALSE))
.sort(Property.of(Search.Sort.UPDATED))
.query(Property.ofValue("repo:kestra-io/plugin-github"))
.open(Property.ofValue(Boolean.FALSE))
.sort(Property.ofValue(Search.Sort.UPDATED))
.build();

Search.FileOutput run = task.run(runContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ void testQuery() throws Exception {
RunContext runContext = runContextFactory.of();

Search task = Search.builder()
.query(Property.of("user:kestra-io language:java is:public"))
.sort(Property.of(Search.Sort.STARS))
.query(Property.ofValue("user:kestra-io language:java is:public"))
.sort(Property.ofValue(Search.Sort.STARS))
.build();

Search.FileOutput run = task.run(runContext);
Expand All @@ -51,10 +51,10 @@ void testParameters() throws Exception {
RunContext runContext = runContextFactory.of();

Search task = Search.builder()
.repository(Property.of("kestra-io/plugin-github"))
.language(Property.of("java"))
.visibility(Property.of(Search.Visibility.PUBLIC))
.sort(Property.of(Search.Sort.STARS))
.repository(Property.ofValue("kestra-io/plugin-github"))
.language(Property.ofValue("java"))
.visibility(Property.ofValue(Search.Visibility.PUBLIC))
.sort(Property.ofValue(Search.Sort.STARS))
.build();

Search.FileOutput run = task.run(runContext);
Expand Down
10 changes: 5 additions & 5 deletions src/test/java/io/kestra/plugin/github/topics/SearchTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ void testQuery() throws Exception {
RunContext runContext = runContextFactory.of();

Search task = Search.builder()
.oauthToken(Property.of(""))
.query(Property.of("Spring Cloud is:not-curated repositories:>10"))
.oauthToken(Property.ofValue(""))
.query(Property.ofValue("Spring Cloud is:not-curated repositories:>10"))
.build();

Search.Output run = task.run(runContext);
Expand All @@ -55,9 +55,9 @@ void testParameters() throws Exception {
RunContext runContext = runContextFactory.of();

Search task = Search.builder()
.query(Property.of("Spring Cloud"))
.is(Property.of(Search.Is.NOT_CURATED))
.repositories(Property.of(">10"))
.query(Property.ofValue("Spring Cloud"))
.is(Property.ofValue(Search.Is.NOT_CURATED))
.repositories(Property.ofValue(">10"))
.build();

Search.Output run = task.run(runContext);
Expand Down
8 changes: 4 additions & 4 deletions src/test/java/io/kestra/plugin/github/users/SearchTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void testQuery() throws Exception {
RunContext runContext = runContextFactory.of();

Search task = Search.builder()
.query(Property.of("kestra-io in:login language:java"))
.query(Property.ofValue("kestra-io in:login language:java"))
.build();

Search.FileOutput run = task.run(runContext);
Expand All @@ -52,9 +52,9 @@ void testParameters() throws Exception {
RunContext runContext = runContextFactory.of();

Search task = Search.builder()
.query(Property.of("kestra-io"))
.in(Property.of("login"))
.language(Property.of("java"))
.query(Property.ofValue("kestra-io"))
.in(Property.ofValue("login"))
.language(Property.ofValue("java"))
.build();

Search.FileOutput run = task.run(runContext);
Expand Down
Loading