[actions] Add Copilot error logs review to CI builder#13735
[actions] Add Copilot error logs review to CI builder#13735v-GeorgyPuzakov wants to merge 12 commits intoactions:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds GitHub Copilot CLI integration to analyze CI provisioner failure logs in Ubuntu build workflows. When a workflow job fails, the system downloads the job logs, extracts relevant provisioner failure sections, and uses the Copilot CLI to generate root cause and suggested fix analysis. The analysis is then displayed in the workflow logs and included in the GitHub Actions step summary.
Changes:
- Added Copilot CLI-based log analysis functionality to automatically diagnose provisioner failures
- Extended GitHubApi class with methods to fetch workflow job details and download job logs
- Modified the Ubuntu/Windows build trigger workflow to install Copilot CLI and configure it for log analysis
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 11 comments.
| File | Description |
|---|---|
| helpers/WaitWorkflowCompletion.ps1 | Added Write-FailedJobLogs function with nested functions for log extraction (Get-ProvisionerWindow) and Copilot analysis (Invoke-CopilotLogAnalysis); integrated into main workflow completion logic to analyze failures |
| helpers/GitHubApi.psm1 | Added GetWorkflowRunJobs, DownloadJobLogs, and ReRunFailedJobs methods to support fetching job details and logs from GitHub Actions API |
| .github/workflows/trigger-ubuntu-win-build.yml | Added Copilot CLI installation and validation steps; configured environment variables for Copilot; extended summary generation to include Copilot analysis output |
| - name: Validate Copilot environment | ||
| shell: bash | ||
| env: | ||
| COPILOT_GITHUB_TOKEN: ${{ secrets.MODELS_TOKEN }} | ||
| run: | | ||
| if [[ -z "$COPILOT_GITHUB_TOKEN" ]]; then | ||
| echo "MODELS_TOKEN is empty or unavailable in this run" | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
The validation step will fail the entire workflow if MODELS_TOKEN is not available, which may not be desirable for all scenarios (e.g., forks or runs where Copilot analysis is optional). Consider whether this should be a hard failure or if the workflow should gracefully skip the Copilot analysis when the token is unavailable. If Copilot is optional, consider using continue-on-error: true for this step.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
[Ubuntu] Add Copilot error logs review