Skip to content

MPT-19029 Add helpdesk chat links API services and tests#237

Merged
d3rky merged 1 commit intomainfrom
feat/MPT-19029
Mar 19, 2026
Merged

MPT-19029 Add helpdesk chat links API services and tests#237
d3rky merged 1 commit intomainfrom
feat/MPT-19029

Conversation

@jentyk
Copy link
Member

@jentyk jentyk commented Mar 18, 2026

Summary

  • Implement chat links datapoints for Helpdesk chats:
    • GET/POST /public/v1/helpdesk/chats/{chat_id}/links
    • PUT/DELETE /public/v1/helpdesk/chats/{chat_id}/links/{id}
  • Add sync and async chat_links services and wire nested accessors via chats.links(chat_id)
  • Add unit tests for links service endpoint/mixins and chats-to-links wiring
  • Add e2e test scaffolding for helpdesk chat links (sync and async) following existing chat messages structure

Testing

  • uv run pytest tests/unit/resources/helpdesk/test_chat_links.py tests/unit/resources/helpdesk/test_chats.py
  • make check
  • E2E tests: Not run (not requested)

Closes MPT-19029

Changes

  • Added new ChatLink model and ChatLinksServiceConfig for helpdesk chat links API endpoint /public/v1/helpdesk/chats/{chat_id}/links
  • Implemented ChatLinksService and AsyncChatLinksService with full CRUD operations (Create, Update, Delete, Collection)
  • Added links(chat_id: str) accessor methods to ChatsService and AsyncChatsService for nested access to chat link resources
  • Added comprehensive unit tests for chat links services verifying endpoint paths and available operations
  • Enhanced chat service tests to validate both messages and links property accessors with parameterized test coverage for sync and async variants
  • Added end-to-end test scaffolding with fixtures for chat link operations (create, update, delete, list) in both synchronous and asynchronous variants

@coderabbitai
Copy link

coderabbitai bot commented Mar 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: e2e1733a-29e9-4c1f-a92b-a31ca970025c

📥 Commits

Reviewing files that changed from the base of the PR and between 8743f9d and f9633bd.

📒 Files selected for processing (8)
  • mpt_api_client/resources/helpdesk/chat_links.py
  • mpt_api_client/resources/helpdesk/chats.py
  • tests/e2e/helpdesk/chats/links/__init__.py
  • tests/e2e/helpdesk/chats/links/conftest.py
  • tests/e2e/helpdesk/chats/links/test_async_links.py
  • tests/e2e/helpdesk/chats/links/test_sync_links.py
  • tests/unit/resources/helpdesk/test_chat_links.py
  • tests/unit/resources/helpdesk/test_chats.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/e2e/helpdesk/chats/links/init.py
  • tests/e2e/helpdesk/chats/links/conftest.py

📝 Walkthrough

Walkthrough

Introduces ChatLinks API client support for the Helpdesk service. Adds ChatLink model, configuration, and synchronous and asynchronous service implementations. Extends ChatsService with links() methods for accessing chat link resources. Includes comprehensive unit and end-to-end test coverage.

Changes

Cohort / File(s) Summary
ChatLinks Core Implementation
mpt_api_client/resources/helpdesk/chat_links.py
New module introducing ChatLink model, ChatLinksServiceConfig, and both ChatLinksService (sync) and AsyncChatLinksService (async) with Create, Update, Delete, and Collection mixins for CRUD+collection access.
ChatsService Integration
mpt_api_client/resources/helpdesk/chats.py
Added links() methods to ChatsService and AsyncChatsService to return ChatLinksService and AsyncChatLinksService instances respectively for a given chat_id.
Unit Tests
tests/unit/resources/helpdesk/test_chat_links.py, tests/unit/resources/helpdesk/test_chats.py
New unit tests for ChatLinksService and AsyncChatLinksService verification; refactored existing ChatsService tests to parameterize both messages and links services with endpoint path and method presence checks.
E2E Test Infrastructure
tests/e2e/helpdesk/chats/links/__init__.py, tests/e2e/helpdesk/chats/links/conftest.py
New E2E test package with fixtures for chat_links_service, async_chat_links_service, chat_link_data, created/async_created_chat_link, and invalid_chat_link_id lifecycle management.
E2E Test Cases
tests/e2e/helpdesk/chats/links/test_sync_links.py, tests/e2e/helpdesk/chats/links/test_async_links.py
Comprehensive E2E tests covering list, create, update (title), and delete operations for chat links with not-found error handling for both sync and async variants.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • PR #227: Main PR extending Helpdesk chats functionality by introducing the Chats service types that ChatLinks now builds upon.
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Jira Issue Key In Title ✅ Passed PR title contains exactly one Jira issue key in the format MPT-XXXX: MPT-19029
Test Coverage Required ✅ Passed PR modifies 2 code files and includes 6 test files (unit and e2e tests), meeting the requirement that test files are included.
Single Commit Required ✅ Passed PR contains a single cohesive commit implementing helpdesk chat links functionality with model, service, integration, and comprehensive tests.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

📝 Coding Plan
  • Generate coding plan for human review comments

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

@jentyk jentyk changed the title Add helpdesk chat links API services and tests MPT-19029 Add helpdesk chat links API services and tests Mar 18, 2026
@sonarqubecloud
Copy link

@jentyk jentyk marked this pull request as ready for review March 18, 2026 17:04
@jentyk jentyk requested a review from a team as a code owner March 18, 2026 17:04
@jentyk jentyk requested review from d3rky and ruben-sebrango March 18, 2026 17:04
@d3rky d3rky merged commit ec60985 into main Mar 19, 2026
4 checks passed
@d3rky d3rky deleted the feat/MPT-19029 branch March 19, 2026 09:26
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