[go: up one dir, main page]

Skip to content

Add error handling for inline blame GraphQL query

What does this MR do?

Adds error handling to the inline blame GraphQL query used in two components:

  • simple_viewer.vue
  • source_viewer.vue

Previously, if the blame query failed, it would fail silently without any user feedback. Now users see a clear error message when the blame information cannot be loaded.

Issue: #568003

Changes

  • Added try-catch blocks around the blame GraphQL query in both components
  • Display flash message "Failed to load blame information" when query fails
  • Added test coverage for error scenarios
  • Uses GitLab's standard createAlert

Testing Steps

Manual Testing

  1. Enable inline_blame feature flag
  2. Navigate to any file in the repository
  3. Click the "Blame" button to enable blame view
  4. To test error handling:
    • Open browser dev tools → Network tab
    • Enable "Offline" mode or block GraphQL requests or add ignore_revs=true param if ignore revs file not available
    • Click "Blame" button again
    • Verify that a flash message appears: "Failed to load blame information"
    • Disable offline mode and verify blame works normally again

Screenshots

Screenshot_2025-10-22_at_11.55.05

Edited by Jacques Erasmus

Merge request reports

Loading