-
Notifications
You must be signed in to change notification settings - Fork 89
GH-1810 metadata form enforcement email reminder #1838
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
GH-1810 metadata form enforcement email reminder #1838
Conversation
| MetadataFormEntityTypes.Share.value: MetadataFormEnforcementScope.Dataset, | ||
| } | ||
|
|
||
| ENTITY_LINK_MAP = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any particular reason you need this exact new mapping? Why can't we reuse the existing one?
| # Send notification by email | ||
| try: | ||
| # skip if the owner is an individual user | ||
| if entity['attached'] is None and "@" not in owner: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this condition very specific? What 'individual user' means? May be we can put it in shared functions, so we could refer to it in other places as well?
| """ | ||
|
|
||
| try: | ||
| if recipient_groups_list is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest
recipient_groups_list = recipient_groups_list or []
recipient_email_ids = recipient_email_ids or []
| ) | ||
|
|
||
| subject = ( | ||
| f'ACTION REQUIRED: Data.all | Metadata form "{mf_name}" required for {entity["type"]} {entity["uri"]}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be we can add entity name here.
Smth like 'dataset TestName (uri)'
| identityProvider = ServiceProviderFactory.get_service_provider_instance() | ||
|
|
||
| # find all metadata forms | ||
| all_mfs = MetadataFormRepository.query_user_metadata_forms(session, is_da_admin=True, groups=None, env_uris=None, org_uris=None, filter=None).all() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This task is executed in Ecs and not so time-sensitive. But for issue #1807 this will be timesensitive issue.
- I would place this function in
mf_enforcement_servicesince it performs business logic and can be reused - Maybe we should think about creating a view in DB, where all unattached entities will be stored. It can speed up such operations
SofiaSazonova
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments about structure
Feature or Bugfix
Detail
Relates
Security
Please answer the questions below briefly where applicable, or write
N/A. Based onOWASP 10.
fetching data from storage outside the application (e.g. a database, an S3 bucket)?
evalor similar functions are used?By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.