This is an automated email from the ASF dual-hosted git repository.
github-merge-queue[bot] pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/texera.git
The following commit(s) were added to refs/heads/main by this push:
new 1ac5b225fe feat(amber): reject missing workflow metadata ID (#8142)
1ac5b225fe is described below
commit 1ac5b225fe203a65d3305b6df2839382e35e1a25
Author: carloea2 <[email protected]>
AuthorDate: Mon Oct 26 16:14:26 2026 +0000
feat(amber): reject missing workflow metadata ID (#8142)
### What changes were proposed in this PR?
Return 400 Bad Request when the workflow owner, name or description
endpoint is called without a workflow ID. Valid IDs keep their existing
behavior.
Before: a missing ID could return an empty response.
After: it returns 400 with `wid is required`.
### Any related issues, documentation, discussions?
Closes #8141
### How was this PR tested?
Retested in a fresh detached worktree from upstream main at
`7426431337`, which includes #8938. The regression assertions failed
before the implementation change: 1 failed and 17 passed. After the
change, all 18 focused tests pass.
Used JDK 17 and a disposable PostgreSQL database initialized from
`sql/texera_ddl.sql`. The tests use embedded PostgreSQL. Object-storage
endpoints were isolated for the passing run.
```powershell
$env:STORAGE_JDBC_URL='jdbc:postgresql://127.0.0.1:55489/oct15_review?currentSchema=texera_db,public'
$env:STORAGE_S3_ENDPOINT='http://127.0.0.1:1'
$env:STORAGE_LAKEFS_ENDPOINT='http://127.0.0.1:1/api/v1'
sbt -batch "WorkflowExecutionService/testOnly *WorkflowResourceCoverSpec --
-oDF" "scalafixAll --check" scalafmtCheckAll
```
Repository lint, formatting and whitespace checks pass.
The full LoopIntegrationSpec also passes all 8 tests on this refreshed
branch, using real Python workers and JVM operators, including nested
loops. There are no failed or canceled tests. The run used Python 3.12
and isolated PostgreSQL metadata and Iceberg catalog databases.
```powershell
$env:STORAGE_JDBC_URL_FOR_TEST_CASES=$env:STORAGE_JDBC_URL
$env:STORAGE_ICEBERG_CATALOG_TYPE='postgres'
$env:STORAGE_ICEBERG_CATALOG_POSTGRES_URI_WITHOUT_SCHEME='127.0.0.1:55489/oct15_loop_catalog'
$env:UDF_PYTHON_PATH='C:/Users/carlo/texera/venv312/Scripts/python.exe'
sbt -batch "WorkflowExecutionService/testOnly *LoopIntegrationSpec -- -oDF"
```
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Codex
---
.../resource/dashboard/user/workflow/WorkflowResource.scala | 6 ++++++
.../dashboard/user/workflow/WorkflowResourceCoverSpec.scala | 12 ++++++++++++
2 files changed, 18 insertions(+)
diff --git
a/amber/src/main/scala/org/apache/texera/web/resource/dashboard/user/workflow/WorkflowResource.scala
b/amber/src/main/scala/org/apache/texera/web/resource/dashboard/user/workflow/WorkflowResource.scala
index 3369ae6494..3124600ee9 100644
---
a/amber/src/main/scala/org/apache/texera/web/resource/dashboard/user/workflow/WorkflowResource.scala
+++
b/amber/src/main/scala/org/apache/texera/web/resource/dashboard/user/workflow/WorkflowResource.scala
@@ -932,6 +932,8 @@ class WorkflowResource extends LazyLogging {
@Produces(Array(MediaType.TEXT_PLAIN))
@Path("/owner_name")
def getOwnerName(@QueryParam("wid") wid: Integer): String = {
+ if (wid == null)
+ throw new BadRequestException("wid is required")
context
.select(USER.NAME)
.from(USER)
@@ -944,6 +946,8 @@ class WorkflowResource extends LazyLogging {
@GET
@Path("/workflow_name")
def getWorkflowName(@QueryParam("wid") wid: Integer): String = {
+ if (wid == null)
+ throw new BadRequestException("wid is required")
publicField(wid, WORKFLOW.PUBLISHED_NAME, WORKFLOW.NAME)
}
@@ -978,6 +982,8 @@ class WorkflowResource extends LazyLogging {
@GET
@Path("/workflow_description")
def getWorkflowDescription(@QueryParam("wid") wid: Integer): String = {
+ if (wid == null)
+ throw new BadRequestException("wid is required")
publicField(wid, WORKFLOW.PUBLISHED_DESCRIPTION, WORKFLOW.DESCRIPTION)
}
diff --git
a/amber/src/test/scala/org/apache/texera/web/resource/dashboard/user/workflow/WorkflowResourceCoverSpec.scala
b/amber/src/test/scala/org/apache/texera/web/resource/dashboard/user/workflow/WorkflowResourceCoverSpec.scala
index fc116d9c92..1eeb718408 100644
---
a/amber/src/test/scala/org/apache/texera/web/resource/dashboard/user/workflow/WorkflowResourceCoverSpec.scala
+++
b/amber/src/test/scala/org/apache/texera/web/resource/dashboard/user/workflow/WorkflowResourceCoverSpec.scala
@@ -152,6 +152,18 @@ class WorkflowResourceCoverSpec
.execute()
}
+ "workflow metadata" should "return the workflow owner, name and description"
in {
+ resource.getOwnerName(testWid) shouldBe "cover_owner"
+ resource.getWorkflowName(testWid) shouldBe "cover_test_workflow"
+ resource.getWorkflowDescription(testWid) shouldBe "desc"
+ }
+
+ it should "reject a missing workflow id" in {
+ assertThrows[BadRequestException](resource.getOwnerName(null))
+ assertThrows[BadRequestException](resource.getWorkflowName(null))
+ assertThrows[BadRequestException](resource.getWorkflowDescription(null))
+ }
+
"getCoverImage" should "throw NotFoundException when no cover is set" in {
assertThrows[NotFoundException] {
resource.getCoverImage(testWid, session(owner))