Skip to content

Consolidate shared deps via pnpm catalog and restrict pg to db package#680

Open
iscekic wants to merge 2 commits intomainfrom
chore/catalog-cleanup
Open

Consolidate shared deps via pnpm catalog and restrict pg to db package#680
iscekic wants to merge 2 commits intomainfrom
chore/catalog-cleanup

Conversation

@iscekic
Copy link
Contributor

@iscekic iscekic commented Feb 27, 2026

Summary

  • pnpm catalog expanded to 15 entries: drizzle-orm, zod, hono, typescript, wrangler, jsonwebtoken, @types/jsonwebtoken, prettier, eslint, @eslint/js, @eslint/eslintrc, typescript-eslint, @octokit/auth-app, aws4fetch, workers-tagged-logger — all at latest compatible versions. Eliminates version drift across 21 workspace packages.

  • pg/drizzle-kit restricted to db package: Removed redundant pg from cloudflare-session-ingest, kiloclaw, and cloud-agent-next. Refactored cloud-agent-next to use @kilocode/db + drizzle-orm instead of raw pg.Client, deleting ~300 lines of custom db facade code. The new implementation mirrors the existing cloud-agent service.

  • hono 4.12 compatibility: Added as unknown as MiddlewareHandler cast in cloudflare-webhook-agent-ingest and cloudflare-ai-attribution to bridge a type mismatch between workers-tagged-logger's bundled Handler type and hono 4.12+'s MiddlewareHandler. Upstream issue — runtime is unaffected.

  • prettier 3.8.1 formatting: 9 files reformatted due to prettier upgrade from 3.6.2.

Changed files

Scope Files
Catalog config pnpm-workspace.yaml
package.json updates 21 subpackage package.json files
cloud-agent-next refactor installation-lookup-service.ts rewritten, 7 db files deleted
hono 4.12 compat cloudflare-webhook-agent-ingest/src/index.ts, cloudflare-ai-attribution/src/ai-attribution.worker.ts
Formatting 9 source files (prettier 3.8.1)
Lockfile pnpm-lock.yaml

@iscekic iscekic self-assigned this Feb 27, 2026
@kilo-code-bot
Copy link
Contributor

kilo-code-bot bot commented Feb 27, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Notes

This PR consolidates dependency versions into the pnpm workspace catalog, migrates cloud-agent-next's installation lookup from a custom SQL layer (SqlStore/PlatformIntegrationsStore/node-postgres) to Drizzle ORM via @kilocode/db, and adds as unknown as MiddlewareHandler casts in two cloudflare workers to bridge a hono 4.12+ type incompatibility with workers-tagged-logger.

Key observations:

  • The Drizzle query in installation-lookup-service.ts faithfully reproduces the old raw SQL query logic (same JOIN, WHERE, ORDER BY, LIMIT).
  • All deleted files (SqlStore.ts, database.ts, node-postgres.ts, PlatformIntegrationsStore.ts, table definitions) have no remaining imports — the cleanup is complete.
  • The pg dependency removal from cloud-agent-next and kiloclaw is clean — no dangling imports.
  • The BigInt vs parseInt behavioral change in INT8 parsing (old node-postgres.ts used parseInt, new @kilocode/db/client.ts uses BigInt) does not affect this query since no INT8 columns are selected.
  • Formatting changes (prettier) in several files are cosmetic only.
Files Reviewed (41 files)
  • cloud-agent-next/package.json - catalog migration, added @kilocode/db + drizzle-orm, removed pg/@types/pg
  • cloud-agent-next/src/db/SqlStore.ts - deleted
  • cloud-agent-next/src/db/database.ts - deleted
  • cloud-agent-next/src/db/node-postgres.ts - deleted
  • cloud-agent-next/src/db/stores/PlatformIntegrationsStore.ts - deleted
  • cloud-agent-next/src/db/table.ts - deleted
  • cloud-agent-next/src/db/tables/organization-memberships.table.ts - deleted
  • cloud-agent-next/src/db/tables/platform-integrations.table.ts - deleted
  • cloud-agent-next/src/services/installation-lookup-service.ts - migrated to Drizzle ORM
  • cloud-agent-next/wrapper/package.json - catalog migration
  • cloud-agent/package.json - catalog migration
  • cloud-agent/wrapper/package.json - catalog migration
  • cloudflare-ai-attribution/package.json - catalog migration
  • cloudflare-ai-attribution/src/ai-attribution.worker.ts - hono type cast
  • cloudflare-app-builder/package.json - catalog migration
  • cloudflare-auto-fix-infra/package.json - catalog migration
  • cloudflare-auto-triage-infra/package.json - catalog migration
  • cloudflare-code-review-infra/package.json - catalog migration
  • cloudflare-db-proxy/package.json - catalog migration
  • cloudflare-deploy-infra/builder/package.json - catalog migration
  • cloudflare-deploy-infra/dispatcher/package.json - catalog migration
  • cloudflare-git-token-service/package.json - catalog migration
  • cloudflare-images-mcp/package.json - catalog migration
  • cloudflare-o11y/package.json - catalog migration
  • cloudflare-session-ingest/package.json - catalog migration
  • cloudflare-webhook-agent-ingest/package.json - catalog migration
  • cloudflare-webhook-agent-ingest/src/index.ts - hono type cast
  • kiloclaw/package.json - catalog migration, removed pg
  • package.json - catalog migration
  • packages/db/package.json - catalog migration
  • pnpm-lock.yaml - lockfile update
  • pnpm-workspace.yaml - expanded catalog entries
  • src/components/cloud-agent-next/CloudChatContainer.tsx - formatting
  • src/components/cloud-agent/CloudChatContainer.tsx - formatting
  • src/components/ui/button.tsx - formatting
  • src/instrumentation.ts - formatting
  • src/lib/auto-triage/application/webhook/issue-webhook-processor.ts - formatting
  • src/lib/cloud-agent/gitlab-integration-helpers.test.ts - formatting
  • src/lib/kilo-pass/stripe-handlers-invoice-paid.test.ts - formatting
  • src/lib/kilo-pass/stripe-handlers-subscription-events.test.ts - formatting
  • src/lib/security-agent/services/auto-dismiss-service.test.ts - formatting
  • storybook/package.json - catalog migration

@iscekic iscekic force-pushed the chore/catalog-cleanup branch from e42a842 to 00d80b7 Compare February 27, 2026 22:18
@iscekic iscekic force-pushed the chore/catalog-cleanup branch 2 times, most recently from 5873eab to 31af7ba Compare February 27, 2026 22:40
@iscekic iscekic force-pushed the chore/catalog-cleanup branch from 31af7ba to a3c04ee Compare February 27, 2026 22:50
@iscekic
Copy link
Contributor Author

iscekic commented Feb 27, 2026

Note to self: merge Monday morning

- Add hono, typescript, wrangler to pnpm catalog; update drizzle-orm and zod versions
- Switch all subpackages to catalog: protocol for drizzle-orm, zod, hono, typescript, wrangler
- Remove redundant pg dep from cloudflare-session-ingest and kiloclaw
- Refactor cloud-agent-next to use @kilocode/db instead of raw pg (matching cloud-agent)
- Delete cloud-agent-next custom db facade (database.ts, node-postgres.ts, SqlStore.ts, table.ts, PlatformIntegrationsStore.ts, table interpolators)
@iscekic iscekic force-pushed the chore/catalog-cleanup branch from d2f8329 to 8db51f6 Compare February 27, 2026 23:05
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.

1 participant