Skip to content

ERA-12654: add get_event() single-event detail to sync and async clients#26

Open
JoshuaVulcan wants to merge 6 commits intomainfrom
ERA-12654/sync-get-event
Open

ERA-12654: add get_event() single-event detail to sync and async clients#26
JoshuaVulcan wants to merge 6 commits intomainfrom
ERA-12654/sync-get-event

Conversation

@JoshuaVulcan
Copy link
Copy Markdown
Contributor

@JoshuaVulcan JoshuaVulcan commented Feb 10, 2026

Summary

  • Adds get_event(event_id) method to ERClient (sync) for retrieving a single event by ID via activity/event/{id} GET endpoint
  • Adds matching get_event(event_id) to AsyncERClient for sync/async parity
  • Supports query params: include_details, include_updates, include_notes, include_related_events, include_files
  • Establishes tests/sync_client/ directory with conftest fixtures for future sync client tests

Jira

ERA-12654

Test Plan

  • 10 sync client tests covering: basic retrieval, default params, all include flags, notes, 404/401/403 error handling, URL construction
  • 7 async client tests mirroring the same scenarios using respx mocking
  • All 107 tests pass (90 existing + 17 new)
  • Manual verification against a live ER instance (optional, not required for this scope)

Merge order

Merge after PR #23 (API versioning support) is merged. This PR aligns with PR #23's get_event(*, event_id, ...) signature; merging #23 first avoids conflicts and keeps versioned URL behavior consistent.

Add get_event(event_id) method to both ERClient (sync) and AsyncERClient
that hits the activity/event/{id} GET endpoint. Supports query params:
include_details, include_updates, include_notes, include_related_events,
and include_files.

Includes comprehensive test coverage:
- 10 sync tests (basic retrieval, default params, all includes, notes,
  404/401/403 error handling, URL construction)
- 7 async tests mirroring the same scenarios using respx mocking

Also establishes tests/sync_client/ test directory with conftest fixtures.

Co-authored-by: Cursor <cursoragent@cursor.com>
@JoshuaVulcan JoshuaVulcan added autoreviewing PR is currently being auto-reviewed and removed autoreviewing PR is currently being auto-reviewed labels Feb 11, 2026
- get_event(*, event_id, ...) in sync and async clients
- Update all test call sites to use event_id= keyword
- Aligns with style guide (PR #23) for merge compatibility

Co-authored-by: Cursor <cursoragent@cursor.com>
JoshuaVulcan and others added 3 commits February 11, 2026 10:54
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@JoshuaVulcan JoshuaVulcan requested a review from a team as a code owner February 12, 2026 01:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds single-event retrieval support (get_event(event_id, ...)) to both the sync and async ER clients, along with new test coverage to ensure parity and correct query param behavior.

Changes:

  • Add ERClient.get_event(...) to retrieve a single event via GET activity/event/{id} with include-* query params.
  • Add AsyncERClient.get_event(...) with matching behavior for async usage.
  • Add/expand sync + async tests covering success, include flags, and error handling (401/403/404).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.

File Description
erclient/client.py Introduces/relocates get_event() for both sync and async clients, wiring include flags into _get(...).
tests/sync_client/test_get_event.py Reworks sync get_event tests to cover defaults, include flags, and common error responses.
tests/async_client/test_get_event.py Adds async get_event tests using respx mocking for success and error scenarios.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +141 to +143
async with respx.mock(
base_url=er_client.service_root, assert_all_called=False
) as respx_mock:
Comment on lines +162 to +164
async with respx.mock(
base_url=er_client.service_root, assert_all_called=False
) as respx_mock:
@@ -4,69 +4,175 @@
import pytest

from erclient.client import ERClient
Comment on lines +11 to +16
async with respx.mock(
base_url=er_client.service_root, assert_all_called=False
) as respx_mock:
route = respx_mock.get(f'activity/event/{event_id}')
route.return_value = httpx.Response(
httpx.codes.OK,
Comment on lines +34 to +36
async with respx.mock(
base_url=er_client.service_root, assert_all_called=False
) as respx_mock:
Comment on lines +69 to +71
async with respx.mock(
base_url=er_client.service_root, assert_all_called=False
) as respx_mock:
Comment on lines +95 to +97
async with respx.mock(
base_url=er_client.service_root, assert_all_called=False
) as respx_mock:
Comment on lines +118 to +120
async with respx.mock(
base_url=er_client.service_root, assert_all_called=False
) as respx_mock:
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