Return run details#279
Merged
Merged
Conversation
There was a problem hiding this comment.
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
aiWorkflowRunfor traceability and event correlation. - Workflow job event handling is refactored around
dump-workflow-contextand 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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:
GiteaService.runDispatchWorkflowmethod now returns workflow run metadata (such asworkflow_run_id,run_url, andhtml_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:
dump-workflow-contextearly, 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:
completedJobsversusjobsCount.