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

DeviceFilterSet attributes being stripped of options #4377

Closed
itdependsnetworks opened this issue Sep 3, 2023 · 8 comments · Fixed by #4392
Closed

DeviceFilterSet attributes being stripped of options #4377

itdependsnetworks opened this issue Sep 3, 2023 · 8 comments · Fixed by #4392
Assignees
Labels
emergent Unplanned work that is brought into a sprint after it's started. type: bug Something isn't working as expected

Comments

@itdependsnetworks
Copy link
Contributor

Environment

  • Nautobot version (Docker tag too if applicable): 2.0-rc2
  • Python version: 3.11
  • Database platform, version: latest
  • Middleware(s): N/A

I attempted to look on 1.5 or 1.6 but the demo instances weren't immediately loading to see if this is 1.x or not.

Steps to Reproduce

  1. Go to https://next.demo.nautobot.com/api/docs/#/dcim/dcim_devices_list
  2. Observe has_device_bays, created, last_updated, etc.

Expected Behavior

The attributes to match up to their type, such as DateTime, Boolean, Integer, etc.. as shown in the device-types api

image

Observed Behavior

Everything is defaulting to char type.

image
@itdependsnetworks itdependsnetworks added type: bug Something isn't working as expected triage This issue is new and has not been reviewed. labels Sep 3, 2023
@itdependsnetworks
Copy link
Contributor Author

The same seems to be true for virtual machines.

@itdependsnetworks
Copy link
Contributor Author

demo.nautobot.com on 1.6.1 seems to be working, except for face

image

sales instance on 1.5.24 seems to only have face choice working?

image

@glennmatthews
Copy link
Contributor

Can confirm that the OpenAPI schema differs between Device and DeviceType in next, e.g.:

      - name: has_console_ports
        required: false
        in: query
        description: Has console ports
        schema:
          type: string

versus:

      - in: query
        name: has_console_port_templates
        schema:
          type: boolean
        description: Has console port templates

@glennmatthews
Copy link
Contributor

I wonder if this somehow has anything to do with the FilterForm definitions - DeviceFilterForm has has_console_ports included as a NullBooleanField, while DeviceTypeFilterForm does not include has_console_port_templates.

@itdependsnetworks
Copy link
Contributor Author

@glennmatthews my gut says no, since it is stripping off many other things, I realized this when implementing #4378, that the isnull was also being stripped out. Look at all of the attributes, not just the has_*, I think something else is going on.

@glennmatthews
Copy link
Contributor

Agreed - the weirdness appears specific to the dcim/devices/ and virtualization/virtual-machines/ endpoints; all others appear to be working normally on a quick search of the schema.

@glennmatthews
Copy link
Contributor

Possibly related to some of the config-context handling changes in 2.0, such as #3814?

@glennmatthews glennmatthews self-assigned this Sep 5, 2023
@itdependsnetworks
Copy link
Contributor Author

@glennmatthews also consider, that I see the issue on the one instance of 1.5.24, but not on 1.6.1, though 1.6.1 has an issue with face_* choices... So oddness all around. It is not clear if it is something specfic with the deployments (such as version of drf-spectacular) being used, or something else.

@glennmatthews glennmatthews removed the triage This issue is new and has not been reviewed. label Sep 5, 2023
@glennmatthews glennmatthews added the emergent Unplanned work that is brought into a sprint after it's started. label Sep 5, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
emergent Unplanned work that is brought into a sprint after it's started. type: bug Something isn't working as expected
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants