Skip to content

Refactor Endpoint Mixins for DRY and SOLID#681

Merged
fderuiter merged 3 commits intomainfrom
refactor/endpoint-mixins-7964313980656361842
Feb 19, 2026
Merged

Refactor Endpoint Mixins for DRY and SOLID#681
fderuiter merged 3 commits intomainfrom
refactor/endpoint-mixins-7964313980656361842

Conversation

@fderuiter
Copy link
Copy Markdown
Owner

This PR refactors the endpoint mixins to adhere to DRY and SOLID principles. It moves the implementation of public list and get methods into the mixins themselves, removing the need for boilerplate code in Generic*Endpoint classes. It also introduces a ClientProvider protocol to make client dependencies explicit. The ListEndpointMixin now uses a shared _prepare_execution method to handle common setup logic for both synchronous and asynchronous operations.


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

- Introduce `ClientProvider` protocol for dependency injection.
- Refactor `ListEndpointMixin` to include `list` and `async_list` methods, reducing boilerplate in concrete classes.
- Extract common setup logic in `ListEndpointMixin` to `_prepare_execution`.
- Refactor `FilterGetEndpointMixin` and `PathGetEndpointMixin` to include `get` and `async_get` methods.
- Simplify `GenericListEndpoint` and related base classes by removing redundant method wrappers.
- Enforce strict typing with `mypy` and verify behavior with `pytest`.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
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 19, 2026 20:42
- Introduce `ClientProvider` protocol for dependency injection.
- Refactor `ListEndpointMixin` to include `list` and `async_list` methods, reducing boilerplate in concrete classes.
- Extract common setup logic in `ListEndpointMixin` to `_prepare_execution`.
- Refactor `FilterGetEndpointMixin` and `PathGetEndpointMixin` to include `get` and `async_get` methods.
- Simplify `GenericListEndpoint` and related base classes by removing redundant method wrappers.
- Enforce strict typing with `mypy` and verify behavior with `pytest`.
- Fix formatting in `list.py` to pass `black` and `isort`.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Introduce `ClientProvider` protocol for dependency injection.
- Refactor `ListEndpointMixin` to include `list` and `async_list` methods, reducing boilerplate in concrete classes.
- Extract common setup logic in `ListEndpointMixin` to `_prepare_execution`.
- Refactor `FilterGetEndpointMixin` and `PathGetEndpointMixin` to include `get` and `async_get` methods.
- Simplify `GenericListEndpoint` and related base classes by removing redundant method wrappers.
- Enforce strict typing with `mypy` and verify behavior with `pytest`.
- Fix formatting in `list.py` to pass `black` and `isort`.
- Fix unused import in `list.py` to pass `ruff`.

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 19, 2026 20:52
@fderuiter fderuiter merged commit 84e8945 into main Feb 19, 2026
13 checks passed
@fderuiter fderuiter deleted the refactor/endpoint-mixins-7964313980656361842 branch February 19, 2026 20:52
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