Skip to content

feat: overdue tasks#323

Merged
gusfcarvalho merged 4 commits intomainfrom
gc-feat-overdue-tasks
Feb 17, 2026
Merged

feat: overdue tasks#323
gusfcarvalho merged 4 commits intomainfrom
gc-feat-overdue-tasks

Conversation

@gusfcarvalho
Copy link
Contributor

No description provided.

Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
Copilot AI review requested due to automatic review settings February 17, 2026 13:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds overdue/failed automation to workflow executions and step executions, including configurable grace periods and new evidence on failure.

Changes:

  • Introduces an OverdueService and wires it into the scheduler worker to mark steps/executions overdue and fail them after grace expiry.
  • Adds new statuses/fields (overdue, OverdueAt, DueDate) plus status-transition validation, retry initialization behavior, and dependent-step failure propagation.
  • Exposes grace-period overrides on workflow definitions/instances/steps via handlers and updates Swagger + tests accordingly.

Reviewed changes

Copilot reviewed 36 out of 36 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
internal/workflow/step_transition.go Adds invalid-transition sentinel error, overdue transition rule, and failure entrypoint.
internal/workflow/scheduler.go Runs overdue checks at the end of scheduler work when enabled.
internal/workflow/overdue.go New service to mark steps/executions overdue and fail overdue executions after grace.
internal/workflow/overdue_test.go New tests for overdue and grace-expiry failure behavior.
internal/workflow/manager.go Adds overdue step count to execution status summary.
internal/workflow/executor.go Adds per-step due dates, retry initialization behavior, and failure propagation to dependents.
internal/workflow/executor_test.go Updates mocks for new executor initialization behavior.
internal/workflow/evidence.go Adds evidence generation for execution failure.
internal/workflow/constants.go Adds StatusOverdue to orchestration-layer step status constants.
internal/workflow/assignment.go Allows reassignment for overdue steps.
internal/workflow/assignment_test.go Tests reassignment for overdue steps.
internal/service/worker/service.go Wires OverdueService + config flag into scheduler worker construction.
internal/service/relational/workflows/workflow_step_definition_service.go Validates non-negative step grace override.
internal/service/relational/workflows/workflow_step_definition.go Adds per-step GracePeriodDays override field.
internal/service/relational/workflows/workflow_instance_service.go Validates non-negative instance grace override.
internal/service/relational/workflows/workflow_instance.go Adds/renames instance grace-period JSON field.
internal/service/relational/workflows/workflow_execution_service.go Adds execution status-transition validation and overdue timestamping.
internal/service/relational/workflows/workflow_execution_service_test.go Tests overdue transitions and overdue->completed transitions.
internal/service/relational/workflows/workflow_execution.go Adds OverdueAt, step OverdueAt/DueDate, and a unique index for step executions.
internal/service/relational/workflows/step_execution_service.go Adds step status-transition validation, overdue timestamping, and includes overdue in assignment queries.
internal/service/relational/workflows/step_execution_service_test.go Adjusts tests for uniqueness + adds overdue transition coverage.
internal/service/relational/workflows/constants.go Adds overdue to execution + step status enums.
internal/service/relational/workflows/workflow_definition_service.go Validates non-negative definition grace override.
internal/service/relational/workflows/workflow_definition.go Adds/renames definition grace-period JSON field.
internal/api/handler/workflows/workflow_step_definition_integration_test.go Adds integration coverage for step grace-period field.
internal/api/handler/workflows/workflow_step_definition.go Accepts/updates step grace-period field in API.
internal/api/handler/workflows/workflow_instance_integration_test.go Adds integration coverage for instance grace-period field.
internal/api/handler/workflows/workflow_instance.go Accepts/updates instance grace-period field in API.
internal/api/handler/workflows/workflow_execution_integration_test.go Adjusts fixture to avoid step execution uniqueness conflicts.
internal/api/handler/workflows/workflow_definition_integration_test.go Adds integration coverage for definition grace-period field.
internal/api/handler/workflows/workflow_definition.go Accepts/updates definition grace-period field in API.
internal/api/handler/workflows/step_execution_integration_test.go Adds test for invalid overdue->in_progress transition; adjusts fixtures for uniqueness.
internal/api/handler/workflows/step_execution.go Maps invalid step transitions to 400 and routes “fail” through transition service.
docs/swagger.yaml Documents new fields (overdue counts, grace-period-days, due/overdue timestamps).
docs/swagger.json Generated Swagger updates for new fields.
docs/docs.go Generated docs template updates for new fields.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 36 out of 36 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
@gusfcarvalho gusfcarvalho requested a review from Copilot February 17, 2026 16:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 36 out of 36 changed files in this pull request and generated 6 comments.

Comments suppressed due to low confidence (1)

internal/workflow/overdue.go:1

  • The function name 'markExecutionsOverdueFromStepOverdue' is repetitive with 'overdue' appearing three times. Consider renaming to 'promoteStepOverdueToExecution' or 'markExecutionsOverdueFromSteps' for better clarity.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
@gusfcarvalho gusfcarvalho requested a review from Copilot February 17, 2026 16:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 36 out of 36 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 36 out of 36 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

internal/service/relational/workflows/step_execution_service.go:116

  • AddStepStartedEvidence is called before the compare-and-swap update. If the CAS update fails (RowsAffected==0 due to a concurrent status change), this can still create “started” evidence even though the status transition did not occur. Consider only emitting evidence after a successful update (or make evidence creation idempotent / part of the same transaction) to avoid duplicate/incorrect audit records under concurrency.
	case "in_progress":
		updates["started_at"] = now
		if s.evidenceCreator != nil {
			if err := s.evidenceCreator.AddStepStartedEvidence(ctx, id); err != nil {
				// Log error but don't fail the status update
				s.logger.Warnw("Failed to create step started evidence",

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gusfcarvalho gusfcarvalho merged commit 47c000b into main Feb 17, 2026
15 of 16 checks passed
@gusfcarvalho gusfcarvalho deleted the gc-feat-overdue-tasks branch February 17, 2026 16:53
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.

2 participants