MPT-19030 Add helpdesk chat participants service and tests#238
MPT-19030 Add helpdesk chat participants service and tests#238
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a Helpdesk Chat Participants resource (model, sync and async services), wires participants accessors into ChatsService/AsyncChatsService, and adds unit and end-to-end tests with pytest fixtures. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📝 Coding Plan
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
tests/e2e/helpdesk/chats/participants/test_async_participants.py (1)
14-15: Good use of synchronousdeffor fixture-only test; considerlint.externalfor AAA01.Correctly declared as
defrather thanasync defsince there's noawaitstatement—pytest-asyncio resolves async fixtures automatically. However, like the sync file, the# noqa: AAA01directive triggers a Ruff warning (RUF102) becauseAAA01is aflake8-aaarule. Add it tolint.externalinpyproject.tomlif the plugin is active. Based on learnings: tests with async fixtures but no await should be declared as def.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/e2e/helpdesk/chats/participants/test_async_participants.py` around lines 14 - 15, The test function test_create_chat_participant is correctly synchronous (no await) but uses a noqa for the flake8-aaa rule AAA01; update project lint config instead of scattering noqa comments by adding "AAA01" to the lint.external list in pyproject.toml so that the linter ignores this flake8-aaa rule project-wide, leaving the test signature test_create_chat_participant unchanged and removing the inline "# noqa: AAA01" directive.tests/e2e/helpdesk/chats/participants/test_sync_participants.py (1)
14-15: Consider addingAAA01to Ruff'slint.externalconfiguration.The
# noqa: AAA01directive suppresses a rule from theflake8-aaaplugin, but Ruff doesn't recognize it as a valid rule code. To avoid the RUF102 warning, addAAA01to thelint.externallist inpyproject.tomlif this plugin is in use, or remove the comment if it's not needed.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/e2e/helpdesk/chats/participants/test_sync_participants.py` around lines 14 - 15, The test function test_create_chat_participant contains a "# noqa: AAA01" suppression that Ruff doesn't recognize; either add "AAA01" to the lint.external list in pyproject.toml so Ruff accepts this external rule code or remove the comment if flake8-aaa isn't used. Edit pyproject.toml and update the lint.external configuration to include the string "AAA01" (or delete the "# noqa: AAA01" from test_create_chat_participant if the rule suppression is unnecessary).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@tests/e2e/helpdesk/chats/participants/test_async_participants.py`:
- Around line 14-15: The test function test_create_chat_participant is correctly
synchronous (no await) but uses a noqa for the flake8-aaa rule AAA01; update
project lint config instead of scattering noqa comments by adding "AAA01" to the
lint.external list in pyproject.toml so that the linter ignores this flake8-aaa
rule project-wide, leaving the test signature test_create_chat_participant
unchanged and removing the inline "# noqa: AAA01" directive.
In `@tests/e2e/helpdesk/chats/participants/test_sync_participants.py`:
- Around line 14-15: The test function test_create_chat_participant contains a
"# noqa: AAA01" suppression that Ruff doesn't recognize; either add "AAA01" to
the lint.external list in pyproject.toml so Ruff accepts this external rule code
or remove the comment if flake8-aaa isn't used. Edit pyproject.toml and update
the lint.external configuration to include the string "AAA01" (or delete the "#
noqa: AAA01" from test_create_chat_participant if the rule suppression is
unnecessary).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 54084ee1-d6a2-4b89-9175-f034845b0ce2
📒 Files selected for processing (8)
mpt_api_client/resources/helpdesk/chat_participants.pympt_api_client/resources/helpdesk/chats.pytests/e2e/helpdesk/chats/participants/__init__.pytests/e2e/helpdesk/chats/participants/conftest.pytests/e2e/helpdesk/chats/participants/test_async_participants.pytests/e2e/helpdesk/chats/participants/test_sync_participants.pytests/unit/resources/helpdesk/test_chat_participants.pytests/unit/resources/helpdesk/test_chats.py
✅ Files skipped from review due to trivial changes (4)
- tests/e2e/helpdesk/chats/participants/init.py
- tests/unit/resources/helpdesk/test_chat_participants.py
- tests/unit/resources/helpdesk/test_chats.py
- tests/e2e/helpdesk/chats/participants/conftest.py
🚧 Files skipped from review as they are similar to previous changes (2)
- mpt_api_client/resources/helpdesk/chats.py
- mpt_api_client/resources/helpdesk/chat_participants.py
|



Summary
ChatParticipantsServiceandAsyncChatParticipantsServicefor/public/v1/helpdesk/chats/{chat_id}/participantsparticipants(chat_id)into sync and async chat servicesTesting
uv run pytest tests/unit/resources/helpdesk/test_chat_participants.py tests/unit/resources/helpdesk/test_chats.pymake check-allCloses MPT-19030