Skip to content

Add ProjectBuild.erase() - #159

Merged
gpocentek merged 2 commits into
python-gitlab:masterfrom
JonathonReinhart:158-erase-build
Oct 3, 2016
Merged

Add ProjectBuild.erase()#159
gpocentek merged 2 commits into
python-gitlab:masterfrom
JonathonReinhart:158-erase-build

Conversation

@JonathonReinhart

@JonathonReinhart JonathonReinhart commented Oct 2, 2016

Copy link
Copy Markdown
Contributor

This adds ProjectBuild.erase().

We can't use the existing delete() functionality, because GitLab uses
POST /projects/:id/builds/:build_id/erase to erase a build. Instead of
overriding delete(), we add a separate erase() method to keep the naming
consistent, and allow potentially more fine-grained operations in the
future.

This fixes #158

We can't use the existing delete() functionality, because GitLab uses
`POST /projects/:id/builds/:build_id/erase` to erase a build. Instead of
overriding delete(), we add a separate erase() method to keep the naming
consistent, and allow potentially more fine-grained operations in the
future.

- https://docs.gitlab.com/ce/api/builds.html#erase-a-build
@JonathonReinhart JonathonReinhart changed the title Add ProjectBuild.erase() WIP: Add ProjectBuild.erase() Oct 2, 2016
@JonathonReinhart JonathonReinhart changed the title WIP: Add ProjectBuild.erase() Add ProjectBuild.erase() Oct 2, 2016
@JonathonReinhart

Copy link
Copy Markdown
Contributor Author

There doesn't appear to be anything in place for testing APIs related to builds, so I haven't added any automated tests. However, I have successfully tested this using a script I'm writing (will be released soon), and it works as expected.

JonathonReinhart added a commit to JonathonReinhart/gitlab-artifact-cleanup that referenced this pull request Oct 2, 2016
Note: This requires using the erase() method that I added to python-gitlab:
python-gitlab/python-gitlab#159
@gpocentek

Copy link
Copy Markdown
Contributor

Looks good to me, thanks!

@JonathonReinhart

Copy link
Copy Markdown
Contributor Author

@gpocentek Thanks for merging! Any chance this will make it into an official release any time soon? My tool JonathonReinhart/gitlab-artifact-cleanup requires it, and I'm looking to put it on PyPi soon, so it would be great to be able to set a proper minimum version requirement. Currently I'm monkey-patching this functionality in if I find that it is missing.

Also FYI: you're missing a 0.15.1 tag.

@gpocentek

Copy link
Copy Markdown
Contributor

@JonathonReinhart 0.15.1 is tagged and I'm preparing the 0.16 release.

JonathonReinhart added a commit to JonathonReinhart/gitlab-artifact-cleanup that referenced this pull request Oct 16, 2016
This is required for ProjectBuild.erase()

python-gitlab/python-gitlab#159
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Erasing builds is not supported

2 participants