[Integration][Gitlab-v2] Incremental sync POC - #3606
Conversation
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit bfdad4d. Configure here.
| return GITLAB_INCREMENTAL.merge_params(params, cursor) | ||
| if state != "opened": | ||
| params["updated_after"] = lookback_updated_after | ||
| return params |
There was a problem hiding this comment.
Inconsistent updated_after type in merge request params
Low Severity
build_merge_request_params stores updated_after as a raw datetime object on the full-resync path (line 56) but as a pre-formatted string via GITLAB_INCREMENTAL.merge_params on the incremental path (line 54). When httpx serializes a datetime via str(), it produces "2026-04-01 00:00:00+00:00" (space-separated), whereas the incremental path produces "2026-04-01T12:00:00Z" (T-separated). This inconsistency within a single function makes it harder to reason about the API contract and could cause subtle issues if GitLab's parser is strict about the format in some contexts. The lookback_updated_after datetime ought to be formatted the same way the strategy formats cursors.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit bfdad4d. Configure here.


Description
What -
Why -
How -
Type of change
Please leave one option from the following and delete the rest:
All tests should be run against the port production environment(using a testing org).
Core testing checklist
Integration testing checklist
examplesfolder in the integration directory.Preflight checklist
Screenshots
Include screenshots from your environment showing how the resources of the integration will look.
API Documentation
Provide links to the API documentation used for this integration.
Note
Medium Risk
Incremental sync changes which entities are fetched on scheduled resyncs (cursor vs full/lookback behavior), including opened merge requests; incorrect cursor handling could miss updates or over-fetch until caught in testing.
Overview
Turns on incremental sync for the GitLab v2 SaaS integration and wires resync handlers to pass GitLab’s
updated_afterfilter from Ocean’s incremental cursor.A new
gitlab/helpers/incremental.pylayer usesServerSideTimestampStrategyand helpers to merge the cursor into API params. Projects also getorder_by=updated_at, and incremental filtering is skipped when project search queries are configured (GitLab list-endpoint limitation). Merge requests now apply the cursor to every state (includingopened) on incremental runs; full resync still uses selector lookback only for non-openedstates.@ocean.on_incremental_resyncis added alongside existing@ocean.on_resyncfor projects, issues, pipelines, merge requests, and deployments. Unit tests cover the incremental param builders.Reviewed by Cursor Bugbot for commit bfdad4d. Configure here.