Skip to content

Rename field#398

Merged
rogelioLpz merged 1 commit intomainfrom
name-field
Mar 10, 2026
Merged

Rename field#398
rogelioLpz merged 1 commit intomainfrom
name-field

Conversation

@rogelioLpz
Copy link
Member

@rogelioLpz rogelioLpz commented Mar 10, 2026

Summary by CodeRabbit

Release Notes - Version 2.1.27

  • Breaking Changes

    • Updated field naming in user account request parameters. Applications currently using user account management features will require code modifications to maintain compatibility with this version.
  • Version Update

    • Released version 2.1.27

@rogelioLpz rogelioLpz requested a review from gmorales96 March 10, 2026 00:49
@rogelioLpz rogelioLpz self-assigned this Mar 10, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 10, 2026

Walkthrough

This pull request renames the public field is_inactive to is_dormant in the UserUpdateRequest class within cuenca_validations/types/requests.py, while maintaining the same type signature and default value. The module version is simultaneously bumped from 2.1.26 to 2.1.27. No validation logic or behavioral changes are introduced.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • User status flags #396: Adds the is_inactive field to UserUpdateRequest, which is the field being renamed in this PR to is_dormant.

Suggested reviewers

  • gmorales96
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Rename field' is vague and does not specify which field is being renamed or provide context about the change. Consider revising the title to be more specific, such as 'Rename is_inactive to is_dormant in UserUpdateRequest' to clearly identify what is being changed.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch name-field

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

Copy link
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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
cuenca_validations/types/requests.py (1)

107-108: ⚠️ Potential issue | 🟠 Major

Add validation_alias to accept both is_dormant and is_inactive for backward compatibility.

UserUpdateRequest inherits extra="forbid" from BaseRequest, so this rename will reject existing payloads sending is_inactive. Use Pydantic's validation_alias with AliasChoices to accept both field names during deserialization while serializing only is_dormant.

♻️ Suggested compatibility shim
from pydantic import (
+    AliasChoices,
     BaseModel,
     ConfigDict,
     EmailStr,
     Field,
-    is_dormant: Optional[bool] = None
+    is_dormant: Optional[bool] = Field(
+        default=None,
+        validation_alias=AliasChoices('is_dormant', 'is_inactive'),
+    )
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cuenca_validations/types/requests.py` around lines 107 - 108, BaseRequest
currently forbids unknown fields so renamed fields like is_dormant break
existing payloads using is_inactive; add a validation alias mapping so
deserialization accepts the old name while serialization keeps is_dormant.
Update BaseRequest.model_config (ConfigDict) to include validation_alias using
AliasChoices mapping is_dormant -> ["is_inactive"] (so UserUpdateRequest and
other subclasses accept either input name) and keep extra="forbid". Reference
BaseRequest, model_config, ConfigDict, validation_alias and AliasChoices when
making the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@cuenca_validations/types/requests.py`:
- Around line 107-108: BaseRequest currently forbids unknown fields so renamed
fields like is_dormant break existing payloads using is_inactive; add a
validation alias mapping so deserialization accepts the old name while
serialization keeps is_dormant. Update BaseRequest.model_config (ConfigDict) to
include validation_alias using AliasChoices mapping is_dormant ->
["is_inactive"] (so UserUpdateRequest and other subclasses accept either input
name) and keep extra="forbid". Reference BaseRequest, model_config, ConfigDict,
validation_alias and AliasChoices when making the change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0625c1c4-c868-474e-9c80-ca91424854b2

📥 Commits

Reviewing files that changed from the base of the PR and between 73e40a3 and e675b92.

📒 Files selected for processing (2)
  • cuenca_validations/types/requests.py
  • cuenca_validations/version.py

@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (73e40a3) to head (e675b92).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #398   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           16        16           
  Lines         1422      1422           
=========================================
  Hits          1422      1422           
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/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 73e40a3...e675b92. Read the comment docs.

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

@rogelioLpz rogelioLpz merged commit 3b30a0c into main Mar 10, 2026
21 checks passed
@rogelioLpz rogelioLpz deleted the name-field branch March 10, 2026 01:11
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