Skip to content

feat: link local Crystal packages for integration testing#3

Closed
Zetazzz wants to merge 1 commit into
devin/1775643930-multi-tenancy-cache-v2from
devin/1775795909-crystal-local-link
Closed

feat: link local Crystal packages for integration testing#3
Zetazzz wants to merge 1 commit into
devin/1775643930-multi-tenancy-cache-v2from
devin/1775795909-crystal-local-link

Conversation

@Zetazzz
Copy link
Copy Markdown
Owner

@Zetazzz Zetazzz commented Apr 10, 2026

Summary

Links all Crystal packages from the local repo (/home/ubuntu/repos/crystal) into Constructive via pnpm overrides. This enables full-stack integration testing with the new Crystal (PgExecutor prepareSql gateway, centralized sqlTextTransform) before Crystal PR #5 is published to npm.

Changes:

  • package.json — Added 14 pnpm overrides linking Crystal packages (@dataplan/pg, grafast, grafserv, graphile-build, graphile-build-pg, graphile-utils, postgraphile, graphile-config, pg-sql2, pg-introspection, graphile-export, graphile, tamedevil, @graphile/lru)
  • pnpm-lock.yaml — Updated to resolve linked packages
  • Type casts (pool as any, handler as any) added in 4 files to handle @types/pg (8.18.0 vs 8.15.6) and @types/express (5.x vs 4.x) version mismatches between repos. These casts can be removed once Crystal publishes with aligned types.

When Crystal PR #5 is published:

  1. Remove the pnpm overrides (revert to npm versions)
  2. Remove the as any type casts
  3. Replace compat shim with direct import from @dataplan/pg

Review & Testing Checklist for Human

  • Verify this PR should NOT be merged to main — it's an integration testing branch on top of the multi-tenancy-cache-v2 branch
  • After Crystal PR docs: implementation spec for graphile-multi-tenancy-cache v3 #5 is published, create a clean PR that removes the local links and uses published npm packages
  • CI will fail because the link paths reference a local machine — this is expected and documented

Notes

  • Stress test validated (new Constructive + new Crystal): 5 tenants × 3 endpoints, 4 workers, 10s → 0 errors, ~9.8K QPS, p50=0ms, p99=1ms, 5 MISS / 10 HITs, 1 template shared
  • CI is expected to fail since the link: paths reference the local dev machine. This PR is for local integration testing and readiness for Crystal publish, not for merging to main.

Link to Devin session: https://app.devin.ai/sessions/c52abb35a19b44a4a194786b3a10eeb6
Requested by: @Zetazzz


Open with Devin

@devin-ai-integration
Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Add pnpm overrides to link all Crystal packages from local repo at
/home/ubuntu/repos/crystal. This enables:
1. Full-stack stress testing with new Crystal (PgExecutor prepareSql gateway)
2. Ready for seamless transition when Crystal PR #5 is published

Type casts added for @types/pg and @types/express version mismatches
between Constructive (8.18.0, 5.1.0) and Crystal (8.15.6, 4.x).
These casts can be removed once Crystal publishes with aligned types.

Stress test results (new Constructive + new Crystal):
- 5 tenants × 3 endpoints, 4 workers, 10s pressure
- 5 MISS / 10 HITs, 1 template, 0 errors
- ~9.8K QPS, p50=0ms, p99=1ms
- 8.8 MB less heap vs dedicated

Co-Authored-By: 甄陟 <zetazz@163.com>
@devin-ai-integration devin-ai-integration Bot force-pushed the devin/1775795909-crystal-local-link branch from 466a8aa to f7fb6b3 Compare April 15, 2026 05:40
@Zetazzz Zetazzz closed this Apr 21, 2026
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