carloea2 commented on code in PR #8140:
URL: https://github.com/apache/texera/pull/8140#discussion_r3897090930
##########
amber/src/main/scala/org/apache/texera/web/resource/dashboard/user/workflow/WorkflowResource.scala:
##########
@@ -840,6 +840,8 @@ class WorkflowResource extends LazyLogging {
.where(WORKFLOW.WID.eq(wid))
.and(WORKFLOW.IS_PUBLIC.isTrue)
.fetchOne()
+ if (workflow == null)
+ throw new NotFoundException(s"Public workflow with id $wid not found")
Review Comment:
I’ll keep getWorkflowType separate. This PR stays scoped to public retrieval.
##########
amber/src/test/scala/org/apache/texera/web/resource/dashboard/user/workflow/WorkflowResourceCoverSpec.scala:
##########
@@ -152,6 +152,21 @@ class WorkflowResourceCoverSpec
.execute()
}
+ "retrievePublicWorkflow" should "return a public workflow" in {
Review Comment:
Moved the rejection case to WorkflowResourceSpec and removed the duplicate
positive case.
##########
amber/src/main/scala/org/apache/texera/web/resource/dashboard/user/workflow/WorkflowResource.scala:
##########
@@ -840,6 +840,8 @@ class WorkflowResource extends LazyLogging {
.where(WORKFLOW.WID.eq(wid))
.and(WORKFLOW.IS_PUBLIC.isTrue)
.fetchOne()
+ if (workflow == null)
+ throw new NotFoundException(s"Public workflow with id $wid not found")
Review Comment:
Added braces to match the file.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]