Merge pull request #2775 from pypeclub/feature/OP-2642_Configure-which-reviewables-are-posted-on-Slack

Slack: Added regex for filtering on subset names
This commit is contained in:
Petr Kalis 2022-02-22 09:54:15 +01:00 committed by GitHub
commit 73d3ef1177
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 2 deletions

View file

@ -20,18 +20,23 @@ class CollectSlackFamilies(pyblish.api.InstancePlugin):
def process(self, instance):
task_name = io.Session.get("AVALON_TASK")
family = self.main_family_from_instance(instance)
key_values = {
"families": family,
"tasks": task_name,
"hosts": instance.data["anatomyData"]["app"],
"subsets": instance.data["subset"]
}
profile = filter_profiles(self.profiles, key_values,
logger=self.log)
if not profile:
self.log.info("No profile found, notification won't be send")
return
# make slack publishable
if profile:
self.log.info("Found profile: {}".format(profile))
if instance.data.get('families'):
instance.data['families'].append('slack')
else:

View file

@ -10,6 +10,7 @@
"hosts": [],
"task_types": [],
"tasks": [],
"subsets": [],
"channel_messages": []
}
]

View file

@ -69,6 +69,12 @@
"type": "list",
"object_type": "text"
},
{
"key": "subsets",
"label": "Subset names",
"type": "list",
"object_type": "text"
},
{
"type": "separator"
},

View file

@ -47,7 +47,7 @@ It is possible to create multiple tokens and configure different scopes for them
### Profiles
Profiles are used to select when to trigger notification. One or multiple profiles
could be configured, `Families`, `Task names` (regex available), `Host names` combination is needed.
could be configured, `Families`, `Task names` (regex available), `Host names`, `Subset names` (regex available) combination is needed.
Eg. If I want to be notified when render is published from Maya, setting is: