@@ -124,6 +124,29 @@ def get_json_env_var(name, default):
124124# To run cronjobs locally, execute
125125# poetry run ./manage.py crontab arg
126126# where "arg" is add, remove or show
127+
128+ HEALTHCHECK_MONITORING_PATH_MAP : dict [str , str ] = {
129+ "delete_unused_hardware_status" : os .environ .get (
130+ "HEALTHCHECK_ID_DELETE_UNUSED_HARDWARE_STATUS" , ""
131+ ),
132+ "notifications_hardware_summary" : os .environ .get (
133+ "HEALTHCHECK_ID_NOTIFICATIONS_HARDWARE_SUMMARY" , ""
134+ ),
135+ "notifications_metrics_summary" : os .environ .get (
136+ "HEALTHCHECK_ID_NOTIFICATIONS_METRICS_SUMMARY" , ""
137+ ),
138+ "notifications_new_issues" : os .environ .get (
139+ "HEALTHCHECK_ID_NOTIFICATIONS_NEW_ISSUES" , ""
140+ ),
141+ "notifications_summary_microsoft" : os .environ .get (
142+ "HEALTHCHECK_ID_NOTIFICATIONS_SUMMARY_MICROSOFT" , ""
143+ ),
144+ "notifications_summary_maestro" : os .environ .get (
145+ "HEALTHCHECK_ID_NOTIFICATIONS_SUMMARY_MAESTRO" , ""
146+ ),
147+ }
148+ """Maps monitoring_id to the relative_path that will be appended to the base healthcheck URL."""
149+
127150SKIP_CRONJOBS = is_boolean_or_string_true (os .environ .get ("SKIP_CRONJOBS" , False ))
128151if SKIP_CRONJOBS :
129152 CRONJOBS = []
@@ -133,12 +156,15 @@ def get_json_env_var(name, default):
133156 "CRONTAB_COMMAND_SUFFIX" , ">> /proc/1/fd/1 2>&1"
134157 )
135158 CRONJOBS = [
159+ # not using a monitoring_id in the first task since it should
160+ # be removed once the denormalization is set in stone
136161 ("0 * * * *" , "kernelCI_app.tasks.update_checkout_cache" ),
137162 (
138163 "59 * * * *" ,
139164 "django.core.management.call_command" ,
140165 [
141166 "notifications" ,
167+ "--monitoring-id=notifications_new_issues" ,
142168 "--action=new_issues" ,
143169 "--to=kernelci-results@groups.io" ,
144170 "--cc=gus@collabora.com" ,
@@ -151,6 +177,7 @@ def get_json_env_var(name, default):
151177 "django.core.management.call_command" ,
152178 [
153179 "notifications" ,
180+ "--monitoring-id=notifications_summary_microsoft" ,
154181 "--action=summary" ,
155182 "--to=kernelcialerts@microsoft.com" ,
156183 "--cc=kernelci-results@groups.io" ,
@@ -165,6 +192,7 @@ def get_json_env_var(name, default):
165192 "django.core.management.call_command" ,
166193 [
167194 "notifications" ,
195+ "--monitoring-id=notifications_summary_maestro" ,
168196 "--action=summary" ,
169197 "--add-mailing-lists" ,
170198 "--send" ,
@@ -177,6 +205,7 @@ def get_json_env_var(name, default):
177205 "django.core.management.call_command" ,
178206 [
179207 "notifications" ,
208+ "--monitoring-id=notifications_hardware_summary" ,
180209 "--action=hardware_summary" ,
181210 "--cc=kernelci-results@groups.io" ,
182211 "--send" ,
@@ -188,13 +217,15 @@ def get_json_env_var(name, default):
188217 "django.core.management.call_command" ,
189218 [
190219 "delete_unused_hardware_status" ,
220+ "--monitoring-id=delete_unused_hardware_status" ,
191221 ],
192222 ),
193223 (
194224 "0 0 * * 6" ,
195225 "django.core.management.call_command" ,
196226 [
197227 "notifications" ,
228+ "--monitoring-id=notifications_metrics_summary" ,
198229 "--action=metrics_summary" ,
199230 "--to=kernelci@lists.linux.dev" ,
200231 "--cc=kernelci-results@groups.io" ,
0 commit comments