Skip to content

fix: parse repository and action from GitHub webhook event#26

Merged
Kavirubc merged 1 commit intomainfrom
bugfix-0.1.0-integration
Feb 4, 2026
Merged

fix: parse repository and action from GitHub webhook event#26
Kavirubc merged 1 commit intomainfrom
bugfix-0.1.0-integration

Conversation

@Kavirubc
Copy link
Copy Markdown
Contributor

@Kavirubc Kavirubc commented Feb 4, 2026

Summary

Fixed critical bug where the bot was skipping all issues with "repository not configured" error when repository lists were populated.

Problem

The process.go command was not parsing the GitHub webhook repository object to extract org/repo values needed for configuration matching. This caused all webhook-triggered issues to be rejected at the gatekeeper stage.

Solution

Added proper extraction from GitHub webhook payload:

  • repository.owner.loginissue.Org
  • repository.nameissue.Repo
  • Top-level action field → issue.EventAction (required for transfer loop prevention)

This enables:

  1. Repository configuration matching to work correctly
  2. Transfer loop prevention to detect transferred events
  3. Proper pipeline processing for all webhooks

Related Fixes

This PR builds on previously merged fixes:

This PR: Repository parsing bug that was blocking those features from working

Testing

go build ./... - PASS
go test ./... - PASS (all tests)
✅ Integration tests verified:

  • Repository matching works
  • Transfer event detection works (action="transferred")
  • Pipeline processes issues correctly

Before/After

Before: All webhook events skipped with "repository not configured"
After: Repository configuration matching works, pipeline processes normally

🤖 Generated with Claude Code

Add proper extraction of org/repo from the repository object in GitHub
webhook events, and parse the event action field. This ensures:
- Repository configuration matching works correctly
- Transfer loop prevention can detect transferred events
- Bot pipeline doesn't skip valid issues due to missing repo info

Fixes issue where bot would skip all issues with 'repository not
configured' error when repository list was populated.
@Kavirubc Kavirubc requested a review from Copilot February 4, 2026 13:39
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

The pull request enhances GitHub webhook payload processing by extracting repository ownership information (Org and Repo) and event action data from the raw GitHub payload, enabling richer event metadata population while maintaining existing fallback mechanisms for event type resolution.

Changes

Cohort / File(s) Summary
GitHub Payload Parsing
cmd/simili/commands/process.go
Adds extraction of repository owner login and repository name from raw GitHub payload, and captures event action field from raw payload data.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 A rabbit hops through payloads bright,
Extracting org and repo with delight,
Actions flow from GitHub's stream,
Enriching data, fulfilling the dream! 🌟

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: parsing repository data and action from GitHub webhook events, which directly addresses the root cause of the bug fix.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bugfix-0.1.0-integration

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes webhook event parsing in the process command so repository configuration matching and transfer-loop prevention can work when processing raw GitHub webhook payloads.

Changes:

  • Extract repository.owner.login into issue.Org
  • Extract repository.name into issue.Repo
  • Extract top-level action into issue.EventAction

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +164 to +184
// Handle repository
if repo, ok := raw["repository"].(map[string]interface{}); ok {
if owner, ok := repo["owner"].(map[string]interface{}); ok {
if login, ok := owner["login"].(string); ok {
issue.Org = login
}
}
if name, ok := repo["name"].(string); ok {
issue.Repo = name
}
}

// Fallback event name from GitHub environment if possible
if issue.EventType == "" {
issue.EventType = os.Getenv("GITHUB_EVENT_NAME")
}

// Handle event action if provided
if action, ok := raw["action"].(string); ok {
issue.EventAction = action
}
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description mentions additional fixes (cross-repo similarity search defaulting to true, markdown table formatting changes) but the diff here only adds parsing for repository.* and action from the webhook payload. Please either update the PR description to match the actual change set, or include the missing commits/files so reviewers can validate those claims.

Copilot uses AI. Check for mistakes.
@Kavirubc Kavirubc merged commit d298c71 into main Feb 4, 2026
10 checks passed
@Kavirubc Kavirubc deleted the bugfix-0.1.0-integration branch February 4, 2026 13:44
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.

2 participants