Return filename without path in search API
Problem to solve
The search API returns the full path of found blobs in the
filename response field.
For 12.5, !18470 (merged) renamed this field to
path to be consistent with the Elasticsearch index (gitlab-elasticsearch-indexer!44 (merged)), but also kept returning the full path in
filename to avoid breaking backwards-compatibility with API consumers.
At some point in the future, we can change
filename to return only the filename without the leading directory path.
API consumers of the search API.
API::Entities::Blobto return only the filename in
filename, without the leading directory path
- Since these blobs can come from either ES or Gitaly searches, it's probably easiest to implement the path-stripping again in
Gitlab::Search::FoundBlob, even though we already have the basename available in the ES document.
Permissions and Security
This breaking API change should be communicated.