Skip to content

feat: Add extensive debug logging for better traceability#808

Merged
myakove merged 2 commits intomainfrom
debug-logs
Jun 21, 2025
Merged

feat: Add extensive debug logging for better traceability#808
myakove merged 2 commits intomainfrom
debug-logs

Conversation

@myakove
Copy link
Copy Markdown
Collaborator

@myakove myakove commented Jun 21, 2025

This commit introduces detailed debug logging across multiple handlers to improve the observability and traceability of the webhook server's operations.
Enhanced logging has been added to the following modules:
check_run_handler: More visibility into check run status changes and conditions.
issue_comment_handler: Detailed logging for user command processing.
labels_handler: Tracing for label creation, deletion, and management logic.
owners_files_handler: Logging for owners file parsing and permission checks.
pull_request_handler: Added debug logs to better understand the merge logic flow.
pull_request_review_handler: Logging for pull request review events.
push_handler: More visibility into push event processing and PyPI deployment flow.
runner_handler: Logging for command execution within the runner.
Additionally, this commit removes an unused and failing test for a non-existent retest-and-merge command, ensuring the test suite remains clean and relevant.

Summary by CodeRabbit

  • New Features

    • Added extensive debug-level logging throughout various handler modules to improve traceability and observability of operations such as pull request handling, label management, owner file processing, and webhook events.
  • Tests

    • Updated a test to allow for multiple debug log calls, improving compatibility with enhanced logging.

These changes do not affect existing functionality or workflows.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 21, 2025

Warning

Rate limit exceeded

@myakove-bot has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 17 minutes and 33 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 06afcc6 and 7e80ddd.

📒 Files selected for processing (9)
  • webhook_server/libs/check_run_handler.py (9 hunks)
  • webhook_server/libs/issue_comment_handler.py (10 hunks)
  • webhook_server/libs/labels_handler.py (9 hunks)
  • webhook_server/libs/owners_files_handler.py (11 hunks)
  • webhook_server/libs/pull_request_handler.py (14 hunks)
  • webhook_server/libs/pull_request_review_handler.py (3 hunks)
  • webhook_server/libs/push_handler.py (3 hunks)
  • webhook_server/libs/runner_handler.py (5 hunks)
  • webhook_server/tests/test_check_run_handler.py (1 hunks)

Walkthrough

This update introduces extensive debug-level logging across multiple handler classes in the webhook server codebase. The changes add detailed runtime logs to methods handling check runs, issue comments, labels, owners files, pull requests, reviews, pushes, and runner operations. One method signature is updated to include an optional parameter. No core logic or control flow is altered.

Changes

Files / Areas Change Summary
webhook_server/libs/check_run_handler.py Added debug logging throughout CheckRunHandler methods for check skipping, status setting, in-progress detection, and required check filtering.
webhook_server/libs/issue_comment_handler.py Added extensive debug logging throughout IssueCommentHandler; updated process_retest_command signature to add an automerge parameter with related label logic.
webhook_server/libs/labels_handler.py Inserted debug logs in label management methods to trace additions, removals, waiting, size calculation, and reviewer label management.
webhook_server/libs/owners_files_handler.py Added debug logging in methods for listing changed files, collecting approvers/reviewers, owners data computation, user command validation, and maintainers listing.
webhook_server/libs/pull_request_handler.py Introduced debug logs in pull request webhook processing, label actions, merge checks, approval checks, and automerge logic.
webhook_server/libs/pull_request_review_handler.py Added debug logs on handler initialization and during review processing for user, state, and body content.
webhook_server/libs/push_handler.py Added debug logs for tag extraction, repository directory preparation, and PyPI upload command execution.
webhook_server/libs/runner_handler.py Added debug logs for git command execution, tox command construction, podman build, title checks, and cherry-pick operation commands.
webhook_server/tests/test_check_run_handler.py Relaxed assertion on mock logger debug method from assert_called_once() to assert_called().

Possibly related PRs

  • myk-org/github-webhook-server#711: Adds debug logging to CheckRunHandler methods for check-run failure evaluation, related to enhanced observability in this PR.
  • myk-org/github-webhook-server#804: Adds tests for CheckRunHandler and related components, complementing logging improvements here with additional test coverage.
  • myk-org/github-webhook-server#586: Modifies set_pull_request_automerge logic in github_api.py, related to auto-merge handling also logged in this PR’s pull_request_handler.py.

Suggested labels

size/XXL

Suggested reviewers

  • rnetser
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@myakove-bot
Copy link
Copy Markdown
Collaborator

Report bugs in Issues

Welcome! 🎉

This pull request will be automatically processed with the following features:

🔄 Automatic Actions

  • Reviewer Assignment: Reviewers are automatically assigned based on the OWNERS file in the repository root
  • Size Labeling: PR size labels (XS, S, M, L, XL, XXL) are automatically applied based on changes
  • Issue Creation: A tracking issue is created for this PR and will be closed when the PR is merged or closed
  • Pre-commit Checks: pre-commit runs automatically if .pre-commit-config.yaml exists
  • Branch Labeling: Branch-specific labels are applied to track the target branch
  • Auto-verification: Auto-verified users have their PRs automatically marked as verified

📋 Available Commands

PR Status Management

  • /wip - Mark PR as work in progress (adds WIP: prefix to title)
  • /wip cancel - Remove work in progress status
  • /hold - Block PR merging (approvers only)
  • /hold cancel - Unblock PR merging
  • /verified - Mark PR as verified
  • /verified cancel - Remove verification status

Review & Approval

  • /lgtm - Approve changes (looks good to me)
  • /approve - Approve PR (approvers only)
  • /assign-reviewers - Assign reviewers based on OWNERS file
  • /assign-reviewer @username - Assign specific reviewer
  • /check-can-merge - Check if PR meets merge requirements

Testing & Validation

  • /retest tox - Run Python test suite with tox
  • /retest build-container - Rebuild and test container image
  • /retest python-module-install - Test Python package installation
  • /retest pre-commit - Run pre-commit hooks and checks
  • /retest conventional-title - Validate commit message format
  • /retest all - Run all available tests

Container Operations

  • /build-and-push-container - Build and push container image (tagged with PR number)
    • Supports additional build arguments: /build-and-push-container --build-arg KEY=value

Cherry-pick Operations

  • /cherry-pick <branch> - Schedule cherry-pick to target branch when PR is merged
    • Multiple branches: /cherry-pick branch1 branch2 branch3

Label Management

  • /<label-name> - Add a label to the PR
  • /<label-name> cancel - Remove a label from the PR

✅ Merge Requirements

This PR will be automatically approved when the following conditions are met:

  1. Approval: /approve from at least one approver
  2. LGTM Count: Minimum 1 /lgtm from reviewers
  3. Status Checks: All required status checks must pass
  4. No Blockers: No WIP, hold, or conflict labels
  5. Verified: PR must be marked as verified (if verification is enabled)

📊 Review Process

Approvers and Reviewers

Approvers:

Reviewers:

Available Labels
  • hold
  • verified
  • wip
  • lgtm
  • approve

💡 Tips

  • WIP Status: Use /wip when your PR is not ready for review
  • Verification: The verified label is automatically removed on each new commit
  • Cherry-picking: Cherry-pick labels are processed when the PR is merged
  • Container Builds: Container images are automatically tagged with the PR number
  • Permission Levels: Some commands require approver permissions
  • Auto-verified Users: Certain users have automatic verification and merge privileges

For more information, please refer to the project documentation or contact the maintainers.

@myakove
Copy link
Copy Markdown
Collaborator Author

myakove commented Jun 21, 2025

/verified

@myakove myakove merged commit cd91678 into main Jun 21, 2025
8 of 9 checks passed
@myakove myakove deleted the debug-logs branch June 21, 2025 16:03
@myakove-bot
Copy link
Copy Markdown
Collaborator

New container for ghcr.io/myk-org/github-webhook-server:latest published

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants