-
Notifications
You must be signed in to change notification settings - Fork 2k
feat(array): add endpoint for kicking off a task, remove workflow triggers from other endpoints #39644
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
Conversation
…ggers from other endpoints
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.
2 files reviewed, 1 comment
def test_run_endpoint_without_workflow_fails(self): | ||
workflow = self.create_workflow() | ||
stage = workflow.stages.first() | ||
|
||
task = Task.objects.create( | ||
team=self.team, | ||
title="Task without workflow", | ||
description="Test", | ||
origin_product=Task.OriginProduct.USER_CREATED, | ||
current_stage=stage, | ||
position=0, | ||
) |
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.
style: task created with current_stage
from a workflow but without setting workflow
field - creates inconsistent state
the test creates a stage that belongs to workflow
, then assigns that stage to the task without setting the task's workflow
field. while this tests the effective_workflow
logic, it creates an inconsistent state that may not represent real usage.
consider either:
- not setting
current_stage
at all (truly no workflow) - or clarify in a comment that this tests the edge case of inconsistent state
def test_run_endpoint_without_workflow_fails(self): | |
workflow = self.create_workflow() | |
stage = workflow.stages.first() | |
task = Task.objects.create( | |
team=self.team, | |
title="Task without workflow", | |
description="Test", | |
origin_product=Task.OriginProduct.USER_CREATED, | |
current_stage=stage, | |
position=0, | |
) | |
def test_run_endpoint_without_workflow_fails(self): | |
# Create task without workflow or stage to test the effective_workflow fallback | |
task = Task.objects.create( | |
team=self.team, | |
title="Task without workflow", | |
description="Test", | |
origin_product=Task.OriginProduct.USER_CREATED, | |
current_stage=None, | |
position=0, | |
) |
Prompt To Fix With AI
This is a comment left during a code review.
Path: products/tasks/backend/tests/test_api.py
Line: 440:451
Comment:
**style:** task created with `current_stage` from a workflow but without setting `workflow` field - creates inconsistent state
the test creates a stage that belongs to `workflow`, then assigns that stage to the task without setting the task's `workflow` field. while this tests the `effective_workflow` logic, it creates an inconsistent state that may not represent real usage.
consider either:
1. not setting `current_stage` at all (truly no workflow)
2. or clarify in a comment that this tests the edge case of inconsistent state
```suggestion
def test_run_endpoint_without_workflow_fails(self):
# Create task without workflow or stage to test the effective_workflow fallback
task = Task.objects.create(
team=self.team,
title="Task without workflow",
description="Test",
origin_product=Task.OriginProduct.USER_CREATED,
current_stage=None,
position=0,
)
```
How can I resolve this? If you propose a fix, please make it concise.
Size Change: +70 B (0%) Total Size: 3.05 MB ℹ️ View Unchanged
|
Problem
We now support local and cloud workflows - we don't want to trigger the cloud workflow on changes anymore, but we need an endpoint to kick off the cloud workflow.
Changes