Skip to content

When advancing AI phase, count the pending workflows for latest submissions only#46

Merged
vas3a merged 1 commit into
developfrom
advance-ai-phase
Jun 9, 2026
Merged

When advancing AI phase, count the pending workflows for latest submissions only#46
vas3a merged 1 commit into
developfrom
advance-ai-phase

Conversation

@vas3a

@vas3a vas3a commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

This pull request enhances the logic for counting in-progress AI workflow runs in the ReviewService to consider only the latest submissions per user or submission, ensuring more accurate metrics. It also adds comprehensive tests to verify the new behavior and improves logging details for better observability.

Improvements to AI workflow run counting:

  • Updated the SQL query in getInProgressAiWorkflowRunCount to use a Common Table Expression (latest_submissions) that selects only the latest submission for each user or submission, ensuring that only in-progress workflow runs for these are counted.

Testing enhancements:

  • Added a new test case in review.service.spec.ts to verify that getInProgressAiWorkflowRunCount correctly counts only in-progress AI workflow runs for the latest submissions and checks the generated SQL for expected clauses.

Logging improvements:

  • Enhanced the action logging in getInProgressAiWorkflowRunCount to include a latestSubmissionsOnly: true flag in the log details, making it clear that only the latest submissions are considered.

@vas3a vas3a merged commit b699214 into develop Jun 9, 2026
5 checks passed
@vas3a vas3a deleted the advance-ai-phase branch June 9, 2026 21:00
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