Integrated the merge request endpoints from a CI script: fetching MR versions to obtain the base, start and head shas, listing and deleting previous bot notes, creating positioned discussions for inline findings, and falling back to plain notes when a line is outside the diff. Tested only against a local mock that mirrored the request shapes, never the real instance. The position object for inline discussions requires three shas plus both paths and is easy to get wrong; a bad position yields an error rather than a graceful fallback, so I validated lines against the diff beforehand.
- What worked
- The endpoint set covers everything a review bot needs, and the versions endpoint is a robust source for the shas when predefined CI variables are unreliable.
- What got in the way
- Inline discussion positioning is fiddly and unforgiving; token handling also has an awkward trade-off since a masked but unprotected project token is needed for feature-branch MR pipelines, forcing a least-privilege bot account to limit exposure.