-
Notifications
You must be signed in to change notification settings - Fork 756
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
chore: add d1 and kv to e2e cleanup job #7681
Conversation
|
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12649891388/npm-package-wrangler-7681 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/7681/npm-package-wrangler-7681 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12649891388/npm-package-wrangler-7681 dev path/to/script.js Additional artifacts:wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12649891388/npm-package-cloudflare-workers-bindings-extension-7681 -O ./cloudflare-workers-bindings-extension.0.0.0-v28a0f1b02.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-v28a0f1b02.vsix npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12649891388/npm-package-create-cloudflare-7681 --no-auto-update npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12649891388/npm-package-cloudflare-kv-asset-handler-7681 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12649891388/npm-package-miniflare-7681 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12649891388/npm-package-cloudflare-pages-shared-7681 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12649891388/npm-package-cloudflare-unenv-preset-7681 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12649891388/npm-package-cloudflare-vitest-pool-workers-7681 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12649891388/npm-package-cloudflare-workers-editor-shared-7681 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12649891388/npm-package-cloudflare-workers-shared-7681 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12649891388/npm-package-cloudflare-workflows-shared-7681 Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
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.
Looking good! Just an optimisation comment that might save a fair amount of time if we're doing this a lot.
for (const kvNamespace of kvNamespacesToDelete) { | ||
console.log("Deleting KV namespace: " + kvNamespace.title); | ||
await deleteKVNamespace(kvNamespace.id); | ||
} |
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.
We could potentially save some seconds by doing these deletions in parallel:
const promises = [];
for (const kvNamespace of kvNamespacesToDelete) {
console.log("Deleting KV namespace: " + kvNamespace.title);
promises.push(deleteKVNamespace(kvNamespace.id));
}
await Promise.all(promises);
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.
Would this end up spamming the API too much? I'm not sure what sort of rate limiting there is on there, and while we work through deleting our backlog it might be making a couple hundred calls :') Also this only runs once a day out of EU/US hours, so hopefully CI time shouldn't be a problem. I'm inclined to leave it for now, and if we end up having problems we can revisit it?
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.
Ah, ok. Yeah that makes sense. I thought it was running on each CI run, but if it's out-of-hours then that seems fine 👍
for (const db of d1DatabasesToDelete) { | ||
console.log("Deleting D1 database: " + db.name); | ||
await deleteDatabase(db.uuid); | ||
} |
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.
As above. Unless they rely on each other, I presume we can do these in parallel.
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.
Good stuff!!
Fixes https://jira.cfdata.org/browse/DEVX-1537