Skip to content

[Bug][DORA] Webhook incidents do not appear #5886

@skucherenko-voxel

Description

@skucherenko-voxel

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

After pushing some incidents via a webhook, they do not appear in the following chart:
Step 1. All types of issues in table.issues (rows with 2 green columns will be used to construct project_issue_metrics)

What do you expect to happen

They should appear in some way, for instance:
image

How to reproduce

Environment:

Have a new project. with repos (GitHub in my case) and builds to it (Jenkins in my case). Create a webhook for issues and include it to the project.

Steps

  1. Publish some incidents via the webhook. Postman with a JSON like this as a body gets the job done:
{
"id": "webhook:1",
"issue_key": "123123",
"title": "a feature from ABC",
"status": "DONE",
"original_status": "created",
"created_date": "2023-08-08T15:00:00+01:00",
"lead_time_minutes": 360,
"type": "INCIDENT"
}
  1. Hit "Collect all data" in Devlake
  2. In Grafana, navigate to the DORA Dashboard Validation dashboard and go to Step 1. All types of issues in table.issues (rows with 2 green columns will be used to construct project_issue_metrics) chart.
  3. See if the chart is empty

Anything else

The issue is caused by a conditional in the SQL script behind the chart:

-- get the incident created within the selected time period in the top-right corner
SELECT
	pm.project_name,
	IF(pm.project_name in ($project),'This project is selected','Not Selected') as select_status,
	i._raw_data_table,
	i.type, 
	count(1) as issue_count
FROM
	issues i
  join board_issues bi on i.id = bi.issue_id
  join boards b on bi.board_id = b.id
  join project_mapping pm on b.id = pm.row_id ------------------------> and pm.`table` = 'boards' <---------------------- the failing part
WHERE
  pm.project_name in ($project)
 	and i.type = 'INCIDENT'
	and $__timeFilter(i.created_date)
GROUP BY pm.project_name, select_status,i._raw_data_table, i.type

As Louis Zhang suggests, the issue gets solved with replacing

and pm.`table` = 'boards'

by

and pm.`table` = 'cicd_scopes'

Version

v0.18.0-beta3

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Labels

type/bugThis issue is a bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions