Description
Proposed Changes
While we've generally avoided the use of bulk_create()
and bulk_update()
for the bulk creation and manipulation of objects due to the caveats associated with their use (namely not triggering the post_save
signal), they are still used in a few areas within NetBox. The goal of this issue is to eliminate any usage of these methods, excluding within tests and migrations where specifically needed to ensure optimal performance.
Justification
As calling bulk_create()
or bulk_update()
does not generate a post_save
signal for each of the objects affected, this escapes change logging and (in NetBox v3.4) search indexing. Although calling save()
on each instance individual will impose a performance penalty, it ensures that each instance is subject to the appropriate background workflows. (This was initially called out here by @kkthxbye-code.)