Skip to content

Add ProjectBuild.erase() #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 3, 2016

Conversation

JonathonReinhart
Copy link
Contributor

@JonathonReinhart JonathonReinhart commented Oct 2, 2016

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
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
Contributor

Looks good to me, thanks!

@JonathonReinhart
Copy link
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
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