Entity references can result in multiple builds

Created on 3 March 2023, almost 2 years ago
Updated 30 March 2023, over 1 year ago

Problem/Motivation

Updating an entity with entity references triggers hook_entity_update for each of the referenced entities. Since a build is triggered for every entity that is updated, this can result in several builds when only one would suffice. This could be problematic for sites using a frontend that has a limited number of builds per month.

Steps to reproduce

Create a node with a multi-value field that references other nodes.
Configure the build hooks module so that Content is considered a loggable entity
Configure the frontend(s) deployment strategy to be: "When content is updated"
Create a node that references multiple nodes
Multiple builds are triggered.

Proposed resolution

Update the hook_entity_* logic to mark/flag frontends for deployment
Use a request event subscriber that checks the flag and triggers a build if it is necessary

✨ Feature request
Status

Needs work

Version

3.3

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States steyep

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024