Make mock indexer entity queries generic - #1509
Merged
Merged
Conversation
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
📝 WalkthroughWalkthroughThe test MockIndexer now resolves entities by string names, with updated query and history-query types. Code generation tests were migrated to string-based entity lookup and explicit Promise result annotations across loading, storage, write/read, rollback, and schema scenarios. ChangesEntity Lookup API Migration
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
DZakh
marked this pull request as ready for review
July 29, 2026 09:35
DZakh
pushed a commit
that referenced
this pull request
Jul 29, 2026
…tart-at-head-recovery The base picked up main, bringing configurable chain-id storage (#1507) and generic mock indexer entity queries (#1509). One conflict, in makeSetReadyAtQuery: #1507 turned it into a one-row-at-a-time update because the id column is INTEGER or BIGINT depending on ChainId.mode, so `= ANY($2::int[])` no longer holds for every configuration. Took that shape and kept the `IS NULL` guard on top; the caller loops the chain ids, so the guard applies per row exactly as it did to the array form. Source.make's `~chain` became `~chainId` in #1509; renamed at the call sites in the resume tests. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DL4RDYUpZcK2YyydfSvqLc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
query,queryHistory, andqueryRawWhy
The mock indexer was coupled to generated
Indexer.Entities.namevalues. That coupling blocks moving it into the internal test-indexer solution in theenviotest package, where scenario-generated entity-name types are unavailable. Returning the caller-selected entity type directly keeps the API lightweight without introducing a separate opaque entity wrapper.Impact
Mock-indexer queries are intentionally less type-safe at the entity-name boundary: a string and its expected result type can disagree. Runtime entity lookup still validates the supplied name against the loaded project config.
Validation
pnpm exec rescriptpnpm exec tsc --noEmitgit diff --checkSummary by CodeRabbit