Remove safe navigation on request in MergeRequestBasicEntity

What does this MR do and why?

MergeRequestBasicEntity used request&.current_user when rendering title_html. The entity is only built through MergeRequestSerializer, and BaseSerializer always passes a request, so the safe navigation is not needed. This MR uses request.current_user and removes the "without a request" spec, as suggested in the review of !257816 (merged).

Closes #631851.

References

Follow-up from !257816 (merged).

Screenshots or screen recordings

Not applicable — backend change.

How to set up and validate locally

  1. Run bundle exec rspec spec/serializers/merge_request_basic_entity_spec.rb.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist.

This contribution was prepared with the help of an AI assistant. I reviewed the changes and take responsibility for them.

Merge request reports

Loading
Loading