-
Notifications
You must be signed in to change notification settings - Fork 138
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
data.netbox_prefix
: add custom fields and role_id
#607
data.netbox_prefix
: add custom fields and role_id
#607
Conversation
data.netbox_prefix
: add custom fields and role_id
This lacks a test for the custom fields part. Note that custom fields are notorious for being somewhat problematic in parallel tests, because other tests find and return them unexpectedly. |
I wasn't quite sure what to test - I didn't implement finding a But you are right, if I change the test to be:
The tests pass fine - but, it's not really testing anything, since there isn't a check to see if the relevant However, if I leave off the
But, I feel that this is a function of For example, for any prefixes that either have no
But you can't specify Given that, as mentioned, setting custom fields is a global operation for the type targeted, is it reasonable to expect people to always specify them? For example, in my use case, I set my equivalent |
Those are some nice points and I feel that the pains of custom fields in its current state. Just to reiterate, what I was referring to was this: Test A adds a custom_field F for the "ipam.prefix" prefix type. Meanwhile: To circumvent this issue, I usually use Finally, you said
Why not add one? And as a final final note: consistently handling custom fields in a unified fashion is definitely something that has to be tackled eventually, its just that new things keep popping up and my time is limited. |
Add a test to ensure the data is returned correctly too.
7a9df3b
to
9f280b0
Compare
Hey @fbreckle , thanks so much for your feedback, very helpful! I've added a separate test for the Let me know if you'd like to see anything more, happy to defer to your judgement :) |
This PR contains two bits of work related to
data.netbox_prefix
.role_id
as a field returned bydata.netbox_prefix
, and allows searching byrole_id
.custom_fields
defined ondata.netbox_prefix
Thanks!