Skip to content

BCH-1156: Filter My Tasks by effective due date using COALESCE#405

Merged
saltpy-cs merged 1 commit into
mainfrom
fix/BCH-1156
May 27, 2026
Merged

BCH-1156: Filter My Tasks by effective due date using COALESCE#405
saltpy-cs merged 1 commit into
mainfrom
fix/BCH-1156

Conversation

@saltpy-cs
Copy link
Copy Markdown
Contributor

@saltpy-cs saltpy-cs commented May 27, 2026

Step executions store their due_date on step_executions.due_date while workflow_executions.due_date is NULL. The previous filter queried only the workflow execution column, so every date range returned zero results. COALESCE(step_executions.due_date, workflow_executions.due_date) mirrors the UI's getEffectiveDueDate logic and correctly includes tasks.

Summary by CodeRabbit

  • Bug Fixes
    • Assignment filtering by due date now correctly prioritizes step-level due dates. When filtering assignments within a specified time window, the system now uses the individual step's due date when available, providing more accurate results. The workflow's due date is used as a fallback when the step has no due date assigned.

Review Change Stack

Step executions store their due_date on step_executions.due_date while
workflow_executions.due_date is NULL. The previous filter queried only
the workflow execution column, so every date range returned zero results.
COALESCE(step_executions.due_date, workflow_executions.due_date) mirrors
the UI's getEffectiveDueDate logic and correctly includes tasks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 78ead2e7-7702-4a05-814d-e755c7ee971a

📥 Commits

Reviewing files that changed from the base of the PR and between 83903b5 and 0add620.

📒 Files selected for processing (2)
  • internal/service/relational/workflows/step_execution_service.go
  • internal/service/relational/workflows/step_execution_service_test.go

📝 Walkthrough

Walkthrough

The PR updates GetMyAssignments to filter step assignments by an effective due date that prefers each step's own due_date over the parent workflow execution's due_date using COALESCE. A test validates that filtering works correctly when a step has its own due date independent of the workflow execution.

Changes

Step execution due-date filtering

Layer / File(s) Summary
Effective due date filtering with step precedence
internal/service/relational/workflows/step_execution_service.go, internal/service/relational/workflows/step_execution_service_test.go
GetMyAssignments now filters DueBefore and DueAfter using COALESCE(step_executions.due_date, workflow_executions.due_date) to prefer the step's own due date. A new test verifies filtering returns the correct step execution when only the step has a due date and the workflow execution has none.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A step hops forward with its own deadline,
No need to wait for the workflow's design,
COALESCE prefers the step's date so fine,
And tests confirm this precedence divine!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: using COALESCE to filter tasks by effective due date instead of only the workflow execution's due date.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@saltpy-cs saltpy-cs merged commit e2da7ff into main May 27, 2026
5 checks passed
@saltpy-cs saltpy-cs deleted the fix/BCH-1156 branch May 27, 2026 10:59
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.

1 participant