Skip to content

Conversation

@Groenbech96
Copy link
Contributor

@Groenbech96 Groenbech96 commented Feb 9, 2026

Summary

This PR introduces a new GitHub Copilot Build-Fix Agent that automates the build-fix cycle for BCApps pull requests.

What This Agent Does

  • 🔨 Triggers AL-Go builds using GitHub Actions workflows
  • 🔍 Parses build errors from SARIF logs (supports all AL analyzers)
  • 🔧 Generates fixes for common error types:
    • Syntax errors (AL01xx)
    • Semantic errors (AL02xx, AL03xx)
    • Breaking changes (AL05xx)
    • Code quality violations (AL06xx - CodeCop)
    • UI violations (AL07xx - UICop)
  • 🔄 Iterates up to 3 times until build passes
  • 📊 Reports clear status and remaining errors

How to Use

Invoke from GitHub.com in a PR comment:

@github-copilot build and fix any errors
@github-copilot fix the build errors in this PR

Key Features

Handles Environment Constraints:

  • Agent runs in Linux environment (GitHub Copilot session)
  • BCApps builds require Windows environment (Docker + Business Central)
  • Solution: Agent triggers GitHub Actions workflows and parses results

Comprehensive BCApps Knowledge:

  • AL-Go framework architecture
  • Multi-project build hierarchy (Build1 → Build)
  • Dependency order (System Application → Apps W1)
  • All code analyzers and rule patterns
  • SARIF error log format

Safety First:

  • Pre-flight checks (clean working directory, not on protected branch)
  • Atomic commits after each iteration
  • Rollback strategy if fixes introduce new errors
  • Max 3 iterations to prevent infinite loops
  • Excluded error types requiring human judgment

Files Added

  • .github/agents/BuildFix.agent.md (1,523 lines) - Complete agent definition
  • .github/agents/README.md (428 lines) - Agent framework documentation

Testing Plan

After merge:

  1. Create test PR with intentional AL syntax errors
  2. Invoke agent: @github-copilot build and fix any errors
  3. Verify agent triggers build, parses errors, and applies fixes
  4. Monitor iteration count and success rate

Benefits

  • Faster development - Catch and fix build errors automatically
  • 🚀 Better PR quality - Ensure builds pass before review
  • 📚 Knowledge capture - Embed BCApps build expertise in the agent
  • 🤖 Consistent fixes - Apply best practices automatically

🤖 Generated with Claude Code

Introduces a new GitHub Copilot agent that automates the build-fix cycle for pull requests:
- Triggers AL-Go builds using GitHub Actions workflows
- Parses AL compiler errors from SARIF logs
- Generates fixes for common error types (syntax, semantic, code quality, UI violations)
- Iterates up to 3 times until build passes
- Handles Linux agent environment → Windows build environment constraint

The agent can be invoked from GitHub.com with:
@github-copilot build and fix any errors
@github-copilot fix the build errors in this PR

Files added:
- .github/agents/BuildFix.agent.md (1,523 lines) - Complete agent definition with BCApps build knowledge
- .github/agents/README.md (428 lines) - Documentation for the agent framework

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@Groenbech96 Groenbech96 requested a review from a team as a code owner February 9, 2026 08:38
@github-actions github-actions bot added the Build: Automation Workflows and other setup in .github folder label Feb 9, 2026
@github-actions
Copy link

github-actions bot commented Feb 9, 2026

Could not find a linked ADO work item. Please link one by using the pattern 'AB#' followed by the relevant work item number. You may use the 'Fixes' keyword to automatically resolve the work item when the pull request is merged. E.g. 'Fixes AB#1234'

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build: Automation Workflows and other setup in .github folder

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant