Skip to content

Conversation

@konard
Copy link
Member

@konard konard commented Sep 13, 2025

Summary

This PR implements the GoogleSearchErrorTrigger that automatically detects gist.github.com and pastebin.com URLs in GitHub issues, extracts error messages from their content, and provides Google search links to whitelisted websites for potential solutions.

Key Features

URL Detection: Automatically detects gist.github.com and pastebin.com URLs in issue titles and body content
Error Extraction: Identifies various error patterns including:

  • Exception types (NullReferenceException, TypeError, etc.)
  • Compilation errors (error CS1234, error C2065)
  • Runtime errors (Uncaught Exception)
  • HTTP errors (404 Not Found, 500 Internal Server Error)
  • Build failures (Build FAILED)
  • Database errors (SQL error)
    Smart Search: Creates targeted Google search queries with site-specific filters
    Whitelist Protection: Only provides search links to trusted domains:
  • stackoverflow.com
  • github.com
  • docs.microsoft.com
  • developer.mozilla.org
  • msdn.microsoft.com
  • programmingpedia.com
  • geeksforgeeks.org

Implementation Details

  • GoogleSearchErrorTrigger: New trigger class implementing ITrigger
  • Integration: Added to the main IssueTracker in Program.cs
  • Error Patterns: Comprehensive regex patterns for detecting various error types
  • Content Fetching: HTTP client to retrieve raw content from gist/pastebin URLs
  • Response Generation: Helpful bot comments with search links

Files Added

  • csharp/Platform.Bot/Triggers/GoogleSearchErrorTrigger.cs - Main implementation
  • csharp/Platform.Bot.Tests/GoogleSearchErrorTriggerTests.cs - Unit tests
  • examples/test-gist-error.md - Example with gist URL
  • examples/test-pastebin-error.md - Example with pastebin URL

Testing

  • ✅ Build successful with no compilation errors
  • ✅ Unit tests pass (2/2 tests passing)
  • ✅ Integration with existing triggers verified

Test plan

  • Verify the bot can detect gist.github.com URLs in issues
  • Verify the bot can detect pastebin.com URLs in issues
  • Test error message extraction from various content types
  • Confirm whitelist filtering works correctly
  • Validate search link generation
  • Run unit tests to ensure functionality
  • Manual testing with real gist/pastebin URLs (requires deployed bot)

🤖 Generated with Claude Code


Resolves #65

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #65
@konard konard self-assigned this Sep 13, 2025
Add functionality to detect gist.github.com and pastebin.com URLs in GitHub issues,
extract error messages from their content, and provide Google search links to
whitelisted sites for potential solutions.

Features:
- Detects gist and pastebin URLs in issue titles and bodies
- Extracts various error patterns (exceptions, compilation errors, runtime errors)
- Searches Google with site-specific filters for whitelisted domains
- Provides helpful search links in issue comments
- Includes basic unit tests and example documentation

Whitelisted domains: stackoverflow.com, github.com, docs.microsoft.com,
developer.mozilla.org, msdn.microsoft.com, programmingpedia.com, geeksforgeeks.org

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] Search errors from gist.github.com on google Implement GoogleSearchErrorTrigger to search errors from gist/pastebin URLs Sep 13, 2025
@konard konard marked this pull request as ready for review September 13, 2025 21:05
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.

Search errors from gist.github.com on google

2 participants