Skip to content

Commit b32dec8

Browse files
committed
Fix storing origin for workflow landing requests
The origin field was being accepted in the payload but not stored to the model in create_workflow_landing_request(). This was inconsistent with create_tool_landing_request() which correctly stores the origin. Added a test to verify the origin is preserved through create and claim operations. https://claude.ai/code/session_01Nk9FaZ1BsPghEvrdJbNQJQ
1 parent fc53dfb commit b32dec8

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

lib/galaxy/managers/landing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ def create_workflow_landing_request(self, payload: CreateWorkflowLandingRequestP
156156
model.client_secret = payload.client_secret
157157
model.request_state = self.validate_workflow_request_state(payload.request_state)
158158
model.public = payload.public
159+
model.origin = str(payload.origin) if payload.origin else None
159160
self._save(model)
160161
return self._workflow_response(model)
161162

lib/galaxy_test/api/test_landing.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,25 @@ def test_tool_landing_invalid(self):
6767
assert_error_code_is(response, 400008)
6868
assert "Input should be a valid integer" in response.text
6969

70+
@skip_without_tool("cat1")
71+
def test_workflow_landing_origin(self):
72+
request = _get_simple_landing_payload(self.workflow_populator, public=True)
73+
request = CreateWorkflowLandingRequestPayload(
74+
workflow_id=request.workflow_id,
75+
workflow_target_type=request.workflow_target_type,
76+
request_state=request.request_state,
77+
public=request.public,
78+
origin=HttpUrl("http://example.localhost/"),
79+
)
80+
response = self.dataset_populator.create_workflow_landing(request)
81+
assert response.workflow_id == request.workflow_id
82+
assert response.state == "unclaimed"
83+
assert str(response.origin) == "http://example.localhost/"
84+
response = self.dataset_populator.claim_workflow_landing(response.uuid)
85+
assert response.workflow_id == request.workflow_id
86+
assert response.state == "claimed"
87+
assert str(response.origin) == "http://example.localhost/"
88+
7089
def test_data_landing(self):
7190
data_landing_request_state = DataLandingRequestState(
7291
targets=[

0 commit comments

Comments
 (0)