Skip to content
GitLab
Next
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 44,761
    • Issues 44,761
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,332
    • Merge requests 1,332
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #34521
Closed
Open
Issue created Oct 21, 2019 by Markus Koller@toupeira🌴Contributor

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.

Intended users

API consumers of the search API.

Further details

Proposal

  • Change API::Entities::Blob to 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

Documentation

This breaking API change should be communicated.

Testing

What does success look like, and how can we measure that?

What is the type of buyer?

Links / references

Assignee
Assign to
Time tracking