Skip to content

feat(inventory): modules/inventory sync tab with mapping rules - #50

Merged
marcinpsk merged 72 commits into
mainfrom
pr/inventory-core
May 1, 2026
Merged

feat(inventory): modules/inventory sync tab with mapping rules#50
marcinpsk merged 72 commits into
mainfrom
pr/inventory-core

Conversation

@marcinpsk

@marcinpsk marcinpsk commented Mar 31, 2026

Copy link
Copy Markdown
Owner

Add inventory/modules sync functionality:

  • Six mapping model types: DeviceTypeMapping, ModuleTypeMapping, ModuleBayMapping, NormalizationRule, InventoryIgnoreRule, PlatformMapping
  • Migration 0010 creating all mapping tables
  • Modules sync tab on Device/VM detail pages with ENTITY-MIB inventory data
  • Install, replace, and move module actions
  • Mapping CRUD views with YAML bulk export for all mapping models
  • LibreNMS API: get_device_transceivers() for transceiver data
  • Platform matching: PlatformMapping lookup before name-exact match
  • contrib/ YAML files with example mappings and rules
  • Comprehensive test coverage (test_sync_modules, test_modules_view, test_module_replace, test_platform_mapping, test_tables_modules)

Summary

Briefly describe what this PR does in plain English, and provide as much of the following information as possible.

Motivation / Problem

What issue does this solve?

  • Bug
  • Feature
  • Refactor
  • Maintenance / cleanup

Link any related issues if applicable.

Scope of Change

Delete items that don’t apply:

  • Sync/Import logic
  • NetBox models / ORM
  • LibreNMS API interaction
  • Config / settings
  • Web UI / templates
  • Database migrations
  • Tests
  • Docs only
  • Other:

How Was This Tested?

Delete items that don’t apply and describe briefly.

  • Unit tests: <yes/no + what>
  • Manual testing: <yes/no + what>
  • Not tested:

Manual Test Steps (if applicable)

Risk Assessment

  • Does this change affect existing users?
  • Could this cause unintended imports / updates?

Explain briefly.

Backwards Compatibility

  • No breaking changes
  • Breaking change (explain and document)

Other Notes

Anything the maintainer(s) should pay particular attention to?

Summary by CodeRabbit

  • New Features

    • Module Sync tab with merged inventory, install/branch install, serial update, replace/move, mismatch preview; new mapping management UIs and bulk YAML import/export plus example YAMLs.
  • Bug Fixes

    • Improved virtual‑chassis detection, clearer platform-ambiguity messages, safer regex/normalization handling, preserved role availability during imports, and more robust modal/HTMX fetch/error handling.
  • Documentation

    • Added contrib README with example YAML mapping files; updated testing and custom-field guidance.
  • Tests

    • Large expansion of unit, integration, and end‑to‑end tests.

Loading
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