MPT-19030 Add helpdesk chat participants service and tests#238
MPT-19030 Add helpdesk chat participants service and tests#238
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a Helpdesk Chat Participants resource (model, sync and async services), wires 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. 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
d90c9d0 to
bddc175
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/e2e/helpdesk/chats/participants/test_async_participants.py`:
- Around line 15-16: Move the "# noqa: AAA01" suppression from the function
definition to the decorator line so flake8-aaa applies; update the
`@pytest.mark.skip`(...) line (above test_create_chat_participant) to include the
noqa comment (e.g., "@pytest.mark.skip(reason=..., # noqa: AAA01") ensuring the
suppression is adjacent to the decorator that triggers AAA01.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 98846ec3-9a7f-47a8-81e8-fb9657cb52d5
📒 Files selected for processing (9)
mpt_api_client/resources/helpdesk/chat_participants.pympt_api_client/resources/helpdesk/chats.pypyproject.tomltests/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 (5)
- tests/e2e/helpdesk/chats/participants/init.py
- pyproject.toml
- tests/unit/resources/helpdesk/test_chat_participants.py
- mpt_api_client/resources/helpdesk/chat_participants.py
- tests/e2e/helpdesk/chats/participants/conftest.py
🚧 Files skipped from review as they are similar to previous changes (1)
- tests/unit/resources/helpdesk/test_chats.py
tests/e2e/helpdesk/chats/participants/test_async_participants.py
Outdated
Show resolved
Hide resolved
|



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