Skip to content

Return run details#279

Merged
kkartunov merged 5 commits into
developfrom
return-run-details
Jun 12, 2026
Merged

Return run details#279
kkartunov merged 5 commits into
developfrom
return-run-details

Conversation

@vas3a

@vas3a vas3a commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

This pull request introduces several improvements to the AI workflow dispatch and decision-making logic, focusing on better handling of workflow cancellations, more accurate workflow run metadata tracking, and simplifying event handling for workflow jobs. The most significant changes include updating the AI review decision logic to account for cancelled runs, enhancing the workflow dispatch process to return and persist run metadata, and refactoring how certain workflow job events are handled.

AI Review Decision Logic Improvements:

  • The AI review decision now checks for any cancelled workflow runs (runStatus === 'CANCELLED'). If any are found, the weighted score is set to 0, and the review is automatically failed with a specific reason indicating cancellation. This prevents submissions with cancelled runs from passing the AI review. [1] [2] [3] [4]

Workflow Dispatch and Metadata Handling:

  • The GiteaService.runDispatchWorkflow method now returns workflow run metadata (such as workflow_run_id, run_url, and html_url) instead of just void. This metadata is logged and saved to the database for better traceability of workflow executions. [1] [2] [3] [4] [5] [6]

Workflow Job Event Handling Refactor:

  • The handler for workflow job events now ignores jobs named dump-workflow-context early, simplifying the logic and removing the previous lookup and update of workflow run information from logs for these jobs. This reduces unnecessary complexity and log noise. [1] [2] [3]

Workflow Completion Logic Adjustment:

  • The logic for marking workflow runs as completed has been updated to ensure that the run is only marked as complete when all jobs have finished, using a more robust check on completedJobs versus jobsCount.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the AI workflow execution pipeline to (1) treat cancelled workflow runs as an automatic AI decision failure, and (2) persist workflow run metadata returned from Gitea dispatch calls, while also refactoring workflow job event handling.

Changes:

  • AI decision evaluation now fails submissions when any configured workflow run is cancelled, and records that state in the decision breakdown.
  • Workflow dispatch now returns run metadata (run id/URLs) and persists it to aiWorkflowRun for traceability and event correlation.
  • Workflow job event handling is refactored around dump-workflow-context and the “complete only after all jobs finish” logic.

Reviewed changes

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

File Description
src/shared/modules/global/workflow-queue.handler.ts Persists dispatch run metadata; refactors workflow job event processing and completion counting.
src/shared/modules/global/gitea.service.ts Changes dispatch to request/return run details from Gitea and exposes a typed response shape.
src/shared/modules/global/ai-reviewer-decision-maker.service.ts Updates decision logic to fail on cancelled runs and include cancellation in decision breakdown.

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

Comment thread src/shared/modules/global/gitea.service.ts
Comment thread src/shared/modules/global/workflow-queue.handler.ts
Comment thread src/shared/modules/global/workflow-queue.handler.ts Outdated
@kkartunov kkartunov merged commit 21e6caa into develop Jun 12, 2026
6 checks passed
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