handlers.quality_check_handler
Whenever somebody updates an Application, we run a quality check and create a to-do if there are quality gaps.
Default rules: Description needs to be filled, Lifecycle must be defined for current day.
Configuration:
todo_roles: List of roles that will receive the to-do. Can be any of the following:
__FIRST_MATCHING__: Assign the to-do only to the first subscription that matches the roles below.<name of a specific subscription role>: matches any subscription with that role, e.g. "Application Owner".<subscription type>:<name of a specific subscription role>: matches any subscription with that role and type, e.g. "RESPONSIBLE:Application Owner".__CREATOR__: the creator of the fact sheet.__EDITOR__: the person that just modified the fact sheet.__ANY_RESPONSIBLE__: any subscription with type "RESPONSIBLE"__ANY_ACCOUNTABLE__: any subscription with type "ACCOUNTABLE"__ANY_RESPONSIBLE_OR_ACCOUNTABLE__: any subscription with type either "RESPONSIBLE" or "ACCOUNTABLE"__ANY__: any subscription.
todo_skip_invalid_entra_users: Optional: Set to true to skip to-do recipients that are not enabled users in Entra ID
(e.g. a deactivated Application Owner). With __FIRST_MATCHING__, the next role is tried instead.
todo_fallback_fs_subscription: Optional: Used if todo_roles yields no recipient. Dict with id (fact sheet id),
subscription_type (e.g. "RESPONSIBLE") and subscription_role (e.g. "Data Quality Manager"); the to-do is assigned
to all subscribers of that fact sheet with that type and role. Omit type or role to match any.
todo_fallback_emails: Optional: List of mail addresses, used if neither todo_roles nor
todo_fallback_fs_subscription yield a recipient.
todo_title: Title of the to-do. If this automation is configured multiple times, make sure to use unique titles, otherwise the automatic deletion of todos might overlap.
todo_category: Category of the to-do, should be ACTION_ITEM.
todo_due_in_days: Due date of the to-do items.
delete_outdated_todos: Set to true if outdated to-dos (for fs with non-matching conditions or with no quality
errors) shall be deleted automatically.
recreate_todo: Set to true if all to-dos should be regenerated, e.g. by a scheduled cron run, so that the
to-do- notifications will be sent again. Should only be used in scheduled automations, e.g. in scheduled initial
sync, not in live automation.
rules: The default configuration contains an example. Keys are fact sheet types (optionally <type>:<category1>,<category2>),
* for rules that apply to all fact sheet types, or relation names.
Optional configuration for editorial management:
editorial_status_field: Optional: Field name where the editorial status (e.g. "Draft") is stored.
editorial_status_initial: Optional: Initial value for the editorial status field, e.g. "Draft"
editorial_status_prefix_field: Optional: Field name where the prefix for the editorial status (e.g. [DRAFT Expires 2025-01-31]) is stored.
editorial_details: Optional: Field where the editorial details are stored, e.g. the instructions for the end user.
deletion_days_field: Optional: Field that stores the expiration date of a draft fact sheet.
Declare the exact fact-sheet data this handler needs, so the webhook event loop (process_event in workspace/views_module.py) can load a single lean FastFactSheet per event instead of the full fact sheet.
Return a dict:
{
"fields": [
Return None (the default) to signal "requirements cannot be declared statically" - e.g. handlers that exec/eval config-supplied code. The event loop then loads the full fact sheet for that event, so correctness is always preserved. This is a standalone hook (deliberately not tied to the initial_sync_* hooks, which are slated to migrate onto it later).
Called automatically whenever a FactSheetUpdated event comes in via webhook.
Called automatically whenever a FactSheetUpdated event comes in via webhook.
Returns a filter for to-do recipients (see get_notification_users), or None if all users are accepted.
Recipients if todo_roles yields nobody: todo_fallback_fs_subscription, then todo_fallback_emails.
Inherited Members
- handlers.eventhandler.EventHandler
- EventHandler
- get_trigger
- get_event_types
- get_fs_types
- get
- all
- lx_client
- update_with_uniqueness_check
- facet_matches
- is_tag_key
- SUBSCRIPTION_TYPES
- parse_subscription_key
- get_mapped_subscriptions
- get_notification_users
- get_send_email_for_users
- get_email_callback
- get_due_date