Skip to content

[tests] Added expiration_date to sample_users#1379

Merged
nemesifier merged 1 commit into
masterfrom
update-migrations-users-expiration-date
May 26, 2026
Merged

[tests] Added expiration_date to sample_users#1379
nemesifier merged 1 commit into
masterfrom
update-migrations-users-expiration-date

Conversation

@nemesifier
Copy link
Copy Markdown
Member

@nemesifier nemesifier self-assigned this May 26, 2026
@nemesifier nemesifier added the testing Issue related to testing or CI label May 26, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 26, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 76d2522a-c7c7-47e2-851f-fd952abed08b

📥 Commits

Reviewing files that changed from the base of the PR and between f85913f and b9c9b04.

📒 Files selected for processing (2)
  • requirements-test.txt
  • tests/openwisp2/sample_users/migrations/0005_user_expiration_date_user_user_active_expiry_idx.py
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: Python==3.11 | django~=4.2.0
  • GitHub Check: Python==3.12 | django~=5.1.0
  • GitHub Check: Python==3.10 | django~=5.1.0
  • GitHub Check: Python==3.11 | django~=5.2.0
  • GitHub Check: Python==3.13 | django~=5.2.0
  • GitHub Check: Python==3.12 | django~=5.2.0
  • GitHub Check: Python==3.13 | django~=5.1.0
  • GitHub Check: Python==3.11 | django~=5.1.0
  • GitHub Check: Python==3.12 | django~=4.2.0
  • GitHub Check: Python==3.10 | django~=4.2.0
  • GitHub Check: Python==3.10 | django~=5.2.0
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{js,ts,tsx,jsx,py,java,go,cs,rb,php,c,cpp,h,hpp}

📄 CodeRabbit inference engine (Custom checks)

**/*.{js,ts,tsx,jsx,py,java,go,cs,rb,php,c,cpp,h,hpp}: Flag potential security vulnerabilities in code
Avoid unnecessary comments or docstrings for code that is already clear
Code formatting is compact and readable. Do not add excessive blank lines, especially inside function or method bodies
Flag unused or redundant code
Ensure variables, functions, classes, and files have descriptive and consistent names
New code must handle errors properly: log errors that cannot be resolved by the user with error level, log unusual conditions with warning level, log important background actions with info level, and provide user-facing messages for errors that the user can solve autonomously

Files:

  • tests/openwisp2/sample_users/migrations/0005_user_expiration_date_user_user_active_expiry_idx.py
**/*.{js,ts,tsx,jsx,py,java,go,cs,rb,php,c,cpp,h,hpp,sql}

📄 CodeRabbit inference engine (Custom checks)

Flag obvious performance regressions, such as heavy loops, repeated I/O, or unoptimized queries

Files:

  • tests/openwisp2/sample_users/migrations/0005_user_expiration_date_user_user_active_expiry_idx.py
**/*.{js,ts,tsx,jsx,py,java,go,cs,rb,php,c,cpp,h,hpp,sh,bash,sql}

📄 CodeRabbit inference engine (Custom checks)

Cryptic or non-obvious code (regex, complex bash commands, or hard-to-read code) must include a concise comment explaining why it is needed and why the complexity is acceptable

Files:

  • tests/openwisp2/sample_users/migrations/0005_user_expiration_date_user_user_active_expiry_idx.py
**/*.{py,html}

📄 CodeRabbit inference engine (Custom checks)

For Django pull requests, ensure all user-facing strings are marked as translatable using the Django i18n framework

Files:

  • tests/openwisp2/sample_users/migrations/0005_user_expiration_date_user_user_active_expiry_idx.py
🧠 Learnings (1)
📚 Learning: 2026-01-15T15:07:17.354Z
Learnt from: DragnEmperor
Repo: openwisp/openwisp-controller PR: 1175
File: openwisp_controller/geo/estimated_location/tests/tests.py:172-175
Timestamp: 2026-01-15T15:07:17.354Z
Learning: In this repository, flake8 enforces E501 (line too long) via setup.cfg (max-line-length = 88) while ruff ignores E501 via ruff.toml. Therefore, use '# noqa: E501' on lines that intentionally exceed 88 characters to satisfy flake8 without affecting ruff checks. This applies to Python files across the project (any .py) and is relevant for tests as well. Use sparingly and only where breaking lines is not feasible without hurting readability or functionality.

Applied to files:

  • tests/openwisp2/sample_users/migrations/0005_user_expiration_date_user_user_active_expiry_idx.py
🔇 Additional comments (2)
tests/openwisp2/sample_users/migrations/0005_user_expiration_date_user_user_active_expiry_idx.py (1)

1-33: LGTM!

requirements-test.txt (1)

7-8: LGTM!


📝 Walkthrough

Walkthrough

This pull request adds a Django migration that adds a nullable DateField expiration_date to the User model and creates a composite index user_active_expiry_idx on (is_active, expiration_date). The migration declares dependencies on auth's 0012_alter_user_first_name_max_length and sample_users's 0004_default_groups.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title uses an invalid type prefix. The required format specifies types: fix, change, feature, qa, ci, chores, docs. The prefix '[tests]' is not in the allowed list. Change the prefix to a valid type. Consider using '[qa]' for test-related changes, as it aligns with quality assurance purposes.
Description check ⚠️ Warning The description is significantly incomplete, missing most required sections including checklist items, manual testing confirmation, and proper structured format. Complete the description template by adding the checklist, confirming manual testing, describing changes in detail, and addressing all required sections.
✅ Passed checks (3 passed)
Check name Status Explanation
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.
Bug Fixes ✅ Passed PR is not a bug fix; it only adds test infrastructure (migration field and test dependency) with no core functionality changes, making the bug fix check inapplicable.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch update-migrations-users-expiration-date

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot Bot commented May 26, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • requirements-test.txt
  • tests/openwisp2/sample_users/migrations/0005_user_expiration_date_user_user_active_expiry_idx.py

Review Notes

Migration file:

  • Adds an expiration_date DateField (nullable, blank) with appropriate help_text
  • Adds a well-named database index user_active_expiry_idx on [is_active, expiration_date]
  • Follows Django migration best practices

requirements-test.txt:

  • Added freezegun>=1.5.5,<1.6.0 dependency for time-based testing
  • Version pinning is appropriate

No critical bugs or security vulnerabilities detected.


Reviewed by kimi-k2.5-0127 · 80,657 tokens

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/openwisp2/sample_users/migrations/0005_user_expiration_date_user_user_active_expiry_idx.py`:
- Line 19: The help_text string in the migration's field definition
(help_text=...) is too long for the repo's 88-char flake8 limit; split it into
shorter pieces by breaking the string across lines using implicit string literal
concatenation or two shorter strings joined with a space inside the same
help_text= argument (in the migration
0005_user_expiration_date_user_user_active_expiry_idx, locate the help_text=
parameter on the user expiration field and split the sentence into two quoted
parts so the line length falls under 88 chars).
🪄 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: ASSERTIVE

Plan: Pro

Run ID: bf343054-4e8a-49b3-b198-94c5b39a9c00

📥 Commits

Reviewing files that changed from the base of the PR and between dc55622 and 019ee25.

📒 Files selected for processing (1)
  • tests/openwisp2/sample_users/migrations/0005_user_expiration_date_user_user_active_expiry_idx.py
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (15)
  • GitHub Check: Python==3.11 | django~=5.2.0
  • GitHub Check: Python==3.12 | django~=5.1.0
  • GitHub Check: Python==3.10 | django~=5.2.0
  • GitHub Check: Python==3.12 | django~=5.2.0
  • GitHub Check: Python==3.12 | django~=4.2.0
  • GitHub Check: Python==3.10 | django~=4.2.0
  • GitHub Check: Python==3.11 | django~=4.2.0
  • GitHub Check: Python==3.13 | django~=5.1.0
  • GitHub Check: Python==3.10 | django~=5.1.0
  • GitHub Check: Python==3.13 | django~=5.2.0
  • GitHub Check: Python==3.11 | django~=5.1.0
  • GitHub Check: Analyze (actions)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (python)
  • GitHub Check: Kilo Code Review
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{js,ts,tsx,jsx,py,java,go,cs,rb,php,c,cpp,h,hpp}

📄 CodeRabbit inference engine (Custom checks)

**/*.{js,ts,tsx,jsx,py,java,go,cs,rb,php,c,cpp,h,hpp}: Flag potential security vulnerabilities in code
Avoid unnecessary comments or docstrings for code that is already clear
Code formatting is compact and readable. Do not add excessive blank lines, especially inside function or method bodies
Flag unused or redundant code
Ensure variables, functions, classes, and files have descriptive and consistent names
New code must handle errors properly: log errors that cannot be resolved by the user with error level, log unusual conditions with warning level, log important background actions with info level, and provide user-facing messages for errors that the user can solve autonomously

Files:

  • tests/openwisp2/sample_users/migrations/0005_user_expiration_date_user_user_active_expiry_idx.py
**/*.{js,ts,tsx,jsx,py,java,go,cs,rb,php,c,cpp,h,hpp,sql}

📄 CodeRabbit inference engine (Custom checks)

Flag obvious performance regressions, such as heavy loops, repeated I/O, or unoptimized queries

Files:

  • tests/openwisp2/sample_users/migrations/0005_user_expiration_date_user_user_active_expiry_idx.py
**/*.{js,ts,tsx,jsx,py,java,go,cs,rb,php,c,cpp,h,hpp,sh,bash,sql}

📄 CodeRabbit inference engine (Custom checks)

Cryptic or non-obvious code (regex, complex bash commands, or hard-to-read code) must include a concise comment explaining why it is needed and why the complexity is acceptable

Files:

  • tests/openwisp2/sample_users/migrations/0005_user_expiration_date_user_user_active_expiry_idx.py
**/*.{py,html}

📄 CodeRabbit inference engine (Custom checks)

For Django pull requests, ensure all user-facing strings are marked as translatable using the Django i18n framework

Files:

  • tests/openwisp2/sample_users/migrations/0005_user_expiration_date_user_user_active_expiry_idx.py
🧠 Learnings (1)
📚 Learning: 2026-01-15T15:07:17.354Z
Learnt from: DragnEmperor
Repo: openwisp/openwisp-controller PR: 1175
File: openwisp_controller/geo/estimated_location/tests/tests.py:172-175
Timestamp: 2026-01-15T15:07:17.354Z
Learning: In this repository, flake8 enforces E501 (line too long) via setup.cfg (max-line-length = 88) while ruff ignores E501 via ruff.toml. Therefore, use '# noqa: E501' on lines that intentionally exceed 88 characters to satisfy flake8 without affecting ruff checks. This applies to Python files across the project (any .py) and is relevant for tests as well. Use sparingly and only where breaking lines is not feasible without hurting readability or functionality.

Applied to files:

  • tests/openwisp2/sample_users/migrations/0005_user_expiration_date_user_user_active_expiry_idx.py

@nemesifier nemesifier force-pushed the update-migrations-users-expiration-date branch from 019ee25 to f85913f Compare May 26, 2026 21:49
coderabbitai[bot]
coderabbitai Bot previously approved these changes May 26, 2026
@nemesifier nemesifier force-pushed the update-migrations-users-expiration-date branch from f85913f to b9c9b04 Compare May 26, 2026 22:10
@nemesifier nemesifier merged commit b5f8cfb into master May 26, 2026
31 of 32 checks passed
@nemesifier nemesifier deleted the update-migrations-users-expiration-date branch May 26, 2026 22:40
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 98.553%. first build — update-migrations-users-expiration-date into master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Issue related to testing or CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants