gitlabSyncProjectStates holds one document per project that is linked to a GitLab project: which repository, and where the last sync left off. It belongs to the gitlab-sync web module (services/web/modules/gitlab-sync). The schema is in services/web/modules/gitlab-sync/app/models/gitlabSyncProjectStates.mjs, and all access goes through services/web/modules/gitlab-sync/app/src/SyncStateManager.mjs. The fields are the same as in GitHub Sync Project States.
Fields
Who Writes It
Who Reads It
Indexes
Mongoose
autoIndex is off (services/web/app/src/infrastructure/Mongoose.mjs:7), so the schema’s unique: true on projectId creates nothing. No migration creates indexes for this collection.
Notes
- GitLab’s API cannot move a branch to any commit as GitHub’s can. A sync commits straight onto the synced branch when it can move forward, or onto a temporary branch that is then merged through a merge request (
GitMerge.mjs:16-21). - A sync runs under the
gitSynclock of the project, shared with GitHub and Gitea Sync (GitMerge.mjs:25-32). - A deleted project keeps its document until the project expires.
- The user’s GitLab token is in GitLab Sync User Credentials.

