Skip to content

Conversation

@cernymi
Copy link
Contributor

@cernymi cernymi commented Nov 7, 2025

Related Issue

Issue #1479

(and PR #1427 seems missing ALLOWED_QUERY_PARAMS part)

Modified Behavior

New Behavior

None

...

Contrast to Current Behavior

You'll be able to create more services with the same name but different parent. For netbox 4.4.4 and never
Parent param introduced in Netbox 4.3.0

...

Discussion: Benefits and Drawbacks

Services will work correctly again for Netbox 4.4.4 (4.3.0) and never

  • parent_object_type and parent_object_id should be added to services ALLOWED_QUERY_PARAMS
  • be able to query services correctly. Only name of service is not globally unique for Netbox 4.3.0 and never. So parent parameters should be involved.

...

Changes to the Documentation

None

...

Proposed Release Note Entry

  • add parent_object_type and parent_object_id to services ALLOWED_QUERY_PARAMS

...

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.

@cernymi cernymi force-pushed the cernymi/fix-issue-1479 branch 2 times, most recently from 47a3c14 to 5a4514c Compare November 7, 2025 19:23
@sc68cal
Copy link
Contributor

sc68cal commented Nov 13, 2025

I have this on my list to take a look at, sorry for the delay

@sc68cal
Copy link
Contributor

sc68cal commented Nov 14, 2025

So, my main problem with this PR is that there are a couple changes in this PR. They are valid changes and good to have, but I would feel more comfortable if we broke them apart so that if there was a problem, we could easily revert. If that is even possible? I do understand why they are all part of this PR but changes to how we parse the version string from the Netbox API response is always a little fraught. We recently got bitten by a change that the Docker deployment of NetBox does where they append their release version to the string, so that is why I am a little shy about this PR.

If this is indeed an all or nothing change, I would appreciate some unit tests around version string parsing just to give me peace of mind.

Thanks, and great work.

@cernymi cernymi force-pushed the cernymi/fix-issue-1479 branch from 5a4514c to 588215d Compare November 15, 2025 10:33
@sc68cal
Copy link
Contributor

sc68cal commented Nov 15, 2025

Just remembered that the CI tests run against live Netbox so the version string does get parsed and tested in CI. Sorry, brain fart. I think this is good.

sc68cal
sc68cal previously approved these changes Nov 15, 2025
Copy link
Contributor

@sc68cal sc68cal left a comment

Choose a reason for hiding this comment

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

Just needs yamllint fix to some change of fragments

@cernymi
Copy link
Contributor Author

cernymi commented Nov 17, 2025

Thank you for your comments. They're helping me to get familiar with this project. You’re doing a great job!
And yes, you're right. This PR contains more topics than there should be. I completely agree.
Let's plit it to more PR. There's no problem.

  • yamllint - PR - 1490

  • sanitize full_version and improve _version_check_greater
    going to create PR

  • In this PR will be kept:

    • _version_less_than - I'll add unit tests
    • ALLOWED_QUERY_PARAMS - add parent_object_type, parent_object_id
    • workaround for services in _build_query_params
  • optionally I'll send another PR for rename version variables:

    • version -> api_version
    • full_version -> netbox_version
      The new one might be less confusing

@sc68cal
Copy link
Contributor

sc68cal commented Nov 17, 2025

Excellent idea. I've approved and merged the changes for yamllint, so thank you for that. If you rebase this PR on the latest from devel that should get this PR to pass CI

@cernymi
Copy link
Contributor Author

cernymi commented Nov 17, 2025

Alright, thanks. I'll rebase and modify this PR afterwards.
Before that, I've created PR 1491 as a prerequisite.
Let me know if anything needs improvement.

@sc68cal
Copy link
Contributor

sc68cal commented Nov 18, 2025

merged 1491

@cernymi
Copy link
Contributor Author

cernymi commented Nov 18, 2025

Tested duplicate service names - Result

NetBox version Status
Community v4.2.9
Community v4.4.4
Community v4.3.7‑Docker‑3.3.0 (covers 4.3.0‑4.4.3) ⚠️ Only one service with a given name can exist

Take‑away:

  • Netbox 4.3.0 < version >= 4.4.4 allow multiple services using the same name.
  • Version 4.3.0‑4.4.3 behaves incorrectly.

@cernymi cernymi force-pushed the cernymi/fix-issue-1479 branch 3 times, most recently from c5c1f01 to 418a7ac Compare November 18, 2025 13:06
@cernymi
Copy link
Contributor Author

cernymi commented Nov 18, 2025

I still struggle with:

  
ERROR! Error when finding available api versions from default (https://galaxy.ansible.com/) (HTTP Code: 500, Message: Internal Server Error)
Starting galaxy collection install process
Process install dependency map
Error: Process completed with exit code 1.

I'll try push later on to have the pipeline green

@cernymi cernymi force-pushed the cernymi/fix-issue-1479 branch from 329beb9 to 418a7ac Compare November 18, 2025 15:21
- elif parent == "services":
    is workaround for Netbox 4.3.0 - 4.4.3 - #20554
    GET Parent_object_type wrong data type - integer instead of string
    Just delete parent_object_type and parent_object_id
    GET is broken anyway
@cernymi cernymi force-pushed the cernymi/fix-issue-1479 branch from 418a7ac to 3c504af Compare November 18, 2025 15:44
@cernymi
Copy link
Contributor Author

cernymi commented Nov 18, 2025

Great, pipeline is green. I have nothing to add.
Let me know if anything needs improvement. Thanks

@sc68cal
Copy link
Contributor

sc68cal commented Nov 18, 2025

Great job, thank you for breaking this into different PRs, this made things far easier to review.

@sc68cal sc68cal merged commit 56a65f8 into netbox-community:devel Nov 18, 2025
56 checks passed
@cernymi
Copy link
Contributor Author

cernymi commented Nov 18, 2025

Yeah, breaking the original work into multiple PRs definitely made the whole process smoother.
Thanks for taking the time to review them and for the useful feedback — it helped tighten things up a lot.

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