Renames CodeSuggestions namespace terminologies and updates test coverage
What does this MR do and why?
This MR addresses #431318 (closed)
Currently, in different parts of the CodeSuggestions namespace, we use various terms to interchangeably represent the same concept, which can lead to confusion.
In this MR, we have renamed the prefix
and suffix
terminologies to content_above_cursor
and content_below_cursor
respectively to bring more consistency and improve the readability, maintainability and collaboration within the CodeSuggestions namespace in the codebase.
Update
We're also updating some of the related test files to add test coverage for previously untested methods which were causing the pipeline to fail, namely pick_content_above_cursor
and pick_content_below_cursor
methods in ai_gateway_code_completion_message.rb and ai_gateway_self_hosted_messages.rb
Since we are only picking the last and first 500 characters in pick_content_above_cursor
and pick_content_below_cursor
methods respectively, I thought it'd be useful to adjust the set up to test that we're only picking the first and last 500 characters in each method.
I considered adjusting these tests in a separate MR in the spirit of iteration
but made the decision to make the change in this MR directly as it was closely related to the renaming.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.