Skip to content

Fixes #649: Refresh query_counts.json baseline for current NetBox main - #650

Open
bctiemann wants to merge 1 commit into
mainfrom
649-refresh-query-count-baselines
Open

Fixes #649: Refresh query_counts.json baseline for current NetBox main#650
bctiemann wants to merge 1 commit into
mainfrom
649-refresh-query-count-baselines

Conversation

@bctiemann

Copy link
Copy Markdown
Contributor

Summary

  • The tests (main) CI leg was failing on 4 list_objects_with_permission query-count assertions, expecting 2 more queries than NetBox's current main branch actually issues for those views. Confirmed this is pre-existing drift, not caused by any specific PR: it reproduces identically on an unmodified netbox-custom-objects main (see run 31199832224) — an upstream query-count optimization on netbox-community/netbox main shaved 2 queries off these checks since the baselines were last recorded.
  • Regenerated netbox_custom_objects/tests/query_counts.json via UPDATE_QUERY_COUNTS=1, run against a clean worktree of NetBox's actual main tip (not a locally cached/stale checkout) to match what CI fetches.
  • All four affected keys (customobject-simple, customobject-objectfields, customobject-complex, customobjecttype) dropped by exactly 2 queries each — matching the CI failure precisely. No other baseline keys changed.

Test plan

  • python netbox/manage.py test netbox_custom_objects.tests.test_views passes against current NetBox main with the refreshed baseline.
  • Re-ran the full plugin suite (1126 tests) against the same environment — no other regressions.
  • ruff check clean.

Closes: #649

🤖 Generated with Claude Code

tests (main) was failing on 4 list-view query-count assertions, expecting
2 more queries than NetBox's current main branch actually issues -- an
upstream prefetch/permission-check optimization shaved 2 queries off
customobject-simple, customobject-objectfields, customobject-complex, and
customobjecttype's list_objects_with_permission checks since these
baselines were last recorded.

Regenerated via UPDATE_QUERY_COUNTS=1 against a clean checkout of NetBox
main (not the locally cached checkout, which was 33 commits behind and had
a handful of divergent dependency pins). All four keys dropped by exactly
2 queries each, matching the CI failure precisely; no other keys changed.
Re-ran the full plugin suite (1126 tests) against the same environment to
confirm nothing else regressed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@bctiemann

Copy link
Copy Markdown
Contributor Author

Heads up on CI: tests (main) and tests (main, branching) now pass (the original problem), but tests (feature) currently fails with the mirror-image mismatch (expects the new lower counts, but NetBox's feature ref still produces the old higher ones).

Root cause: NetBox core commit b1ee8297d ("Closes #22877: Improve caching logic when retrieving custom fields via get_for_model()") landed on main on 2026-08-06 and shaved ~2 queries off a wide range of core query-count baselines — this plugin's 4 affected views included. It hasn't been merged into feature yet (git log origin/main --not origin/feature still lists it), so main and feature are genuinely, temporarily producing different query counts for the same views right now.

This isn't fixable from this repo — it resolves itself once NetBox core's feature branch is next synced from main. Flagging here so it doesn't block review; not adding a tolerance/skip for it per discussion.

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.

CI: query_counts.json baseline stale against NetBox main (tests (main) failing)

1 participant