-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Added REST methods for task and trigger validation that accept JSON body #3785
Added REST methods for task and trigger validation that accept JSON body #3785
Conversation
04a5e48
to
27a81a3
Compare
Hi @rybandrei2014 , Sorry for the late answer, can you also provide unit tests in https://github.com/kestra-io/kestra/blob/develop/webserver/src/test/java/io/kestra/webserver/controllers/api/FlowControllerTest.java |
Hi @loicmathieu, no worries, thanks for your reaction. I added unit tests for new endpoints. Thank you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move all your tests data inline in the Java test class so they are more easily found and didn't add too many files.
You can use text blocks to deal with double quotes, for ex:
String task = """
{
"id": "task_one",
"type": "io.kestra.plugin.core.log.Log"
}
"""
@@ -533,6 +538,53 @@ public List<ValidateConstraintViolation> validateFlows( | |||
.collect(Collectors.toList()); | |||
} | |||
|
|||
@ExecuteOn(TaskExecutors.IO) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ExecuteOn(TaskExecutors.IO) | |
// This endpoint is not used by the Kestra UI nor our CLI but is provided for the API users for convenience | |
@ExecuteOn(TaskExecutors.IO) |
Adding a comment will prevent someone removing the method as not used ;)
return validateConstraintViolationBuilder.build(); | ||
} | ||
|
||
@ExecuteOn(TaskExecutors.IO) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ExecuteOn(TaskExecutors.IO) | |
// This endpoint is not used by the Kestra UI nor our CLI but is provided for the API users for convenience | |
@ExecuteOn(TaskExecutors.IO) |
webserver/src/test/java/io/kestra/webserver/controllers/api/FlowControllerTest.java
Show resolved
Hide resolved
webserver/src/main/java/io/kestra/webserver/controllers/api/FlowController.java
Show resolved
Hide resolved
@rybandrei2014 ca you address my comments so we can proceed with the PR? |
9282728
to
ad5b2d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
Hello @loicmathieu, I am currently busy with my other project. Hopefully, I will be able to provide requested changes next week. Sorry for keeping you waiting and late reply |
@rybandrei2014 I made the necessary change and will now merge it. |
What changes are being made and why?
Kestra doesn't provide rest endpoints for validation of task and triggers in JSON format. Endpoint for task/trigger validation /validate/task accepts only YAML body.
Following PR adds two new endpoints: