Skip to content

🧹 Refactor add_trusted_user to use TrustedUserData dataclass - #30

Merged
rezhajulio merged 1 commit into
mainfrom
code-health-add-trusted-user-params-1746589283035311618
Sep 12, 2026
Merged

rezhajulio merged 1 commit into
mainfrom
code-health-add-trusted-user-params-1746589283035311618

Conversation

@rezhajulio

Copy link
Copy Markdown
Owner

🎯 What: Replaced the 8 keyword arguments in add_trusted_user with a single TrustedUserData dataclass object.
💡 Why: Having too many arguments affects code readability, makes changes error-prone, and violates clean code principles. Moving to a dataclass preserves type hints while encapsulating data effectively.
Verification: Verified by running pytest tests/ (all passed), ruff check, and mypy src/.
Result: Improved maintainability and shorter method signature.


PR created automatically by Jules for task 1746589283035311618 started by @rezhajulio

@google-labs-jules

Copy link
Copy Markdown

👋 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.

@rezhajulio

Copy link
Copy Markdown
Owner Author

Rebase from main and add mypy cache into gitignore

@google-labs-jules

Copy link
Copy Markdown

Rebase from main and add mypy cache into gitignore

I have rebased from main, resolved all conflicts, re-applied the TrustedUserData dataclass changes, and added .mypy_cache/ to .gitignore as requested.

Groups the eight parameters of add_trusted_user into a TrustedUserData
Pydantic BaseModel and updates the trust handler and tests to build it.
Matches the CaptchaData DTO already used by add_pending_captcha.

Drops the committed .mypy_cache artifacts and ignores .mypy_cache,
.ruff_cache, and .hypothesis so tool caches stay out of the tree.
@rezhajulio
rezhajulio force-pushed the code-health-add-trusted-user-params-1746589283035311618 branch from a692136 to ed07cfd Compare September 11, 2026 23:58
@rezhajulio
rezhajulio merged commit 6d670b4 into main Sep 12, 2026
5 checks passed
@rezhajulio
rezhajulio deleted the code-health-add-trusted-user-params-1746589283035311618 branch September 12, 2026 00:01
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