Conversation
- Introduce `_extract_special_params` hook in `ListGetEndpointMixin`. - Refactor `UsersEndpoint` and `RecordsEndpoint` to use the new hook, removing `_list_impl` overrides. - Refactor `RecordsEndpoint` to share creation logic between sync and async methods via `_prepare_create_request`. - Refactor `JobsEndpoint` to share path building and parsing logic between sync and async methods. - Create `.jules/architect.md` to document architectural decisions. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Introduce `_extract_special_params` hook in `ListGetEndpointMixin`. - Refactor `UsersEndpoint` and `RecordsEndpoint` to use the new hook, removing `_list_impl` overrides. - Refactor `RecordsEndpoint` to share creation logic between sync and async methods via `_prepare_create_request`. - Refactor `JobsEndpoint` to share path building and parsing logic between sync and async methods. - Create `.jules/architect.md` to document architectural decisions. - Remove unused imports in `imednet/endpoints/users.py`. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Introduce `_extract_special_params` hook in `ListGetEndpointMixin`. - Refactor `UsersEndpoint` and `RecordsEndpoint` to use the new hook, removing `_list_impl` overrides. - Refactor `RecordsEndpoint` to share creation logic between sync and async methods via `_prepare_create_request`. - Refactor `JobsEndpoint` to share path building and parsing logic between sync and async methods. - Create `.jules/architect.md` to document architectural decisions. - Remove unused imports in `imednet/endpoints/users.py`. - Upgrade `pip` to `^26.0` in dev dependencies to resolve CVE-2026-1703 flagged by `pip-audit`. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR refactors endpoint classes to improve code organization and reduce duplication by introducing a hook-based approach for special parameter handling and consolidating duplicate logic in sync/async method pairs.
Changes:
- Introduced
_extract_special_paramshook inListGetEndpointMixinto allow subclasses to handle special query parameters without overriding_list_impl - Refactored
UsersEndpointandRecordsEndpointto use the new hook instead of overriding_list_impl - Consolidated duplicate validation and header-building logic in
RecordsEndpointbetween sync and async create methods via_prepare_create_request - Extracted path building and response parsing helper methods in
JobsEndpointto eliminate duplication between sync and async methods - Added pip 26.0 as a dev dependency (unrelated to refactoring changes)
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Added pip 26.0 as a dev dependency |
| poetry.lock | Updated lock file to include pip 26.0 |
| imednet/endpoints/_mixins.py | Added _extract_special_params hook and integrated it into _prepare_list_params |
| imednet/endpoints/users.py | Replaced _list_impl override with _extract_special_params implementation |
| imednet/endpoints/records.py | Replaced _list_impl override with _extract_special_params implementation and consolidated create logic via _prepare_create_request |
| imednet/endpoints/jobs.py | Extracted helper methods to reduce duplication between sync and async methods |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| sphinxcontrib-mermaid = "^0.9.2" | ||
| doc8 = "^2.0.0" | ||
| codespell = "^2.4.1" | ||
| pip = "^26.0" |
There was a problem hiding this comment.
Adding pip as a dev dependency appears unrelated to the stated purpose of this PR (refactoring endpoints). Pip is typically already available in the Python environment and is not usually added as an explicit dependency unless there's a specific tool that requires a particular version. Please clarify the reason for this addition or remove it if it's not needed.
Refactor endpoints to adhere to SOLID principles.
_extract_special_paramshook inListGetEndpointMixin.UsersEndpointandRecordsEndpointto use the new hook, removing_list_imploverrides.RecordsEndpointto share creation logic between sync and async methods via_prepare_create_request.JobsEndpointto share path building and parsing logic between sync and async methods..jules/architect.mdto document architectural decisions.PR created automatically by Jules for task 6900409658252505423 started by @fderuiter