Skip to content

Commit 32dbd89

Browse files
konardclaude
andcommitted
Implement GitHub bot as a bug solver (#80)
This commit adds a comprehensive bug solver feature to the GitHub bot that can automatically analyze bug reports with unit tests and provide fix recommendations. ## Key Features Implemented: ### BugSolverTrigger - Automatically detects bug reports by analyzing issue titles and descriptions - Identifies issues containing unit tests and expected behavior descriptions - Parses test cases from code blocks in issue comments - Generates comprehensive analysis reports with fix recommendations ### RepositorySearchService - Searches repositories for relevant source files based on function names from tests - Supports multiple programming languages (C#, Python, JavaScript, Java, etc.) - Uses language-specific patterns to find function definitions - Provides keyword-based search for broader code analysis ### TestExecutionService - Detects test frameworks in repositories (dotnet, pytest, npm, maven, gradle, cargo, go) - Generates automated testing instructions for bug verification - Provides setup and execution commands for different project types - Includes both automated and manual testing workflows ## Implementation Details: - Integrated into main Program.cs as a new trigger in IssueTracker - Follows existing trigger pattern with Condition() and Action() methods - Provides detailed analysis including: - Extracted test cases - Expected vs actual behavior - Potentially relevant source files - Fix location suggestions - Test execution instructions ## Examples and Documentation: - Added comprehensive examples showing expected bot behavior - Includes sample bug reports and expected responses - Provides documentation for integration and usage The bot can now process issues like "Bug in calculateTotal function" with unit tests and automatically provide developers with actionable debugging guidance and testing instructions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 540c744 commit 32dbd89

File tree

7 files changed

+1481
-1
lines changed

7 files changed

+1481
-1
lines changed

csharp/Platform.Bot/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private static async Task<int> Main(string[] args)
9595
var dbContext = new FileStorage(databaseFilePath?.FullName ?? new TemporaryFile().Filename);
9696
Console.WriteLine($"Bot has been started. {Environment.NewLine}Press CTRL+C to close");
9797
var githubStorage = new GitHubStorage(githubUserName, githubApiToken, githubApplicationName);
98-
var issueTracker = new IssueTracker(githubStorage, new HelloWorldTrigger(githubStorage, dbContext, fileSetName), new OrganizationLastMonthActivityTrigger(githubStorage), new LastCommitActivityTrigger(githubStorage), new AdminAuthorIssueTriggerDecorator(new ProtectDefaultBranchTrigger(githubStorage), githubStorage), new AdminAuthorIssueTriggerDecorator(new ChangeOrganizationRepositoriesDefaultBranchTrigger(githubStorage, dbContext), githubStorage), new AdminAuthorIssueTriggerDecorator(new ChangeOrganizationPullRequestsBaseBranchTrigger(githubStorage, dbContext), githubStorage));
98+
var issueTracker = new IssueTracker(githubStorage, new HelloWorldTrigger(githubStorage, dbContext, fileSetName), new BugSolverTrigger(githubStorage, dbContext), new OrganizationLastMonthActivityTrigger(githubStorage), new LastCommitActivityTrigger(githubStorage), new AdminAuthorIssueTriggerDecorator(new ProtectDefaultBranchTrigger(githubStorage), githubStorage), new AdminAuthorIssueTriggerDecorator(new ChangeOrganizationRepositoriesDefaultBranchTrigger(githubStorage, dbContext), githubStorage), new AdminAuthorIssueTriggerDecorator(new ChangeOrganizationPullRequestsBaseBranchTrigger(githubStorage, dbContext), githubStorage));
9999
var pullRequenstTracker = new PullRequestTracker(githubStorage, new MergeDependabotBumpsTrigger(githubStorage));
100100
var timestampTracker = new DateTimeTracker(githubStorage, new CreateAndSaveOrganizationRepositoriesMigrationTrigger(githubStorage, dbContext, Path.Combine(Directory.GetCurrentDirectory(), "/github-migrations")));
101101
var cancellation = new CancellationTokenSource();

0 commit comments

Comments
 (0)