Skip to content

Conversation

joshsny
Copy link
Contributor

@joshsny joshsny commented Oct 14, 2025

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

  • Remove workflow triggers from existing endpoints
  • Add a run endpoint that triggers the temporal workflow, leaves it to the SDK to decide how to work on the task and to update it's status

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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

Edit Code Review Agent Settings | Greptile

Comment on lines +440 to +451
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,
)
Copy link
Contributor

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:

  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
Suggested change
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.

Copy link
Contributor

Size Change: +70 B (0%)

Total Size: 3.05 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 3.05 MB +70 B (0%)

compressed-size-action

@joshsny joshsny merged commit ecade3c into master Oct 16, 2025
186 of 187 checks passed
@joshsny joshsny deleted the array/run-endpoint branch October 16, 2025 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants