chore: remove unused Worker artifacts#179
Conversation
Greptile SummaryThis PR removes stale Cloudflare Worker artifacts (
Confidence Score: 5/5Safe to merge; all deleted and modified files are confirmed unused, with no impact on the active worker entrypoint or deployment pipeline. Every deletion is backed by cross-checked evidence:
Important Files Changed
Reviews (2): Last reviewed commit: "Keep GitHub App cleanup separate" | Re-trigger Greptile |
There was a problem hiding this comment.
Code Review
This pull request removes the Cloudflare Worker implementation and associated GitHub App integration components. Key changes include the deletion of the worker directory, the removal of the GitHub webhook handler, and the decommissioning of the recordUsage functionality in scripts/github-token.js. Additionally, several GitHub-related environment variables and secrets have been removed from the configuration and type definitions. I have no feedback to provide as there were no review comments.
|
Follow-up commit cac864a narrows this PR to Worker/config cleanup only. The GitHub App webhook/deploy-script cleanup from the original draft was restored here and split into #181, so this PR now deletes only |
There was a problem hiding this comment.
Pull request overview
Removes stale Cloudflare Worker artifacts and related tooling references that are no longer part of the active Astro SSR + root wrangler.jsonc deployment flow, and trims dead token-manager helper code for an unimplemented /api/token/usage endpoint.
Changes:
- Delete the obsolete Worker entrypoint (
worker/index.ts) and the stale per-webwrangler.jsonc. - Narrow TypeScript / hk
tscglobs to exclude removed Worker sources. - Remove the unused
recordUsage()helper and related CLI/action references fromscripts/github-token.js.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
worker/index.ts |
Deletes the deprecated Worker entrypoint wrapper. |
web/wrangler.jsonc |
Removes a stale, unused per-package Wrangler config. |
tsconfig.json |
Removes worker/**/* from root TypeScript include globs. |
scripts/github-token.js |
Removes dead recordUsage() helper and related exports/messages. |
hk.pkl |
Updates hk tsc glob to only cover src/**/*.ts. |
.github/workflows/deploy.yml |
Removes worker/** from deploy workflow path filters. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What changed
worker/index.ts, the stale Worker entrypoint that is no longer referenced by the active rootwrangler.jsonc.web/wrangler.jsonc, a stale per-web-directory worker config with a different worker name and bindings not used by the root deployment flow.worker/**from deploy path filters and removeworker/**/*from root TypeScript/hk globs.recordUsage()fromscripts/github-token.jsbecause it posts to/api/token/usage, but that route is absent and current token checkout/rate-limit handling uses/api/tokenand/api/token/rate-limit.History
c2f0eb18(init, 2025-12-15) addedworker/index.tsas the original Cloudflare Worker entrypoint and addedrecordUsage()with a planned/api/token/usageflow.f7fc9576(feat: migrate all routes from Worker to Astro SSR, 2025-12-17) moved the Worker route handlers into Astro pages and deleted mostworker/routes/*files, but leftworker/index.tsbehind as a wrapper.a3c67db9(fix: point wrangler directly to Astro output, 2025-12-17) first stopped usingworker/index.tsas the root wrangler entrypoint by pointingmainat Astro output. Later,389d6a5a(Finish Astro 6 Cloudflare runtime migration, 2026-05-01) madesrc/worker.tsthe active custom wrapper for Astro 6. Those commits changed the active entrypoint but did not remove the old worker file, deploy path filter, or TypeScript/hk globs.573b0782(feat: migrate web frontend to Astro SSR, 2025-12-17) addedweb/wrangler.jsoncfor the web package. The deploy workflow has continued to buildweband deploy from the repository root, and rootwrangler.jsoncis now the canonical Cloudflare config, so the web-local wrangler config became a stale parallel config.token_usagetable is created and then dropped by the historical migration list insrc/migrations.ts, and no active Astro route serves/api/token/usage. That makesrecordUsage()dead while leavingget-tokenandmark-rate-limitedintact for the active token pool.Why this is safe
The active deployment path is
.github/workflows/deploy.yml->npm run build -w web->cloudflare/wrangler-actionfrom the repo root -> rootwrangler.jsonc->src/worker.ts. None of those steps referencesworker/index.tsorweb/wrangler.jsonc.The active token manager API still exists and is not removed here:
/api/token,/api/token/rate-limit, token admin pages,src/database.ts, theDBbinding, and token migrations remain. This PR only removes the unused helper for a route that does not exist.GitHub App/webhook cleanup is intentionally split out to #181. This PR leaves
scripts/deploy.sh,/webhooks/github, and GitHub App secret declarations/comments alone so Worker-entrypoint cleanup can be reviewed independently.Compatibility boundaries
This PR does not remove legacy mise version endpoints,
/api/track,/api/tools/:tool, Python precompiled.gzendpoints, token manager API routes,src/database.ts, theDBbinding, admin token pages, or historical migrations.Current mise clients moved from root version endpoints to
/tools/:tool.tomlin jdx/mise#7378, and install tracking moved from/api/trackto/api/tools/:toolin jdx/mise#9527. Those compatibility endpoints are intentionally left in place because old mise versions may still call them.Recent removal of
src/pipelines.ts/MISE_VERSIONS_STREAMmeans this cleanup also does not preserve obsolete Pipeline references.Validation
Passed:
npm run test:jsnpm run test:shellbunx tsc --noEmitnpm run build -w webgit diff --checkrgfound no remaining references toworker/index,web/wrangler,api/token/usage, orrecordUsage.Known unrelated local failure:
cd web && bunx tsc --noEmitfails on upstream's unchanged TypeScript 6baseUrldeprecation before project checking. The production web build passes.