feat(gitlab): sync repository files (code/docs)#4864
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Listing runs a new Reviewed by Cursor Bugbot for commit 3e103b4. Configure here. |
Greptile SummaryThis PR adds repository-file sync (code/docs) to the GitLab connector, closing a feature-parity gap with the GitHub connector. Five content-type options are introduced (
Confidence Score: 4/5Safe to merge for all listing and content-fetch paths; the one rough edge is that file documents fetched via getDocument may expose a raw API URL instead of the human-friendly web UI URL when projectPath has not been populated by a prior listDocuments call. The phase state machine, keyset pagination, binary/size guards, and blob-SHA change detection are all implemented correctly. The two issues flagged in the previous review round are confirmed fixed. The outstanding concern — projectPath being read from syncContext before resolveRef can populate it inside getDocument — means the sourceUrl on lazily-fetched file documents will fall back to the raw API endpoint rather than the web UI link whenever getDocument runs without a pre-warmed syncContext. apps/sim/connectors/gitlab/gitlab.ts — specifically the getDocument handler for FILE_PREFIX documents, where projectPath is captured before resolveRef runs. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A([listDocuments called]) --> B{phases from choice?}
B -- empty --> Z([return empty])
B -- non-empty --> C[decode cursor / reset if invalid]
C --> D{state.phase}
D -- repo --> E[resolveRef]
E --> F[fetch tree page]
F --> G{ok?}
G -- 403/404 --> H[warn + advance]
G -- error --> I([throw])
G -- ok --> J[filter pathPrefix + ext]
J --> K[applyMaxItemsCap]
K -- capped --> L([hasMore=false])
K -- ok --> M{rel=next link?}
M -- yes --> N([nextCursor=repo+url])
M -- no --> O[advance phase]
D -- wiki --> P[fetch wiki pages]
P --> Q{ok?}
Q -- 403/404 --> H
Q -- error --> I
Q -- ok --> R[build docs] --> O
D -- issues --> S[fetch issues page]
S --> T[build docs]
T --> U{more pages?}
U -- yes --> V([nextCursor=issues+page])
U -- no --> W([hasMore=false])
O --> X{next phase?}
X -- yes --> Y([nextCursor=phase])
X -- no --> W
Reviews (6): Last reviewed commit: "fix(gitlab): skip repo phase on tree 403..." | Re-trigger Greptile |
…ed wiki gracefully in all/both
…fallback, normalize pathPrefix to directory boundary
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 46b7c0e. Configure here.
|
Fixed in c3bd177. |
|
@greptile |
|
@cursor review |
… user branch exists at setup instead
|
@greptile |
|
@cursor review |
…s are accepted, not just branches
|
@greptile |
|
@cursor review |
… wiki/issues still sync under all
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 3e103b4. Configure here.
The Ollama BYOK icon rendered blank because its SVG path had spaces stripped between arc-command flags (e.g. `a5.05 5.05 0 12.05-.636`), producing invalid tokens. Replaced with the canonical Ollama path. Also added a dedicated FalIcon (was falling back to the generic ImageIcon) and wired it into the BYOK provider list. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The leftmost spark of the Fireworks icon never rendered because its third subpath used a corrupted arc command (`a34.59 34.59 0 17.15 37.65`) with collapsed flags, yielding an invalid sweep-flag of 7 that aborts the path parse. Replaced with the canonical lobehub Fireworks source. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Summary
/docs/*.md, or source. This closes that parity gap.contentTypesoptions: Code, Wiki & Issues / Code only / Wiki only / Issues only / Wiki & Issues (legacybothpreserved = wiki+issues, so existing connectors are unchanged)page_token), filters bypathPrefix+fileExtensions, and lazily fetches content per fileref, defaults to the project default branch), Path Filter, File Extensionstree entry.idon listing ==blob_idon fetch) — identical stub↔getDocument hash, no content fetch during listing (mirrors the GitHub connector)path+sizetagsType of Change
Testing
Verified every endpoint/field against the live GitLab API docs (repository tree keyset pagination + Link
page_token; files endpointblob_id/base64content; blob-SHA identity between tree and files). Type-check clean, lint clean, 100 connector tests pass. Not exercised against a live GitLab project (no test token).Checklist