Skip to content

Enhance UserQuery model with optional ids and is_blocked fields#406

Open
julietteceb16 wants to merge 1 commit into
mainfrom
feat/users-filter-by-ids-and-blocked
Open

Enhance UserQuery model with optional ids and is_blocked fields#406
julietteceb16 wants to merge 1 commit into
mainfrom
feat/users-filter-by-ids-and-blocked

Conversation

@julietteceb16
Copy link
Copy Markdown
Contributor

@julietteceb16 julietteceb16 commented May 29, 2026

Note

Low Risk
Small additive Pydantic query fields and tests in a validations package; no auth or runtime behavior changes beyond new filter parameters.

Overview
Extends UserQuery with optional ids (list of user IDs, capped at MAX_PAGE_SIZE / 100) and is_blocked so list/filter APIs can target multiple users and blocked state. Bumps package version to 2.1.35.dev1.

Adds tests for acceptance, model_dump(exclude_none=True) behavior (including empty ids vs omitted fields), and validation when ids exceeds the limit.

Reviewed by Cursor Bugbot for commit 3eb12ba. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • New Features

    • Enhanced user query functionality with support for filtering users by multiple IDs, including validation constraints to prevent exceeding maximum allowed list sizes.
  • Tests

    • Added comprehensive test coverage for the new IDs field, verifying constraint validation, edge cases, and proper serialization behavior.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

Walkthrough

This PR extends the UserQuery model with an optional ids field that accepts a list of user ID strings for bulk filtering. The field includes max-length validation using the existing MAX_PAGE_SIZE constant. Comprehensive unit tests verify that the new field is serialized correctly, respects validation constraints, handles empty lists, and is excluded from output when unset. The package version is incremented to the development release 2.1.35.dev1.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
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 (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding optional ids and is_blocked fields to the UserQuery model, which is reflected in the code changes across all modified files.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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/users-filter-by-ids-and-blocked

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

@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (bb508a6) to head (3eb12ba).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #406   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           16        16           
  Lines         1474      1476    +2     
=========================================
+ Hits          1474      1476    +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/queries.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 bb508a6...3eb12ba. Read the comment docs.

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

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