From 8bd2a484d1b621f73b7622378f45ccf8e5783208 Mon Sep 17 00:00:00 2001 From: Raphael Pierzina Date: Thu, 30 May 2024 21:41:06 +0200 Subject: [PATCH] Support abbreviated Git Commit SHAs in incidents.sql --- queries/incidents.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/queries/incidents.sql b/queries/incidents.sql index ca5f7be3..fe915b3e 100644 --- a/queries/incidents.sql +++ b/queries/incidents.sql @@ -87,7 +87,9 @@ LEFT JOIN ( ) AS root ON service_catalog.service = root.service - AND root_cause = root.changes + -- root.changes are full Git Commit SHAs in deployment_status events. + -- root_cause are either full or abbreviated Git Commit SHAs in incident events. + AND STARTS_WITH(root.changes, root_cause) -- GitHub and PagerDuty incidents don't contain information about the environment. -- Google Form incidents are always reported for the `production` environment. -- The following ensures we don't correlate incidents with `staging` deployments.