Skip to content

fix(gitlab): always re-collect MR commits regardless of MR updated_at…#8959

Open
bujjibabukatta wants to merge 1 commit into
apache:mainfrom
bujjibabukatta:fix/#8818
Open

fix(gitlab): always re-collect MR commits regardless of MR updated_at…#8959
bujjibabukatta wants to merge 1 commit into
apache:mainfrom
bujjibabukatta:fix/#8818

Conversation

@bujjibabukatta

Copy link
Copy Markdown
Contributor

When running incremental collection, GetMergeRequestsIterator filters merge requests using gitlabupdatedat > since.
When running incremental collection, GetMergeRequestsIterator filters merge requests using gitlab_updated_at > since. This works fine for notes and reviews — if the MR hasn't been touched, nothing new to collect. But for commits it's the wrong filter. Pushing new commits to a MR's source branch doesn't update gitlab_updated_at on the MR itself, so those MRs get skipped entirely and their new commits are never fetched. This is exactly why full refresh works but normal collect misses data.
The fix is to pass nil instead of apiCollector when calling GetMergeRequestsIterator in the commit collector. Passing nil skips the time filter so every MR is scanned for commits on each run, matching full refresh behaviour. The MR commits endpoint is lightweight so the performance impact is minimal. Notes and reviews collectors are unchanged — they still pass apiCollector and keep their incremental filtering, which is correct for those entities.

… to prevent missing commits in incremental runs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant