Skip to content

[change] Added IP address search to DeviceAdmin - #1494

Merged
nemesifier merged 1 commit into
masterfrom
device-ip-admin-search
Sep 25, 2026
Merged

nemesifier merged 1 commit into
masterfrom
device-ip-admin-search

Conversation

@nemesifier

@nemesifier nemesifier commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Checklist

Reference to Existing Issue

N/A

Description of Changes

Adds DeviceAdmin search support for last_ip and management_ip.

Extends the existing admin search test with separate subtests for both IP fields.

Documents the supported IP address searches in the device-list settings documentation.

Screenshot

N/A

Enabled searches by last and management IP addresses.

[backport 1.3]
@nemesifier nemesifier self-assigned this Sep 25, 2026
@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: a98b8c02-5273-471e-9ada-4e561038bb6f

📥 Commits

Reviewing files that changed from the base of the PR and between d2ed268 and 39b0ef5.

📒 Files selected for processing (1)
  • openwisp_controller/config/tests/test_admin.py
 _______________________________________
< We're gonna need a bigger bug zapper. >
 ---------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: d777ef3a-4d3c-4b42-82ae-4e8adccd0d64

📥 Commits

Reviewing files that changed from the base of the PR and between 39b0ef5 and d2ed268.

📒 Files selected for processing (1)
  • docs/user/settings.rst

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (12)
  • GitHub Check: Python==3.13 | django~=5.2.0
  • GitHub Check: Python==3.12 | django~=5.2.0
  • GitHub Check: Python==3.11 | django~=5.2.0
  • GitHub Check: Python==3.13 | django~=5.1.0
  • GitHub Check: Python==3.10 | django~=5.2.0
  • GitHub Check: Python==3.10 | django~=5.1.0
  • GitHub Check: Python==3.12 | django~=5.1.0
  • GitHub Check: Python==3.11 | django~=5.1.0
  • GitHub Check: publiccode_yml_validation
  • GitHub Check: Analyze (actions)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (python)
🧰 Additional context used
📓 Path-based instructions (3)
Verify that documentation remains consistent with the implemented behavior and does not reference deprecated or removed functionality.

⚙️ CodeRabbit configuration file

Files:

  • docs/user/settings.rst
Flag potential security vulnerabilities Flag obvious performance regressions, such as heavy loops, repeated I/O, or unoptimized queries Flag unused or redundant code Flag outdated or incorrect comments/docstrings Ensure new code handles err...

⚙️ CodeRabbit configuration file

Files:

  • docs/user/settings.rst
Update docs when behavior, settings, public APIs, setup steps, or supported versions change, including when a documented feature's behavior changes or a new user-facing feature is added.

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • docs/user/settings.rst
🔇 Additional comments (1)
docs/user/settings.rst (1)

385-386: LGTM!


📝 Walkthrough

Walkthrough

Device admin search now includes last_ip and management_ip. The test checks that searching by each IP address finds the device and retains the UUID and no-match checks. The documentation lists both IP fields as supported search values.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to d2ed2

The change adds and documents search by both device IP addresses, with tests for each. No material merge-blocking risk is identified.

Architecture Summary

Architecture risk: 🔵 Low · up to d2ed2

The change affects 2 systems.

Changed systems: openwisp_controller, docs

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — openwisp_controller (service) was modified; 2 changed files map to changed impact.
  • observed — docs (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in openwisp_controller/config/admin.py: DeviceAdmin.search_fields adds last_ip and management_ip as searchable fields.
  • observed — Modified behavior in openwisp_controller/config/tests/test_admin.py: test_device_search now assigns distinct last and management IP addresses to its test device and checks that searching by each address finds it, while retaining the existing UUID and no-results checks.
  • observed — Modified behavior in docs/user/settings.rst: Added documentation that the device-list search field supports last_ip and management_ip.

Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Ui Changes, Regression Test, Docs ❌ Error The pull request changes the end-user-facing DeviceAdmin search behavior. The diff adds last_ip and management_ip to DeviceAdmin.search_fields, so users see different search results in the devic… Add before-and-after screenshots or a screen recording to the pull request description. Show the DeviceAdmin device-list search before the change and after searching for both last_ip and management_ip.
✅ Passed checks (4 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.
Description check ✅ Passed The description includes all checklist items, explains the DeviceAdmin search changes, documents the added tests, and notes that screenshots are not applicable.
Title check ✅ Passed The title uses the valid [change] prefix and clearly describes the addition of IP address search support to DeviceAdmin.
Full details: Ui Changes, Regression Test, Docs

Explanation

The pull request changes the end-user-facing DeviceAdmin search behavior. The diff adds last_ip and management_ip to DeviceAdmin.search_fields, so users see different search results in the device list. The description marks Screenshot as N/A and includes no before-and-after screenshots or screen recording. The regression test and documentation requirements are satisfied by the updated test_device_search and docs/user/settings.rst.

  • Fix all pre-merge checks with AI

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pre-merge checks failed. Please resolve the failing checks before merging.

@nemesifier

Copy link
Copy Markdown
Member Author

@coderabbitai this change does not produce visual changes to the UI.

@coderabbitai

coderabbitai Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@nemesifier, agreed. The change does not alter the admin UI’s layout or appearance. It changes which devices the existing search returns when a user enters an IP address. Screenshots are not needed for this PR.


✏️ Learnings added
Learnt from: nemesifier
URL: https://github.com/openwisp/openwisp-controller/pull/1494

Timestamp: 2026-09-25T15:41:08.614Z
Learning: In openwisp-controller PR `#1494`, adding `last_ip` and `management_ip` to `DeviceAdmin.search_fields` changes search behavior without changing the admin UI layout or appearance.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

You are interacting with an AI system.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pre-merge checks failed. Please resolve the failing checks before merging.

@nemesifier

Copy link
Copy Markdown
Member Author

@coderabbitai resolve

coderabbitai[bot]
coderabbitai Bot previously approved these changes Sep 25, 2026
@coderabbitai

coderabbitai Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Comments resolved and changes approved.

@nemesifier
nemesifier force-pushed the device-ip-admin-search branch from d2ed268 to 39b0ef5 Compare September 25, 2026 15:49
@nemesifier
nemesifier merged commit 84e3b4f into master Sep 25, 2026
26 of 28 checks passed
@nemesifier
nemesifier deleted the device-ip-admin-search branch September 25, 2026 15:49
@nemesifier

Copy link
Copy Markdown
Member Author

/backport 1.3

@openwisp-companion

Copy link
Copy Markdown

Backport to 1.3 already exists: #1495

@coveralls

coveralls commented Sep 25, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 98.362%. remained the same — device-ip-admin-search into master

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants