This is an automated email from the ASF dual-hosted git repository.
klesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/devlake.git
The following commit(s) were added to refs/heads/main by this push:
new b005e6ffb fix(gitlab): always re-collect MR commits regardless of MR
updated_at… (#8959)
b005e6ffb is described below
commit b005e6ffb66ea098a4e2a4d3a6761684637750f0
Author: bujjibabukatta <[email protected]>
AuthorDate: Wed Aug 12 04:19:05 2026 -0400
fix(gitlab): always re-collect MR commits regardless of MR updated_at…
(#8959)
* fix(gitlab): always re-collect MR commits regardless of MR updated_at to
prevent missing commits in incremental runs
* fix(gitlab): correct if-brace syntax in GetMergeRequestsIterator
---
backend/plugins/gitlab/tasks/shared.go | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/backend/plugins/gitlab/tasks/shared.go
b/backend/plugins/gitlab/tasks/shared.go
index 6621ba3f2..eac88b66f 100644
--- a/backend/plugins/gitlab/tasks/shared.go
+++ b/backend/plugins/gitlab/tasks/shared.go
@@ -195,7 +195,14 @@ func GetMergeRequestsIterator(taskCtx
plugin.SubTaskContext, apiCollector *api.S
}
if apiCollector != nil {
if apiCollector.GetSince() != nil {
- clauses = append(clauses, dal.Where("gitlab_updated_at
> ?", *apiCollector.GetSince()))
+ // Filter by the LATER of gitlab_updated_at or
commit_updated_at.
+ // Using only gitlab_updated_at misses MRs where new
commits were pushed
+ // without the MR itself being updated (e.g.
force-pushed commits).
+ // COALESCE handles MRs with no recorded
commit_updated_at.
+ clauses = append(clauses, dal.Where(
+ `GREATEST(gmr.gitlab_updated_at,
COALESCE(gmr.commit_updated_at, gmr.gitlab_updated_at)) > ?`,
+ *apiCollector.GetSince(),
+ ))
}
}
// construct the input iterator