#21025: Optimize rendering of config context data#22294
Conversation
c273bc8 to
53fff7c
Compare
53fff7c to
db44a3b
Compare
34c7ae9 to
08a1b01
Compare
2b90545 to
3ea5839
Compare
|
@claude /review |
|
Claude finished @jeremystretch's task in 6m 17s —— View job PR Review: #21025 Optimize rendering of config context data
OverviewThis PR introduces a pre-rendered caching layer for config context data on The implementation is thorough. The Issues Found1. Top-level cross-app imports in
|
3ea5839 to
d43893f
Compare
|
@claude /review Please review again, considering the following responses to the above concerns:
|
|
Claude finished @jeremystretch's task in 1m 24s —— View job PR Review (Re-review): #21025 Optimize rendering of config context data
Re-review SummaryI've verified each of the eight responses against the current state of the code. All items are accounted for and the PR is in good shape. Item-by-item verification1. Cross-app top-level imports in Fair enough; 2.
3. Accepted as-is for now. 4. Release notes will cover it. 5. Missing test for
6. Missing test for
7. No warning for exhausted render passes — confirmed fixed ✓
8. Acceptable for now. ConclusionAll previously raised concerns are either resolved, accepted, or acknowledged with a plan. The implementation is solid: the CAS generation counter, the |
arthanson
left a comment
There was a problem hiding this comment.
Everything looks good, just one small item I'm not sure is a bug with returning the cached item that gets mutated, it is a change from previous and probably should return a copy to avoid inadvertent side-effects.
| """ | ||
| from extras.models.tags import TaggedItem | ||
|
|
||
| def _mptt_descendants(m2m): |
There was a problem hiding this comment.
will need to double-check this with the Ltree stuff once merged. at least rename it
| """ | ||
| cached = getattr(self, '_config_context_data', None) | ||
| if cached is not None: | ||
| return cached |
There was a problem hiding this comment.
callers are mutating this (extras/views.py:1288) I think me may want to return a new copy here instead of the direct cached object?
Closes: #21025
_config_context_dataJSON field to stored cached context data_config_context_generationinteger field to serialize recalculations (for race condition avoidance)get_config_context()into a newrender_config_context()method and default to returning cached config context data (if present)get_affected_objects()method to ConfigContext, which returns the devices/VMs covered by its scope_config_context_datarebuild_config_context_cachemanagement command (with--forceoption)*WithConfigContextSerializerREST API serializers for devices/VMsannotate_config_context_data()from UI & GraphQL querysets for devices/VMsconfig_contextdata by passing?exclude=config_contextwith REST API requests