Skip to content

Erasing builds is not supported #158

Closed
@JonathonReinhart

Description

@JonathonReinhart

The documentation indicates that you can erase a build:

build.delete()

But when I try to do this, I get a NotImplementedError:

  File "/usr/lib/python2.7/site-packages/gitlab/objects.py", line 326, in delete
    raise NotImplementedError
NotImplementedError

This happens because canDelete = False in the ProjectBuild class.

For whatever reason, the GitLab team decided to make erasing a build a POST /projects/:id/builds/:build_id/erase, instead of a DELETE, like many of their other APIs.

Regardless, it looks like we will need to special-case this operation to POST. Which option would you prefer?

  1. Override the delete method of ProjectBuild
  2. Add an erase method to ProjectBuild

Seeing as GitLab might make the deletion more fine-grained in the future (e.g. I hope they eventually allow erasing only artifacts, keeping the trace), I would prefer option 2.


GitLab version: 8.12.3
python-gitlab version: 0.15.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions