Skip to content

Commit b264bc1

Browse files
committed
feat: introduce content_changes_checker
1 parent 99b2f83 commit b264bc1

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/elody/object_configurations/base_object_configuration.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ class BaseObjectConfiguration(ABC):
1111
@abstractmethod
1212
def crud(self):
1313
return {
14+
"content_changes_checker": lambda document, unpatched_document, **kwargs: self._has_content_changes(
15+
document=document, unpatched_document=unpatched_document
16+
),
1417
"creation_preparer": lambda post_body, **kwargs: post_body,
1518
"creator": lambda post_body, **kwargs: post_body,
1619
"document_content_patcher": lambda *, document, content, overwrite=False, **kwargs: self._document_content_patcher(
@@ -89,6 +92,11 @@ def _document_content_patcher(
8992
"Provide concrete implementation in child object configuration"
9093
)
9194

95+
def _has_content_changes(self, *, document, unpatched_document, **kwargs):
96+
raise NotImplementedError(
97+
"Provide concrete implementation in child object configuration"
98+
)
99+
92100
def _merge_object_lists(self, source, target, object_list_key):
93101
for target_item in target:
94102
for source_item in source:

src/elody/object_configurations/job_configuration.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ def _creator(self, post_body, *, get_user_context={}, **_):
6363
document["last_editor"] = email
6464
return document
6565

66+
def _has_content_changes(self, *, document, unpatched_document, **kwargs):
67+
return True
68+
6669
def _post_crud_hook(self, *, crud, document, get_rabbit, **kwargs):
6770
if crud == "create":
6871
send_cloudevent(

0 commit comments

Comments
 (0)