Skip to content

GitLab Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
GitLab
GitLab
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 34,985
    • Issues 34,985
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 1,269
    • Merge Requests 1,269
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Metrics
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GitLab.org
  • GitLabGitLab
  • Issues
  • #34521

Closed
Open
Opened Oct 21, 2019 by Markus Koller@toupeira💡Maintainer

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
Backlog
Milestone
Backlog
Assign milestone
Time tracking
None
Due date
None
Reference: gitlab-org/gitlab#34521