Missing apis for worker versions?
I am working to setup deployment workflows, deploying preview versions with alias.
I got everything setup and its working great!
However, I cannot find any apis to get, delete or list these uploaded versions.
When listing deployments from this endpoint: https://developers.cloudflare.com/api/resources/workers/subresources/scripts/subresources/deployments/methods/list/
I do not see the the deployments from a versions uploads
Deployments do however have a
versions
property, however this property only has 1 element in its list.
Our devops would like to clean up old version uploads once its no longer needed, are there any plans to give us apis to get, delete and list versions?5 Replies
I can see versions clearly in the api integrated into the cloudflare dashboard, with the tags and message I added.
I already tagged deployments with their pullrequest ID, making it easy for me to grab these when a pull request is deleted, and delete them.
Cloudflare API | Workers › Scripts › Versions › List Versions
Interact with Cloudflare's products and services via the Cloudflare API
Yes! There is however no delete endpoint, which makes sense, since there is no delete button in the dashboard.
So, I guess my question is, how do I clean up these versions?
Checking with the team
Reading the docs I can not find anything about deleting versions.
What I was hoping for was that it worked similar to pages preview deployments, however that does not seem to be the case.
And there are some limits on versions and preview aliases which would make it tricky to use in practise.
https://developers.cloudflare.com/workers/configuration/previews/#limitations
Preview URLs are not generated for Workers that implement a Durable Object.Well, that sucks. But I guess that makes sense, neither did pages, but I would assume a binded Durable Object would still work, as it does with a pages preview. https://developers.cloudflare.com/workers/configuration/versions-and-deployments/#versions
State changes for associated Workers storage resources such as KV, R2, Durable Objects and D1 are not tracked with versions.So, these resources would just not accept writes? My connected KV, and D1 bindings accepts writes in pages previews I know Cloudflare is working to bridge the gap between workers and pages, and creating a pages app gives me this note
We recommend using Cloudflare Workers for new projects. See how Workers compares to Pages in our compatibility matrixPreviews deployments is the only thing stopping us from using workers in new projects, and I was hoping alias versions would solve that issue