-
-
Notifications
You must be signed in to change notification settings - Fork 370
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
Add DeletePipeline API #3506
Add DeletePipeline API #3506
Conversation
Deployment of preview was successful: https://woodpecker-ci-woodpecker-pr-3506.surge.sh |
Will add some more tests for the delete API later today. |
Should we prevent deleting active pipelines through the exposed |
☝️ yes & pending ... as they have to be removed from task queue |
I have added a helper function to check the status and applied it to DeletePipelineLogs as well. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3506 +/- ##
==========================================
+ Coverage 36.04% 36.08% +0.03%
==========================================
Files 229 229
Lines 15493 15565 +72
==========================================
+ Hits 5585 5616 +31
- Misses 9502 9538 +36
- Partials 406 411 +5 ☔ View full report in Codecov by Sentry. |
In general, yes. My DB is growing constantly already.
I would like to separate this. First, let's get the API changes merged. After that, we can add UI components, CLI, etc. Note: These APIs are about deleting the entire pipeline, not only it logs. |
In addition to this, an API |
I think the same would be of value for the woodpecker project (and probably most others) as well. We normally care about the last 100 pipelines, but I can't imagine looking at pipelines from the last year etc. |
One think I am wondering is, would it be cleaner to have a delete-pipeline endpoint instead of delete-pipelines (as that could be used to delete a single pipeline) similar to delete pipeline-logs of a single pipeline etc. And then the get endpoint with time filters could be used to get all pipelines before and after x and delete them with a script etc by using their id? |
I would like to avoid extra scripting around it. However, I can also add |
@woodpecker-ci/maintainers Anything missing for this? |
I see, but shouldn't we then integrate a cron job doing that based on a setting into wp directly then?
It feels quite powerful to me having an endpoint that could delete all pipelines of a repo. |
Please make a decision and I'll implement it that way then.
Again, yes we can add client integrations (UI, CLI) later please let's get the API changes merged first. |
Co-authored-by: 6543 <m.huber@kithara.com>
Co-authored-by: 6543 <m.huber@kithara.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't test, but seems fine
Separate this change from woodpecker-ci#3506 I would like to get at least this change into v2.5.0 if possible. --------- Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
This is just a first step, the final goal is to have an API endpoint to prune Repo Pipelines older than the given date. @woodpecker-ci/maintainers Can I get some feedback if this is the right direction? --------- Co-authored-by: 6543 <m.huber@kithara.com>
This is just a first step, the final goal is to have an API endpoint to prune Repo Pipelines older than the given date.
@woodpecker-ci/maintainers Can I get some feedback if this is the right direction?