Add parallel PR review processing with queue depth monitoring#4
Merged
Add parallel PR review processing with queue depth monitoring#4
Conversation
Move all custom documentation to docs/rakuten/ for clear separation from upstream docs: - Move architecture docs to docs/rakuten/architecture/ - Add CONCURRENCY_LIMITS.md with analysis of API rate limits and safe concurrency levels for Rakuten CaaS deployment - Add README.md to explain custom vs upstream documentation This organization makes it clear which docs are Rakuten-specific and prevents merge conflicts with upstream changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds concurrent PR review processing capability with semaphore-based queue depth monitoring to handle multiple PRs efficiently while preventing resource exhaustion.
Features
1. Parallel Webhook Endpoint (
/webhook-parallel)asyncio.create_task()for true parallel execution2. Configurable Concurrency Control
3. Queue Depth Monitoring
4. Comment Filtering Enhancement
Changes
Core Implementation
pr_agent/servers/bitbucket_server_webhook.py:
/webhook-parallelendpoint (200+ lines)review_semaphorefor concurrency limitingactive_review_tasksdictionary with async locktests/unittest/test_bitbucket_server_webhook.py:
pyproject.toml:
Logging Fix
log_context["event"]→log_context["webhook_event_type"]event=in loggerBenefits
/webhookendpoint unchangedConfiguration
Enable parallel processing in
.secrets.toml:Testing
✅ Unit tests added: 174 lines of test coverage
Deployment Notes
queue_depthandactive_reviewsmetricsmax_concurrent_reviewsbased on pod resourcesRelated Work
This PR works independently but pairs well with async subprocess improvements (#3) for even better performance on large PRs.
Documentation
See commit messages for detailed implementation notes:
b3a2b338- fix queue logging (queue monitoring implementation)1f726954- only filtering reasonable comments (comment filtering)