Skip to content

Conversation

@fderuiter
Copy link
Owner

Refactor JobsEndpoint and mixins.py to enforce SOLID principles and remove duplication.

Changes:

  • Extracted ListEndpoint from ListGetEndpoint in imednet/core/endpoint/mixins.py. This new class encapsulates list functionality and allows configuring the paginator class via PAGINATOR_CLS and ASYNC_PAGINATOR_CLS class attributes.
  • Updated ListGetEndpoint to inherit from ListEndpoint, maintaining backward compatibility for existing endpoints.
  • Updated JobsEndpoint in imednet/endpoints/jobs.py to inherit from ListEndpoint and PathGetEndpointMixin. This removed the manual implementation of list and async_list, delegating to ListEndpoint while overriding the paginator class to JsonListPaginator.
  • Updated tests/conftest.py to patch ListEndpoint.PAGINATOR_CLS and ASYNC_PAGINATOR_CLS in paginator_factory and async_paginator_factory fixtures, ensuring tests continue to mock paginators correctly.

Verification:

  • Verified behavior with a reproduction script (reproduce_jobs.py) ensuring JobsEndpoint still works correctly for both list and get operations (sync and async).
  • Ran existing unit tests tests/unit/endpoints/test_list_get.py and full test suite to ensure no regressions.

PR created automatically by Jules for task 9819530189907088638 started by @fderuiter

- Extracted `ListEndpoint` from `ListGetEndpoint` in `imednet/core/endpoint/mixins.py` to allow endpoints to reuse list logic without get logic.
- Updated `ListGetEndpoint` to inherit from `ListEndpoint`.
- Updated `JobsEndpoint` to inherit from `ListEndpoint` and `PathGetEndpointMixin`, removing redundant `list` and `async_list` implementations.
- Updated `tests/conftest.py` to correctly patch `ListEndpoint.PAGINATOR_CLS` and `ASYNC_PAGINATOR_CLS` to fix tests relying on `paginator_factory`.
- Verified changes with `reproduce_jobs.py` and existing test suite.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

fderuiter and others added 2 commits February 10, 2026 20:35
- Applied black and isort formatting to tests/conftest.py to fix CI failure.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Removed unused `List` import from `imednet/endpoints/jobs.py` to fix `ruff` linting failure.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@fderuiter fderuiter marked this pull request as ready for review February 10, 2026 20:49
@fderuiter fderuiter merged commit edf2172 into main Feb 10, 2026
13 checks passed
@fderuiter fderuiter deleted the refactor/jobs-endpoint-list-endpoint-9819530189907088638 branch February 10, 2026 20:50
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.

1 participant