[PR #4638] [CLOSED] Add support for script and report packaging in plugins (#4573) #12893

Closed
opened 2025-12-29 22:24:13 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/4638
Author: @glennmatthews
Created: 5/13/2020
Status: Closed

Base: develop-2.9Head: issue-4573


📝 Commits (2)

  • 7532bca Add support for script and report packaging in plugins (#4573)
  • 064bb97 Merge branch 'develop-2.9' into issue-4573

📊 Changes

13 files changed (+212 additions, -18 deletions)

View changed files

📝 docs/additional-features/reports.md (+2 -0)
📝 docs/development/application-registry.md (+24 -0)
📝 docs/plugins/development.md (+59 -0)
📝 docs/plugins/index.md (+2 -0)
📝 docs/release-notes/version-2.9.md (+2 -1)
📝 mkdocs.yml (+1 -0)
📝 netbox/extras/plugins/__init__.py (+44 -0)
📝 netbox/extras/reports.py (+22 -14)
📝 netbox/extras/scripts.py (+18 -0)
netbox/extras/tests/dummy_plugin/reports.py (+8 -0)
netbox/extras/tests/dummy_plugin/scripts.py (+11 -0)
📝 netbox/extras/tests/test_plugins.py (+16 -0)
📝 netbox/extras/views.py (+3 -3)

📄 Description

Fixes: #4573

Plugins can now include custom scripts and reports as part of their packaging. If a plugin registers these with the application registry (following the established design for registering template extensions and menu items), they will be automatically discovered and listed alongside the scripts and reports provided locally as per the existing implementation.

Additionally I've added the ability for report modules to register a custom name string to be displayed as a section header in the Reports view (just as script modules already can do for the Scripts view), as the baseline behavior of displaying just the raw module name was a bit ugly for plugin reports (for example, Plugin_name.reports).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/4638 **Author:** [@glennmatthews](https://github.com/glennmatthews) **Created:** 5/13/2020 **Status:** ❌ Closed **Base:** `develop-2.9` ← **Head:** `issue-4573` --- ### 📝 Commits (2) - [`7532bca`](https://github.com/netbox-community/netbox/commit/7532bca67ce2f0f62f20e70a97cebbba15a58219) Add support for script and report packaging in plugins (#4573) - [`064bb97`](https://github.com/netbox-community/netbox/commit/064bb97a57e8076106227922450c0fd33d107cd5) Merge branch 'develop-2.9' into issue-4573 ### 📊 Changes **13 files changed** (+212 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `docs/additional-features/reports.md` (+2 -0) 📝 `docs/development/application-registry.md` (+24 -0) 📝 `docs/plugins/development.md` (+59 -0) 📝 `docs/plugins/index.md` (+2 -0) 📝 `docs/release-notes/version-2.9.md` (+2 -1) 📝 `mkdocs.yml` (+1 -0) 📝 `netbox/extras/plugins/__init__.py` (+44 -0) 📝 `netbox/extras/reports.py` (+22 -14) 📝 `netbox/extras/scripts.py` (+18 -0) ➕ `netbox/extras/tests/dummy_plugin/reports.py` (+8 -0) ➕ `netbox/extras/tests/dummy_plugin/scripts.py` (+11 -0) 📝 `netbox/extras/tests/test_plugins.py` (+16 -0) 📝 `netbox/extras/views.py` (+3 -3) </details> ### 📄 Description ### Fixes: #4573 Plugins can now include custom scripts and reports as part of their packaging. If a plugin registers these with the application registry (following the established design for registering template extensions and menu items), they will be automatically discovered and listed alongside the scripts and reports provided locally as per the existing implementation. Additionally I've added the ability for report modules to register a custom `name` string to be displayed as a section header in the Reports view (just as script modules already can do for the Scripts view), as the baseline behavior of displaying just the raw module name was a bit ugly for plugin reports (for example, **Plugin_name.reports**). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 22:24:13 +01:00
adam closed this issue 2025-12-29 22:24:14 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12893