Skip to content

Conversation

@ogenstad
Copy link
Contributor

With the current code the computed attributes will only be executed if you mutate the node where that attribute is defined. This PR changes this behaviour so that we run the computed attribute update even when related nodes are updated.

Note once #4894 is merged I want to move the code looking directly in schema_branch._computed_jinja2_attribute_map so that all of that logic instead happens in the in the ComputedAttributes class from backend/infrahub/core/schema/schema_branch_computed.py introduced in that PR.

Also as we're still looking at a node as a whole we can get away with using the same automation. But as I understand when we again introduce updates to specific fields I think we'll need to have multiple automations for this each with a unique match statement.

@github-actions github-actions bot added the group/backend Issue related to the backend (API Server, Git Agent) label Nov 13, 2024
@ogenstad ogenstad force-pushed the pog-change-match-logic-computed-jinja-attributes branch from b5a499f to cdae5a8 Compare November 13, 2024 10:55
@codspeed-hq
Copy link

codspeed-hq bot commented Nov 13, 2024

CodSpeed Performance Report

Merging #4925 will not alter performance

Comparing pog-change-match-logic-computed-jinja-attributes (cdae5a8) with develop (f12135d)

Summary

✅ 10 untouched benchmarks

@ogenstad ogenstad marked this pull request as ready for review November 13, 2024 11:42
@ogenstad ogenstad requested a review from a team November 13, 2024 11:42
@ogenstad ogenstad merged commit d51c921 into develop Nov 13, 2024
32 checks passed
@ogenstad ogenstad deleted the pog-change-match-logic-computed-jinja-attributes branch November 13, 2024 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

group/backend Issue related to the backend (API Server, Git Agent)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants