Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes test-only database write methods from the production repository.Repository interface and updates tests to seed data through production write paths (notably CreateEpochsAndInputs and StoreAdvanceResult), improving isolation and realism of repository/jsonrpc tests.
Changes:
- Dropped
TestRepositoryfrominternal/repository/repository.goand removed Postgres test-only write helpers. - Added/updated repotest helpers/builders to seed outputs/reports via
StoreAdvanceResultinstead of direct inserts. - Refactored JSON-RPC tests to use repotest builders + production repository methods and switched several assertions to
require.NoError.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/repository/repotest/repotest.go | Adds a StoreAdvanceResult test helper and suite wrapper to seed outputs/reports via production bulk op. |
| internal/repository/repotest/report_test_cases.go | Replaces direct report creation with storeAdvanceResult seeding. |
| internal/repository/repotest/output_test_cases.go | Replaces direct output creation with storeAdvanceResult seeding; adjusts execution-update tests accordingly. |
| internal/repository/repotest/builders.go | Removes OutputBuilder/ReportBuilder; tweaks EpochBuilder.WithIndex; adds InputBuilder.WithEpochApplicationID. |
| internal/repository/repository.go | Removes TestRepository from the public Repository interface. |
| internal/repository/postgres/util.go | Removes unused addressToBytes helper (was only for removed test-only code). |
| internal/repository/postgres/test_only.go | Deletes PostgresRepository test-only insert methods (CreateEpoch/Input/Output/Report). |
| internal/jsonrpc/util_test.go | Adds repotest usage and helper methods to seed epochs/inputs/results through production APIs; uses require. |
| internal/jsonrpc/jsonrpc_test.go | Updates seeding logic to avoid removed test-only repository methods; adopts require.NoError in several places. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
renatomaia
previously approved these changes
Mar 5, 2026
mpolitzer
previously approved these changes
Mar 5, 2026
b2733c5 to
e69b14d
Compare
0195dfd to
715a58e
Compare
The base branch was changed.
mpolitzer
approved these changes
Mar 5, 2026
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.
No description provided.