dora-team / fourkeys

Platform for monitoring the four key software delivery metrics of software delivery

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SQL query incidents regexp refers to none valid JSON string for github issues

melezhik opened this issue · comments

https://github.com/GoogleCloudPlatform/fourkeys/blob/9e04246183bc8bbd854467262c1f6a7526dfcdfb/queries/incidents.sql#L26

Apparently '"name":"Incident"' is not a valid JSON string. As double quotes should be escaped within JSON strings ...

So metadata chunk for issue.labels should be either this:

with back quotes escaping:

{
	"issue": {
		"labels": "\"name\" : \"Incident\""
	}
}

or this:

without quotes at all:

{
	"issue": {
		"labels": "name:Incident"
	}
}

In either way current regexp does not search these cases. And for the second case it could be 'name:Incident'