Skip to content
GitLab Next
  • Menu
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,253
    • Issues 44,253
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,587
    • Merge requests 1,587
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & 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
  • #32107
Closed
Open
Created Sep 16, 2019 by Tim Rizzi@trizziDeveloper

API to delete files from a package

Release notes

You use the GitLab Package Registry to publish, install and share your dependencies. You may do this using a variety of package manager formats, such as Maven or npm. If you are doing this as part of your CI workflow, you may publish many packages to your registry. When you publish a dependency, it generates several files including the package archive.

The problem is that GitLab doesn't provide a way to delete the files from a package, only the package itself. These extra files can clutter the user interface or worse result in someone installing an incorrect or outdated dependency.

Moving forward, you can now use the Packages API to delete files related to a given package as well as the package itself.

Problem to solve

When packages are published to the GitLab Package Registry, there are several files uploaded to the registry. The file type and the number of files vary based on format, when you upload a package to the registry, files are generally uploaded.

These files are displayed in the application when you view a package's details. The problem is that we do not currently provide a way to delete the files only the packages themselves. As a given package/version can have many files, it can result in confusion when downloading files, result in user error, or just clutter the user interface.

Proposal

As a Developer (or above), I'd like to be able to use the Packages API to delete specific files from a given package. This will be especially useful for removing branch-related packages uploaded to my registry during the build phase.

Following the current delete a package API, maybe implement something like:

DELETE /projects/:id/packages/:package_id/package_files/:package_file_id

Which would mean adding new attributes for file type file name.

Documentation

By giving a way to delete package files, users can "corrupt" or "damage" a given package where an expected package file is missing. We will make it clear that this is the case in the Package documentation.

Measuring success

As a new feature, I'm most interested in adoption. So even a basic activity metric like the number of times it was used on GitLab.com would be helpful directionally.

Edited Apr 20, 2021 by Tim Rizzi
Assignee
Assign to
Time tracking