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

Expanded view for Prefixes doesn't display hierarchy #4617

Closed
abrahamvegh opened this issue May 10, 2020 · 3 comments
Closed

Expanded view for Prefixes doesn't display hierarchy #4617

abrahamvegh opened this issue May 10, 2020 · 3 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@abrahamvegh
Copy link
Contributor

Environment

  • Python version: 3.7.3
  • NetBox version: 2.8.3

Steps to Reproduce

Create a prefix that is a child of another prefix. e.g. 203.0.113.0/24 and 203.0.113.0/25

Expected Behavior

When viewing the list with the ‘Expand’ mode turned on, the prefixes used to display with an indication of their hierarchy.

Observed Behavior

All prefixes display at the same level in the list, making hierarchy less obvious.
Screen Shot 2020-05-10 at 3 21 56 AM
Screen Shot 2020-05-10 at 3 22 02 AM

Notes

I’m not sure exactly when this broke, but I'm pretty confident it was very recent, perhaps something in #492?

@jeremystretch jeremystretch self-assigned this May 13, 2020
@jeremystretch
Copy link
Member

I can confirm that this was broken by the change in #492. It seems that calling prefetch_related() on the queryset after annotate() wipes out the annotations, though I can't figure out why. AFAIK this shouldn't happen, but we may have run into some obscure caveat of the ORM.

@jeremystretch
Copy link
Member

So we're not actually using annotate() to do this, but rather some convoluted logic in the annotate_depth() method on PrefixQuerySet. It's probably best to address this directly (which is already long overdue) rather than coming up with a workaround.

Marking this as blocked by #4639.

@jeremystretch jeremystretch added status: blocked Another issue or external requirement is preventing implementation type: bug A confirmed report of unexpected behavior in the application labels May 13, 2020
@jeremystretch
Copy link
Member

I spent too much time today digging into #4639 and I'm afraid it isn't going anywhere soon. Going to throw in a "meh" workaround for an immediate fix for the UI.

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed status: blocked Another issue or external requirement is preventing implementation labels May 13, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

2 participants