Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more log for dora task ConnectIncidentToDeployment #7856

Merged
merged 4 commits into from
Aug 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions backend/plugins/dora/tasks/incident_deploy_connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,19 @@ func ConnectIncidentToDeployment(taskCtx plugin.SubTaskContext) errors.Error {
logger.Info("delete previous project_incident_deployment_relationships")
// select all issues belongs to the board
clauses := []dal.Clause{
dal.Select(`i.*`),
dal.From(`incidents i`),
dal.Join(`left join project_mapping pm on pm.row_id = i.scope_id and pm.table = i.table`),
dal.Where("pm.project_name = ?", data.Options.ProjectName),
}

count, err := db.Count(clauses...)
if err != nil {
logger.Error(err, "count incidents")
} else {
logger.Info("incident count is %d", count)
}

cursor, err := db.Cursor(clauses...)
if err != nil {
logger.Error(err, "db.cursor error")
Expand Down
Loading