Common Workflows and Error Handling
Generate MR Review Summary
- Fetch and validate comments:
output=$(scripts/get_mr_comments.sh "$MR_URL") echo "$output" | grep -q "Author:" || { echo "Invalid response — check token and URL"; exit 1; } - Filter by
System: falseto exclude automated messages - Group by author, extract action items and feedback themes
- Generate summary report
Track Review Progress
- Fetch and validate comments:
output=$(scripts/get_mr_comments.sh "$MR_URL") [ -n "$output" ] && echo "$output" | grep -q "Date:" || { echo "Empty or malformed response — check credentials"; exit 1; } - Compare timestamps to identify recent activity
- Flag unresolved DiffNotes and report on response times
Error Handling
401 Unauthorized — Token missing or invalid:
- Check
GITLAB_TOKENorGITLAB_PATis set - Verify token has
read_apiscope
404 Project Not Found — Invalid project path:
- Confirm URL format:
https://gitlab.com/group/project/-/merge_requests/ID - Check token has access to the project
200 OK with an error body — the pitfall neither status code above catches:
- GitLab’s API can return HTTP 200 with a JSON error object in the body (e.g. for a malformed nested query)
- Always check the response shape (does it contain the expected
Author:/Date:fields, or anerror/messagekey?) before treating a 200 response as valid data — this is whyget_mr_comments.sh’s own output format is worth validating field-by-field rather than just checking the exit code