Skip to content

Conversation

@cernymi
Copy link
Contributor

@cernymi cernymi commented Nov 17, 2025

Related Issue

None

New Behavior

None

...

Contrast to Current Behavior

Values from netbox-version and nb.version are now sanitized.
For example, a version like 4.2.9-Docker-3.2.1 is correctly handled as 4.2.9.

The _version_check_greater function is now more versatile, supporting comparisons of versions with more than two numeric components (e.g., 2.10.3 vs 2.9.12 or even 2.10 vs 2.10.2).

...

Discussion: Benefits and Drawbacks

Plus:

  • sanitized input values: netbox-version and nb.version
  • more versatile _version_check_greater function

...

Changes to the Documentation

None

...

Proposed Release Note Entry

  • improve version_check_greater to be more versatile
  • sanitize netbox versions received from api

...

Double Check

  • I have read the comments and followed the CONTRIBUTING.md.
  • I have explained my PR according to the information in the comments or in a linked issue.
  • My PR targets the devel branch.

- add _version_sanitize
- add unit test for _version_sanitize
- netbox-version can sometimes be 4.2.9-Docker-3.2.1
  but expecting full_version is just 4.2.9
  do not see any purpose Docker-3.2.1
  so sanitize netbox version
- sanitize api version - just for sure. no issues yet
- allow compare even 3 digit versions or more
- sanitize inputs - full_version can sometimes be 4.2.9-Docker-3.2.1
  just use only 4.2.9
- extend unit tests
@cernymi cernymi force-pushed the cernymi/netbox_versions branch from 3ab35cf to 1e2bdc3 Compare November 18, 2025 00:22
@sc68cal sc68cal merged commit 22143dc into netbox-community:devel Nov 18, 2025
56 checks passed
@cernymi cernymi deleted the cernymi/netbox_versions branch November 18, 2025 09:06
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