fix(gitlab): always re-collect MR commits regardless of MR updated_at…#8959
Open
bujjibabukatta wants to merge 1 commit into
Open
fix(gitlab): always re-collect MR commits regardless of MR updated_at…#8959bujjibabukatta wants to merge 1 commit into
bujjibabukatta wants to merge 1 commit into
Conversation
… to prevent missing commits in incremental runs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.