fix: welcome_msg approvers and reviewers duplicate names#857
Conversation
WalkthroughDeduplicated outputs of get_all_pull_request_approvers and get_all_pull_request_reviewers in webhook_server/libs/owners_files_handler.py; added extensive mocking in log API tests to avoid network/SSL and adjusted one test import. No public signatures changed. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–30 minutes Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Report bugs in Issues Welcome! 🎉This pull request will be automatically processed with the following features: 🔄 Automatic Actions
📋 Available CommandsPR Status Management
Review & Approval
Testing & Validation
Container Operations
Cherry-pick Operations
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
webhook_server/tests/test_log_api.py (3)
1167-1171: Use TestClient as a context manager to guarantee lifespan and assert shutdown.Wrapping
TestClientwithwithensures startup/shutdown always run and lets you assert the mockedshutdown()was awaited.- client = TestClient(FASTAPI_APP) - - # Make the request - response = client.get("/logs/api/workflow-steps/test-hook-123") + with TestClient(FASTAPI_APP) as client: + response = client.get("/logs/api/workflow-steps/test-hook-123") + assert mock_instance.shutdown.await_count == 1- client = TestClient(FASTAPI_APP) - - # Make the request - response = client.get("/logs/api/workflow-steps/test-hook-456") + with TestClient(FASTAPI_APP) as client: + response = client.get("/logs/api/workflow-steps/test-hook-456") + assert mock_instance.shutdown.await_count == 1Also applies to: 1215-1219
1120-1120: Remove redundant re-import of AsyncMock/Mock.Already imported at file top (Line 9). Avoid shadowing and repetition.
- from unittest.mock import AsyncMock, Mock
1187-1187: Same redundant re-import; drop it.Reuse the module-level imports.
- from unittest.mock import AsyncMock, Mock
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
webhook_server/libs/owners_files_handler.py(2 hunks)webhook_server/tests/test_log_api.py(7 hunks)webhook_server/tests/test_owners_files_handler.py(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- webhook_server/tests/test_owners_files_handler.py
🚧 Files skipped from review as they are similar to previous changes (1)
- webhook_server/libs/owners_files_handler.py
🧰 Additional context used
🧬 Code graph analysis (1)
webhook_server/tests/test_log_api.py (2)
webhook_server/tests/test_app.py (2)
client(26-28)client(316-317)webhook_server/web/log_viewer.py (1)
LogViewerController(18-902)
🔇 Additional comments (2)
webhook_server/tests/test_log_api.py (2)
6-6: LGTM: env usage requires os import.Used for patch.dict in workflow-steps tests.
840-840: Local import is fine here.Keeps the real implementation isolated to this test and avoids earlier patches leaking in.
|
New container for ghcr.io/myk-org/github-webhook-server:latest published |
Summary by CodeRabbit
Bug Fixes
Tests