@@ -124,6 +124,30 @@ 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_BASE_URL = "https://hc-ping.com"
129+ HEALTHCHECK_MONITORING_PATH_MAP : dict [str , str ] = {
130+ "delete_unused_hardware_status" : os .environ .get (
131+ "HEALTHCHECK_ID_DELETE_UNUSED_HARDWARE_STATUS" , ""
132+ ),
133+ "notifications_hardware_summary" : os .environ .get (
134+ "HEALTHCHECK_ID_NOTIFICATIONS_HARDWARE_SUMMARY" , ""
135+ ),
136+ "notifications_metrics_summary" : os .environ .get (
137+ "HEALTHCHECK_ID_NOTIFICATIONS_METRICS_SUMMARY" , ""
138+ ),
139+ "notifications_new_issues" : os .environ .get (
140+ "HEALTHCHECK_ID_NOTIFICATIONS_NEW_ISSUES" , ""
141+ ),
142+ "notifications_summary_microsoft" : os .environ .get (
143+ "HEALTHCHECK_ID_NOTIFICATIONS_SUMMARY_MICROSOFT" , ""
144+ ),
145+ "notifications_summary_maestro" : os .environ .get (
146+ "HEALTHCHECK_ID_NOTIFICATIONS_SUMMARY_MAESTRO" , ""
147+ ),
148+ }
149+ """Maps monitoring_id to the relative_path that will be appended to the base healthcheck URL."""
150+
127151SKIP_CRONJOBS = is_boolean_or_string_true (os .environ .get ("SKIP_CRONJOBS" , False ))
128152if SKIP_CRONJOBS :
129153 CRONJOBS = []
@@ -133,12 +157,15 @@ def get_json_env_var(name, default):
133157 "CRONTAB_COMMAND_SUFFIX" , ">> /proc/1/fd/1 2>&1"
134158 )
135159 CRONJOBS = [
160+ # not using a monitoring_id in the first task since it should
161+ # be removed once the denormalization is set in stone
136162 ("0 * * * *" , "kernelCI_app.tasks.update_checkout_cache" ),
137163 (
138164 "59 * * * *" ,
139165 "django.core.management.call_command" ,
140166 [
141167 "notifications" ,
168+ "--monitoring-id=notifications_new_issues" ,
142169 "--action=new_issues" ,
143170 "--to=kernelci-results@groups.io" ,
144171 "--cc=gus@collabora.com" ,
@@ -151,6 +178,7 @@ def get_json_env_var(name, default):
151178 "django.core.management.call_command" ,
152179 [
153180 "notifications" ,
181+ "--monitoring-id=notifications_summary_microsoft" ,
154182 "--action=summary" ,
155183 "--to=kernelcialerts@microsoft.com" ,
156184 "--cc=kernelci-results@groups.io" ,
@@ -165,6 +193,7 @@ def get_json_env_var(name, default):
165193 "django.core.management.call_command" ,
166194 [
167195 "notifications" ,
196+ "--monitoring-id=notifications_summary_maestro" ,
168197 "--action=summary" ,
169198 "--add-mailing-lists" ,
170199 "--send" ,
@@ -177,6 +206,7 @@ def get_json_env_var(name, default):
177206 "django.core.management.call_command" ,
178207 [
179208 "notifications" ,
209+ "--monitoring-id=notifications_hardware_summary" ,
180210 "--action=hardware_summary" ,
181211 "--cc=kernelci-results@groups.io" ,
182212 "--send" ,
@@ -188,13 +218,15 @@ def get_json_env_var(name, default):
188218 "django.core.management.call_command" ,
189219 [
190220 "delete_unused_hardware_status" ,
221+ "--monitoring-id=delete_unused_hardware_status" ,
191222 ],
192223 ),
193224 (
194225 "0 0 * * 6" ,
195226 "django.core.management.call_command" ,
196227 [
197228 "notifications" ,
229+ "--monitoring-id=notifications_metrics_summary" ,
198230 "--action=metrics_summary" ,
199231 "--to=kernelci@lists.linux.dev" ,
200232 "--cc=kernelci-results@groups.io" ,
0 commit comments