Skip to content

MPT-18930 Add helpdesk channel API services and test coverage#248

Merged
jentyk merged 1 commit intomainfrom
feat/MPT-18930
Mar 24, 2026
Merged

MPT-18930 Add helpdesk channel API services and test coverage#248
jentyk merged 1 commit intomainfrom
feat/MPT-18930

Conversation

@jentyk
Copy link
Member

@jentyk jentyk commented Mar 24, 2026

Summary

  • Add Helpdesk.channels and AsyncHelpdesk.channels service accessors
  • Implement channel resource services for /public/v1/helpdesk/channels with create/get/update/delete/list support
  • Implement channel messages services for /public/v1/helpdesk/channels/{channel_id}/messages with collection-only access
  • Add unit tests for new channel services and update helpdesk property tests
  • Add e2e test scaffolding for channels and channel messages, with most stateful scenarios skipped for now

Testing

  • uv run pytest tests/unit/resources/helpdesk/test_helpdesk.py tests/unit/resources/helpdesk/test_channels.py tests/unit/resources/helpdesk/test_channel_messages.py
  • make check-all
  • E2E execution: Not run (not requested)

Closes MPT-18930

Release Notes

  • Added Helpdesk.channels and AsyncHelpdesk.channels service accessors to provide access to channel management functionality
  • Implemented channel resource services for /public/v1/helpdesk/channels with full CRUD operations (create, get, update, delete) and list/iteration support
  • Implemented channel messages collection services for /public/v1/helpdesk/channels/{channel_id}/messages with read-only access (fetch_page, iterate)
  • Added both synchronous and asynchronous variants of all channel service implementations
  • Added Channel model class for channel resource representation
  • Added comprehensive unit tests covering synchronous and asynchronous channel services, channel messages services, and helpdesk integration
  • Added E2E test scaffolding for channels and channel messages with both sync and async variants; most stateful E2E tests are currently skipped pending completion of MPT-19124
  • All tests pass with make check-all

@coderabbitai
Copy link

coderabbitai bot commented Mar 24, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 2256991a-427a-4d5c-a9f5-f9028eac7b7e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)

Comment @coderabbitai help to get the list of available commands and usage tips.

@jentyk jentyk changed the title Add helpdesk channel API services and test coverage MPT-18930 Add helpdesk channel API services and test coverage Mar 24, 2026
@sonarqubecloud
Copy link

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
tests/e2e/helpdesk/channels/test_async_channels.py (1)

51-55: Consider adding match parameter for consistency with sync tests.

The sync counterpart in test_sync_channels.py uses pytest.raises(MPTAPIError) without a match, but test_sync_messages.py uses match=r"404 Not Found". Consider aligning error assertion patterns across all E2E tests for consistency—either all use match or none do.

♻️ Optional: Add match parameter for more specific error validation
 async def test_not_found(async_mpt_ops, invalid_channel_id):
     service = async_mpt_ops.helpdesk.channels
 
-    with pytest.raises(MPTAPIError):
+    with pytest.raises(MPTAPIError, match=r"404"):
         await service.get(invalid_channel_id)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/e2e/helpdesk/channels/test_async_channels.py` around lines 51 - 55,
Update the async test_not_found to assert the specific 404 error string like the
other message tests: when calling service.get(invalid_channel_id) inside
pytest.raises(MPTAPIError) add match=r"404 Not Found" so the test uses a precise
error-match (refer to test_not_found, service.get, and pytest.raises).
🤖 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/channels/test_async_channels.py`:
- Around line 51-55: Update the async test_not_found to assert the specific 404
error string like the other message tests: when calling
service.get(invalid_channel_id) inside pytest.raises(MPTAPIError) add
match=r"404 Not Found" so the test uses a precise error-match (refer to
test_not_found, service.get, and pytest.raises).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: ba54a0a8-41df-43ba-93f8-5553716fd89d

📥 Commits

Reviewing files that changed from the base of the PR and between 676f1c1 and ca33fd5.

📒 Files selected for processing (12)
  • mpt_api_client/resources/helpdesk/channel_messages.py
  • mpt_api_client/resources/helpdesk/channels.py
  • mpt_api_client/resources/helpdesk/helpdesk.py
  • tests/e2e/helpdesk/channels/conftest.py
  • tests/e2e/helpdesk/channels/messages/conftest.py
  • tests/e2e/helpdesk/channels/messages/test_async_messages.py
  • tests/e2e/helpdesk/channels/messages/test_sync_messages.py
  • tests/e2e/helpdesk/channels/test_async_channels.py
  • tests/e2e/helpdesk/channels/test_sync_channels.py
  • tests/unit/resources/helpdesk/test_channel_messages.py
  • tests/unit/resources/helpdesk/test_channels.py
  • tests/unit/resources/helpdesk/test_helpdesk.py

@jentyk jentyk marked this pull request as ready for review March 24, 2026 16:12
@jentyk jentyk requested a review from a team as a code owner March 24, 2026 16:12
@jentyk jentyk requested review from albertsola and svazquezco March 24, 2026 16:12
@jentyk jentyk merged commit 131e924 into main Mar 24, 2026
4 checks passed
@jentyk jentyk deleted the feat/MPT-18930 branch March 24, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants