Skip to content

add pasword reset request model#402

Open
rcabrera-py wants to merge 3 commits intomainfrom
feat/add-password-reset-request-model
Open

add pasword reset request model#402
rcabrera-py wants to merge 3 commits intomainfrom
feat/add-password-reset-request-model

Conversation

@rcabrera-py
Copy link
Copy Markdown
Contributor

@rcabrera-py rcabrera-py commented May 6, 2026

Summary by CodeRabbit

  • New Features

    • Added a password reset request type that accepts and validates geographic location data.
  • Tests

    • Added a test verifying serialization of the password reset request with a valid location.
  • Chores

    • Library version bumped to 2.1.31

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 6, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a3c33560-7921-4890-8671-77df751529a0

📥 Commits

Reviewing files that changed from the base of the PR and between 8a4c897 and d790e32.

📒 Files selected for processing (1)
  • cuenca_validations/version.py
✅ Files skipped from review due to trivial changes (1)
  • cuenca_validations/version.py

Walkthrough

Adds a new PasswordResetRequest Pydantic model (BaseRequest subclass) with a location: Coordinate field, re-exports it from cuenca_validations.types, adds a test that validates serialization of location into latitude/longitude, and updates the package version to 2.1.31.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • felipao-mx
  • rogelioLpz
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title contains a typo ('pasword' instead of 'password') and while it refers to the main change, the spelling error makes it unprofessional and potentially confusing. Correct the typo by changing 'pasword' to 'password' so the title reads 'add password reset request model'.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/add-password-reset-request-model

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (29ea0b2) to head (d790e32).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #402   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           16        16           
  Lines         1464      1466    +2     
=========================================
+ Hits          1464      1466    +2     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
cuenca_validations/types/__init__.py 100.00% <ø> (ø)
cuenca_validations/types/requests.py 100.00% <100.00%> (ø)
cuenca_validations/version.py 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 29ea0b2...d790e32. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/test_requests.py`:
- Line 1: Remove the unit tests that assert Pydantic's built-in Coordinate
validation internals: delete the parameter cases named "missing_location" and
"bad_coordinate" from the pytest parametrization (or delete the small test block
that only checks Coordinate validation) in tests/test_requests.py so the suite
no longer contains tests specifically targeting Pydantic's built-in validators;
retain any other assertions that test your own code paths.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 06a0deaf-049c-4ad6-ad0d-90f75b7d257c

📥 Commits

Reviewing files that changed from the base of the PR and between 29ea0b2 and bf18fd6.

📒 Files selected for processing (4)
  • cuenca_validations/types/__init__.py
  • cuenca_validations/types/requests.py
  • cuenca_validations/version.py
  • tests/test_requests.py

Comment thread tests/test_requests.py Outdated
…setRequest, and adjust related tests accordingly
@rcabrera-py rcabrera-py force-pushed the feat/add-password-reset-request-model branch from bf18fd6 to 8a4c897 Compare May 8, 2026 21:59
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
tests/test_requests.py (1)

41-49: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Remove this Coordinate serialization test; it validates library internals, not app logic.

This test asserts pydantic_extra_types.coordinate.Coordinate serialization behavior (latitude/longitude) rather than repository-owned behavior.

Proposed minimal change
-def test_password_reset_request_serializes() -> None:
-    payload: DictStrAny = {'location': (19.432607, -99.133209)}
-    req = PasswordResetRequest.model_validate(payload)
-    assert req.model_dump() == {
-        'location': {
-            'latitude': 19.432607,
-            'longitude': -99.133209,
-        },
-    }
#!/bin/bash
# Verify this suite is not asserting Coordinate internals directly.
rg -n --type=py -C2 "latitude|longitude|PasswordResetRequest\.model_validate\(" tests

As per coding guidelines, "Do not write unit tests specifically for validating the behavior of Pydantic's built-in validators... Remove unnecessary unit tests that only validate built-in Pydantic validation behavior."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/test_requests.py` around lines 41 - 49, Remove or modify the
test_password_reset_request_serializes test so it does not assert
pydantic_extra_types.coordinate.Coordinate internals (latitude/longitude);
instead verify only repository-owned behavior such as that
PasswordResetRequest.model_validate(payload) produces a model with a 'location'
field (or simply remove the test entirely). Locate the test function
test_password_reset_request_serializes and either delete it or change its
assertions to check for presence/type of 'location' on the PasswordResetRequest
instance without asserting specific 'latitude'/'longitude' serialization.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@tests/test_requests.py`:
- Around line 41-49: Remove or modify the test_password_reset_request_serializes
test so it does not assert pydantic_extra_types.coordinate.Coordinate internals
(latitude/longitude); instead verify only repository-owned behavior such as that
PasswordResetRequest.model_validate(payload) produces a model with a 'location'
field (or simply remove the test entirely). Locate the test function
test_password_reset_request_serializes and either delete it or change its
assertions to check for presence/type of 'location' on the PasswordResetRequest
instance without asserting specific 'latitude'/'longitude' serialization.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b6e32058-ee2c-4c86-8b6a-e6d32f891587

📥 Commits

Reviewing files that changed from the base of the PR and between bf18fd6 and 8a4c897.

📒 Files selected for processing (3)
  • cuenca_validations/types/requests.py
  • cuenca_validations/version.py
  • tests/test_requests.py
✅ Files skipped from review due to trivial changes (1)
  • cuenca_validations/version.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • cuenca_validations/types/requests.py

Comment thread cuenca_validations/version.py Outdated
@@ -1 +1 @@
__version__ = '2.1.30'
__version__ = '2.1.31.dev1'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Corrige la versión

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

listo

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