Rename ENSDb-related symbols acorss codebase#1828
Conversation
Replacements applied: - `databaseSchemaName` to `ensIndexerSchemaName` - `databaseUrl` to `ensDbUrl` - `DATABASE_SCHEMA` to `ENSINDEXER_SCHEMA_NAME` - `DATABASE_URL` to `ENSDB_URL` - `DatabaseUrlSchema` to `EnsDbUrlSchema` - `DatabaseSchemaNameSchema` to `EnsIndexerSchemaNameSchema`
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 42a86a1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 23 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughRepository-wide rename of ENS DB and schema identifiers: Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR performs a comprehensive, mostly mechanical rename of ENSDb-related symbols across the entire ENSNode monorepo — replacing generic Key changes:
Confidence Score: 5/5Safe to merge — the rename is thorough, consistent, and well-tested; the only finding is a cleanup-level issue in the deploy workflow. All P0/P1-level concerns are absent. The single finding (stale
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
subgraph EnvVars["Environment Variables (renamed)"]
EU["ENSDB_URL\n(was DATABASE_URL)"]
ES["ENSINDEXER_SCHEMA_NAME\n(was DATABASE_SCHEMA)"]
end
subgraph ENSIndexer
PC["ponder/config.ts\nponderConfig.database.connectionString = config.ensDbUrl"]
IC["EnsIndexerConfig\n.ensDbUrl\n.ensIndexerSchemaName"]
CLI["ponder start --schema $ENSINDEXER_SCHEMA_NAME"]
end
subgraph ENSApi
AC["EnsApiConfig\n.ensDbUrl\n.ensIndexerSchemaName"]
DB["EnsDbReader(ensDbUrl, ensIndexerSchemaName)"]
end
subgraph ENSDb["ENSDb (Postgres)"]
SC["ENSIndexer Schema\n(ensIndexerSchemaName)"]
NS["ensnode schema"]
PS["ponder_sync schema"]
end
EU --> IC
ES --> IC
IC --> PC
IC --> CLI
EU --> AC
ES --> AC
AC --> DB
DB --> SC
PC --> SC
PC --> NS
PC --> PS
Reviews (2): Last reviewed commit: "Apply PR feedback to code docs" | Re-trigger Greptile |
There was a problem hiding this comment.
Pull request overview
This PR standardizes ENSDb-related naming across the monorepo by renaming env vars and config fields away from generic DATABASE_* / database* terminology toward ENSDB_* / ensDb* and ENSINDEXER_SCHEMA_NAME / ensIndexerSchemaName, and updates related docs, mocks, and UI text.
Changes:
- Renamed env vars and config fields (e.g.
DATABASE_URL→ENSDB_URL,DATABASE_SCHEMA→ENSINDEXER_SCHEMA_NAME,databaseSchemaName→ensIndexerSchemaName). - Updated ENSIndexer Ponder scripts to pass schema via
--schema. - Updated docs/examples and ENSAdmin connection UI to reflect the new naming.
Reviewed changes
Copilot reviewed 46 out of 46 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/ensnode-sdk/src/shared/config/zod-schemas.ts | Rename schema-name zod schema + update required error messages to ENSINDEXER_SCHEMA_NAME. |
| packages/ensnode-sdk/src/shared/config/types.ts | Rename DatabaseSchemaName type to EnsIndexerSchemaName (leaves DatabaseUrl). |
| packages/ensnode-sdk/src/shared/config/environments.ts | Replace app-specific DB env interfaces with shared DatabaseEnvironment using ENSDB_URL/ENSINDEXER_SCHEMA_NAME. |
| packages/ensnode-sdk/src/ensindexer/config/zod-schemas.ts | Rename public config field + schema builder to ensIndexerSchemaName. |
| packages/ensnode-sdk/src/ensindexer/config/zod-schemas.test.ts | Update schema tests and expected error messages for renamed field. |
| packages/ensnode-sdk/src/ensindexer/config/types.ts | Rename EnsIndexerPublicConfig.databaseSchemaName → ensIndexerSchemaName + update docstring. |
| packages/ensnode-sdk/src/ensindexer/config/serialize.ts | Serialize renamed public config field. |
| packages/ensnode-sdk/src/ensindexer/config/conversions.test.ts | Update conversions tests to use ensIndexerSchemaName. |
| packages/ensnode-sdk/src/ensindexer/config/compatibility.ts | Update compatibility check omit list to new field name. |
| packages/ensnode-sdk/src/ensindexer/client.mock.ts | Update mocked public config field name. |
| packages/ensnode-sdk/src/ensapi/config/conversions.test.ts | Update ENSApi config conversion tests for renamed field. |
| packages/ensnode-sdk/src/ensapi/client.test.ts | Update client test fixture to use ensIndexerSchemaName. |
| packages/ensdb-sdk/src/client/ensdb-client.mock.ts | Update ENSDb SDK mock public config to new field name. |
| docs/ensnode.io/src/content/docs/docs/usage/api.mdx | Update Config API example response to ensIndexerSchemaName. |
| docs/ensnode.io/src/content/docs/docs/contributing/releases.mdx | Update release guidance to reference ENSINDEXER_SCHEMA_NAME. |
| docker-compose.yml | Switch docker-compose env vars to ENSDB_URL / ENSINDEXER_SCHEMA_NAME. |
| apps/ensindexer/src/lib/public-config-builder/public-config-builder.ts | Build immutable public config with ensIndexerSchemaName. |
| apps/ensindexer/src/lib/public-config-builder/public-config-builder.test.ts | Update mocks/assertions for renamed field. |
| apps/ensindexer/src/lib/ensdb/singleton.ts | Use ensDbUrl + ensIndexerSchemaName from config. |
| apps/ensindexer/src/lib/ensdb-writer-worker/ensdb-writer-worker.mock.ts | Update test fixture public config field. |
| apps/ensindexer/src/lib/test/mockConfig.ts | Update test env inputs to new env var names. |
| apps/ensindexer/src/config/types.ts | Rename config fields (databaseSchemaName→ensIndexerSchemaName, databaseUrl→ensDbUrl) and update docs. |
| apps/ensindexer/src/config/serialize.ts | Serialize redacted config with new keys (ensDbUrl, ensIndexerSchemaName). |
| apps/ensindexer/src/config/redact.ts | Redact ensDbUrl instead of databaseUrl. |
| apps/ensindexer/src/config/environment.ts | Switch environment type composition to DatabaseEnvironment. |
| apps/ensindexer/src/config/config.test.ts | Update tests to use ENSDB_URL / ENSINDEXER_SCHEMA_NAME and new config property names. |
| apps/ensindexer/src/config/config.schema.ts | Parse env using ENSDB_URL / ENSINDEXER_SCHEMA_NAME and rename schema/url zod schema identifiers. |
| apps/ensindexer/package.json | Update dev/start scripts to pass Ponder --schema and use new env vars. |
| apps/ensindexer/.env.local.example | Update example env var names and explanatory comments. |
| apps/ensapi/src/lib/handlers/drizzle.ts | Remove unused Drizzle helper (deleted). |
| apps/ensapi/src/lib/ensdb/singleton.ts | Construct EnsDbReader using ensDbUrl. |
| apps/ensapi/src/handlers/subgraph/subgraph-api.ts | Feed subgraph middleware with config.ensDbUrl. |
| apps/ensapi/src/config/redact.ts | Redact ensDbUrl and reshape redacted output. |
| apps/ensapi/src/config/environment.ts | Switch environment type composition to DatabaseEnvironment. |
| apps/ensapi/src/config/ensdb-config.schema.ts | Rename url schema to EnsDbUrlSchema and read ENSDB_URL. |
| apps/ensapi/src/config/config.singleton.test.ts | Update singleton bootstrap tests for new env var names. |
| apps/ensapi/src/config/config.schema.ts | Build config using ensDbUrl and ensIndexerPublicConfig.ensIndexerSchemaName. |
| apps/ensapi/src/config/config.schema.test.ts | Update config schema tests for new env var + field names. |
| apps/ensapi/.env.local.example | Update ENSApi example env var names and wording. |
| apps/ensadmin/src/components/connection/cards/ensnode-info.tsx | Update labels/tooltips and field access to ensIndexerSchemaName. |
| apps/ensadmin/src/app/mock/config-info/data.json | Update mock config payloads to new field name. |
| apps/ensadmin/src/app/mock/config-api.mock.ts | Update mock config deserialization input to new field name. |
| .changeset/wide-trams-rule.md | Changeset: env var rename for ENSIndexer. |
| .changeset/slow-readers-pay.md | Changeset: ENSAdmin UI wording update. |
| .changeset/slick-kings-travel.md | Changeset: env var rename for ENSApi. |
| .changeset/metal-views-start.md | Changeset: SDK public config field rename. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Ponder requires setting the database schema value with either `DATABASE_SCHEMA` evn var, or `--schema` CLI arg. We just stopped using the `DATABASE_SCHEMA` env var, so we need to use the `--schema` CLI arg and pass the selected ENSIndexer Schema Name value there.
Using lazy proxy for constructing `config` object does not allow for using `...config` spread operator. Instead, we have to list the `config` fields manually.
…rPublicConfig` type to `ensIndexerSchemaName`.
…SDB_URL`, and `DATABASE_SCHEMA` to `ENSINDEXER_SCHEMA_NAME`.
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/ensapi/src/config/ensdb-config.schema.ts (1)
7-23: 🧹 Nitpick | 🔵 TrivialConsider extracting shared
EnsDbUrlSchemato avoid duplication.The
EnsDbUrlSchemavalidation logic here is identical to the one inapps/ensindexer/src/config/config.schema.ts. Consider extracting this to a shared location (e.g., within@ensnode/ensnode-sdk/internalalongsideEnsIndexerSchemaNameSchema) to maintain a single source of truth for PostgreSQL connection string validation.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/ensapi/src/config/ensdb-config.schema.ts` around lines 7 - 23, Extract the duplicate PostgreSQL connection-string validator into a shared module and replace local definitions with it: create a shared export (e.g., EnsDbUrlSchema) under `@ensnode/ensnode-sdk/internal` (next to EnsIndexerSchemaNameSchema) that encapsulates the current logic that uses parseConnectionString and the same refine/error message, then update both apps/ensapi/src/config/ensdb-config.schema.ts and apps/ensindexer/src/config/config.schema.ts to import and reuse that shared EnsDbUrlSchema instead of duplicating the refine logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/ensindexer/package.json`:
- Around line 15-16: The start script is using shell variable expansion which is
inconsistent with the dev script and breaks on Windows; update the package.json
"start" script to set ENSINDEXER_SCHEMA_NAME inline like the "dev" script (for
example: ENSINDEXER_SCHEMA_NAME=public ponder --root ./ponder start --schema
$ENSINDEXER_SCHEMA_NAME) so both scripts use the same environment-variable
assignment style, or explicitly document that Windows development is unsupported
if you prefer not to change the script.
---
Outside diff comments:
In `@apps/ensapi/src/config/ensdb-config.schema.ts`:
- Around line 7-23: Extract the duplicate PostgreSQL connection-string validator
into a shared module and replace local definitions with it: create a shared
export (e.g., EnsDbUrlSchema) under `@ensnode/ensnode-sdk/internal` (next to
EnsIndexerSchemaNameSchema) that encapsulates the current logic that uses
parseConnectionString and the same refine/error message, then update both
apps/ensapi/src/config/ensdb-config.schema.ts and
apps/ensindexer/src/config/config.schema.ts to import and reuse that shared
EnsDbUrlSchema instead of duplicating the refine logic.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: d62fd296-8c5e-434b-b08f-dc488ccb5154
📒 Files selected for processing (46)
.changeset/metal-views-start.md.changeset/slick-kings-travel.md.changeset/slow-readers-pay.md.changeset/wide-trams-rule.mdapps/ensadmin/src/app/mock/config-api.mock.tsapps/ensadmin/src/app/mock/config-info/data.jsonapps/ensadmin/src/components/connection/cards/ensnode-info.tsxapps/ensapi/.env.local.exampleapps/ensapi/src/config/config.schema.test.tsapps/ensapi/src/config/config.schema.tsapps/ensapi/src/config/config.singleton.test.tsapps/ensapi/src/config/ensdb-config.schema.tsapps/ensapi/src/config/environment.tsapps/ensapi/src/config/redact.tsapps/ensapi/src/handlers/subgraph/subgraph-api.tsapps/ensapi/src/lib/ensdb/singleton.tsapps/ensapi/src/lib/handlers/drizzle.tsapps/ensindexer/.env.local.exampleapps/ensindexer/package.jsonapps/ensindexer/src/config/config.schema.tsapps/ensindexer/src/config/config.test.tsapps/ensindexer/src/config/environment.tsapps/ensindexer/src/config/redact.tsapps/ensindexer/src/config/serialize.tsapps/ensindexer/src/config/types.tsapps/ensindexer/src/lib/__test__/mockConfig.tsapps/ensindexer/src/lib/ensdb-writer-worker/ensdb-writer-worker.mock.tsapps/ensindexer/src/lib/ensdb/singleton.tsapps/ensindexer/src/lib/public-config-builder/public-config-builder.test.tsapps/ensindexer/src/lib/public-config-builder/public-config-builder.tsdocker-compose.ymldocs/ensnode.io/src/content/docs/docs/contributing/releases.mdxdocs/ensnode.io/src/content/docs/docs/usage/api.mdxpackages/ensdb-sdk/src/client/ensdb-client.mock.tspackages/ensnode-sdk/src/ensapi/client.test.tspackages/ensnode-sdk/src/ensapi/config/conversions.test.tspackages/ensnode-sdk/src/ensindexer/client.mock.tspackages/ensnode-sdk/src/ensindexer/config/compatibility.tspackages/ensnode-sdk/src/ensindexer/config/conversions.test.tspackages/ensnode-sdk/src/ensindexer/config/serialize.tspackages/ensnode-sdk/src/ensindexer/config/types.tspackages/ensnode-sdk/src/ensindexer/config/zod-schemas.test.tspackages/ensnode-sdk/src/ensindexer/config/zod-schemas.tspackages/ensnode-sdk/src/shared/config/environments.tspackages/ensnode-sdk/src/shared/config/types.tspackages/ensnode-sdk/src/shared/config/zod-schemas.ts
💤 Files with no reviewable changes (1)
- apps/ensapi/src/lib/handlers/drizzle.ts
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 57 out of 57 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@greptile review |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 57 out of 57 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 57 out of 57 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #### 4. Start ENSIndexer | ||
|
|
||
| ```sh | ||
| cd apps/ensindexer && pnpm dev | ||
| ``` | ||
|
|
||
| with environment variables: | ||
|
|
||
| ```env | ||
| DATABASE_SCHEMA=ensindexer_0 | ||
| NAMESPACE=ens-test-env | ||
| PLUGINS=ensv2,protocol-acceleration | ||
| ``` |
There was a problem hiding this comment.
The manual ENSIndexer startup instructions list only NAMESPACE/PLUGINS, but ENSIndexer config parsing now requires ENSDB_URL (and in general ENSINDEXER_SCHEMA_NAME, though pnpm dev sets it inline). As written, following these steps in a clean shell will cause ENSIndexer to fail to start unless the reader already has apps/ensindexer/.env.local (or shell env) providing ENSDB_URL. Please update this section to either include ENSDB_URL in the env snippet, or add an explicit note that ENSDB_URL must be set via .env.local/shell before running pnpm dev.
Lite PR
Tip: Review docs on the ENSNode PR process
Summary
databaseSchemaNametoensIndexerSchemaNamedatabaseUrltoensDbUrlDATABASE_SCHEMAtoENSINDEXER_SCHEMA_NAMEDATABASE_URLtoENSDB_URLDatabaseUrlSchematoEnsDbUrlSchemaDatabaseSchemaNameSchematoEnsIndexerSchemaNameSchemaENSIndexer
devandstartcommands have been updated to passENSINDEXER_SCHEMA_NAMEvalue with--schemaPonder CLI param. Theservecommand was removed.Connection view in ENSAdmin: updated tooltip contents.
Updated code docs in several places to match the current state of reality.
Why
Testing
Notes for Reviewer (Optional)
Pre-Review Checklist (Blocking)
Resolves #1762, #1763.