@@ -892,6 +892,16 @@ def notify(self):
892892 for accreditation , desc in messages :
893893 if accreditation not in self ._config or not desc :
894894 continue
895+ # determine if we should page for all failing checks in this
896+ # accreditation, or only a subset defined in the config.
897+ # The config can either be a string of the PD service ID,
898+ # or a dictionary containing additional config details, including
899+ # the optional list of checks.
900+ all_checks , pd_checks = True , []
901+ if (isinstance (self ._config [accreditation ], dict )
902+ and 'checks' in self ._config [accreditation ]):
903+ all_checks = False
904+ pd_checks = self ._config [accreditation ]['checks' ] or []
895905
896906 # get all current PD alerts
897907 alerts = self ._get_alerts (accreditation )
@@ -900,6 +910,10 @@ def notify(self):
900910 passed , failed , warned , errored = self ._split_by_status (desc )
901911
902912 for test_id , test_desc , msg in (failed + errored ):
913+ # is the check in scope?
914+ if not all_checks and test_id not in pd_checks :
915+ continue
916+
903917 summary , body = self ._get_summary_and_body (
904918 test_desc ,
905919 msg ,
@@ -935,7 +949,8 @@ def notify(self):
935949 self ._resolve_alert (test_id , test_desc , msg , accreditation )
936950
937951 def _get_alerts (self , accreditation ):
938- pd_service = self ._config [accreditation ]
952+ conf = self ._config [accreditation ]
953+ pd_service = conf ['service_id' ] if isinstance (conf , dict ) else conf
939954
940955 # Get all triggered alerts
941956 # NOTE: statuses[]=triggered is supposed to work, but doesn't
0 commit comments