Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes: #18535 - Skip incompatible plugins during startup #18537

Open
wants to merge 9 commits into
base: feature
Choose a base branch
from

Conversation

bctiemann
Copy link
Contributor

Closes: #18535

Changes the behavior of the PluginConfig.validate method so that if a plugin with incompatible min or max version specified, it raises an IncompatiblePluginError which is caught in settings.py and registering the plugin is skipped, allowing NetBox to launch cleanly with the plugin disabled.

netbox/netbox/settings.py Outdated Show resolved Hide resolved
@a084ed22
Copy link

Just to understand, this would print a warning at netbox upgrade time? The experience of figuring out which plugin has a strict max_version specified and breaks the upgrade process even on patch upgrades during the database migration step could really use to be more explanatory.

@bctiemann
Copy link
Contributor Author

Yes, it would look like this:

Unable to load plugin netbox_branching: Plugin netbox_branching requires NetBox maximum version 4.2.1 (current: 4.2.2).
Watching for file changes with StatReloader
Performing system checks...

@bctiemann bctiemann changed the base branch from feature to main February 5, 2025 15:31
@bctiemann bctiemann changed the base branch from main to feature February 5, 2025 15:45
@bctiemann bctiemann changed the title Closes: #18535 - Skip incompatible plugins during startup and remove from PLUGINS Closes: #18535 - Skip incompatible plugins during startup Feb 5, 2025
Copy link
Member

@jeremystretch jeremystretch left a comment

Choose a reason for hiding this comment

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

We might want to rename of the table columns. Currently, a plugin which fails to load shows false under "Installed" but confusingly still reports an installed version:

screenshot

We should also highlight any plugins which failed to load to draw attention to them.

installed_version=installed_version,
)

# Update catalog entries for local plugins, or add them to the list if not listed
for k, v in local_plugins.items():
if k in plugins:
plugins[k].is_local = True
plugins[k].is_installed = True
plugins[k].is_installed = k in registry['plugins']['installed']
Copy link
Member

Choose a reason for hiding this comment

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

I think we can copy this over directly?

Suggested change
plugins[k].is_installed = k in registry['plugins']['installed']
plugins[k].is_installed = v.is_installed

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.

3 participants