-
Notifications
You must be signed in to change notification settings - Fork 551
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
[Bug][GitLab] Missing the notes of Merge Request #8255
Comments
The issue you're encountering is due to the current implementation of the To address this and include notes from closed or merged merge requests, you would need to modify the func GetMergeRequestsIterator(taskCtx plugin.SubTaskContext, apiCollector *api.StatefulApiCollector) (*api.DalCursorIterator, errors.Error) {
db := taskCtx.GetDal()
data := taskCtx.GetData().(*GitlabTaskData)
clauses := []dal.Clause{
dal.Select("gmr.gitlab_id, gmr.iid"),
dal.From("_tool_gitlab_merge_requests gmr"),
// collect notes and commits for opened, closed, and merged merge requests
dal.Where(
`gmr.project_id = ? and gmr.connection_id = ? AND state IN (?, ?, ?)`,
data.Options.ProjectId, data.Options.ConnectionId, "opened", "closed", "merged",
),
}
if apiCollector != nil {
if apiCollector.GetSince() != nil {
clauses = append(clauses, dal.Where("gitlab_updated_at > ?", *apiCollector.GetSince()))
}
}
// construct the input iterator
cursor, err := db.Cursor(clauses...)
if err != nil {
return nil, err
}
return api.NewDalCursorIterator(db, cursor, reflect.TypeOf(GitlabInput{}))
} This change will allow the collection of notes from all states of merge requests, ensuring that historical and lifecycle-complete notes are included in the data collection process [1]. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
This bug breaks DORA cycle time metrics. Only using open merge requests to collect merge commits and notes/comments means that it is not possible to calculate meaningful and actionable metrics. It was introduced in this pull request #7997 and looks to be in release 1.0.2 beta 4 onwards. Specific commit: 191f2e6 Relatively easy to reverse this change through removal of the "state =" clause, which I have briefly confirmed works in a limited test env. |
Yes, I have the same problem with task Collect MR Commits. |
I've been running with this commit reverted for a week - it has fixed all the Dora metrics, mr pickup times, and other stats. It does run longer due to collecting more information - but is necessary for accurate data. |
We have released a new beta version v1.0.2-beta6, just have a try. @klesh @hippojay @usharerose @karpanin |
Search before asking
What happened
Some merge requests themselves have been collected, but their notes (comments) are missing.
It seems that only opened Merge Request would be the input of mr_notes_collector (reference), which means the following MRs' note data would not be collected
What do you expect to happen
The notes have been collected
How to reproduce
Collect any GitLab project with merged or closed MRs, those MRs' related notes would be missing.
Anything else
No response
Version
v1.0
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: