-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(indexer/postgres): update to changes on main #21077
Conversation
WalkthroughWalkthroughThis update refines the handling of enum types and address kinds across various components of the indexer module. Key changes include transitioning from Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ModuleIndexer
participant Database
User->>ModuleIndexer: Request to create enum type
ModuleIndexer->>Database: Create Enum Type
Database-->>ModuleIndexer: Return success
ModuleIndexer-->>User: Confirm creation
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files ignored due to path filters (2)
indexer/postgres/go.sum
is excluded by!**/*.sum
indexer/postgres/tests/go.sum
is excluded by!**/*.sum
Files selected for processing (6)
- indexer/postgres/column.go (2 hunks)
- indexer/postgres/enum.go (3 hunks)
- indexer/postgres/go.mod (1 hunks)
- indexer/postgres/internal/testdata/example_schema.go (4 hunks)
- indexer/postgres/module.go (2 hunks)
- indexer/postgres/tests/go.mod (1 hunks)
Additional context used
Path-based instructions (4)
indexer/postgres/module.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.indexer/postgres/enum.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.indexer/postgres/internal/testdata/example_schema.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.indexer/postgres/column.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Additional comments not posted (14)
indexer/postgres/go.mod (1)
12-13
: LGTM! Thereplace
directive is appropriate for local development.The addition of the
replace
directive helps in utilizing a local version of theschema
package, which is beneficial for development and testing.indexer/postgres/tests/go.mod (1)
33-34
: LGTM! Thereplace
directive is appropriate for local development.The addition of the
replace
directive helps in utilizing a local version of theschema
package, which is beneficial for development and testing.indexer/postgres/module.go (3)
15-15
: LGTM! The type change fordefinedEnums
improves type safety.Changing the type from
map[string]schema.EnumDefinition
tomap[string]schema.EnumType
aligns with the updated schema package and enhances type safety.
24-25
: LGTM! The initialization ofdefinedEnums
is correct.The
NewModuleIndexer
method correctly initializes thedefinedEnums
field with the new typemap[string]schema.EnumType
.
33-53
: LGTM! The refactoring improves readability and maintainability.The
InitializeSchema
method has been refactored to use a callback function for creating enum types and tables. This change enhances code readability and maintainability. The error handling adjustments ensure proper error capture.However, ensure the callback functions are correctly implemented and tested.
Verification successful
Verification Successful: Callback functions are correctly implemented and tested.
The functions
EnumTypes
andObjectTypes
are defined inschema/module_schema.go
and have corresponding test cases inschema/module_schema_test.go
. This confirms that the callback functions used in theInitializeSchema
method are correctly implemented and tested.
schema/module_schema.go: func (s ModuleSchema) EnumTypes(f func(EnumType) bool)
schema/module_schema.go: func (s ModuleSchema) ObjectTypes(f func(ObjectType) bool)
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the implementation and usage of callback functions in InitializeSchema. # Test: Search for callback function implementations. Expect: Correct usage in schema package. rg --type go -A 5 'func \(.*schema\) EnumTypes\(' rg --type go -A 5 'func \(.*schema\) ObjectTypes\('Length of output: 105
Script:
#!/bin/bash # Description: Verify the implementation and usage of callback functions in InitializeSchema. # Test: Search for the implementation of the EnumTypes function within the schema package. rg --type go 'func \(.*schema\) EnumTypes\(' # Test: Search for the implementation of the ObjectTypes function within the schema package. rg --type go 'func \(.*schema\) ObjectTypes\('Length of output: 95
Script:
#!/bin/bash # Description: Verify the implementation and usage of callback functions in InitializeSchema. # Test: Search for any function definitions related to EnumTypes within the entire codebase. rg --type go 'EnumTypes' # Test: Search for any function definitions related to ObjectTypes within the entire codebase. rg --type go 'ObjectTypes'Length of output: 1086
indexer/postgres/enum.go (3)
Line range hint
42-56
:
LGTM! But verify the usage ofschema.EnumType
in the codebase.The code changes are approved.
However, ensure that all references to
schema.EnumType
are consistent across the codebase.Verification successful
Verification successful: Consistent usage of
schema.EnumType
across the codebase.The usage of
schema.EnumType
has been verified and found to be consistent in the following files:
indexer/postgres/module.go
indexer/postgres/enum.go
indexer/postgres/internal/testdata/example_schema.go
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all references to `schema.EnumType` in the codebase. # Test: Search for the usage of `schema.EnumType`. Expect: Consistent usage across the codebase. rg --type go -A 5 $'schema.EnumType'Length of output: 2897
Line range hint
14-35
:
LGTM! But verify the usage ofschema.EnumType
in the codebase.The code changes are approved.
However, ensure that all references to
schema.EnumType
are consistent across the codebase.Verification successful
The usage of
schema.EnumType
is consistent across the codebase.The references to
schema.EnumType
in theindexer/postgres
directory are correctly implemented.
indexer/postgres/module.go
indexer/postgres/enum.go
indexer/postgres/internal/testdata/example_schema.go
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all references to `schema.EnumType` in the codebase. # Test: Search for the usage of `schema.EnumType`. Expect: Consistent usage across the codebase. rg --type go -A 5 $'schema.EnumType'Length of output: 2897
66-68
: LGTM! But verify the usage ofschema.EnumType
in the codebase.The code changes are approved.
However, ensure that all references to
schema.EnumType
are consistent across the codebase.Verification successful
The usage of
schema.EnumType
is consistent across the codebase.The code changes are verified and approved.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all references to `schema.EnumType` in the codebase. # Test: Search for the usage of `schema.EnumType`. Expect: Consistent usage across the codebase. rg --type go -A 5 $'schema.EnumType'Length of output: 2897
indexer/postgres/internal/testdata/example_schema.go (4)
39-44
: Enhanced error handling inExampleSchema
initialization.The change enhances error handling by ensuring that any errors during the creation process will result in a panic.
32-32
: LGTM! But verify the usage offield.EnumType
in the codebase.The code changes are approved.
However, ensure that all references to
field.EnumType
are consistent across the codebase.
83-90
: LGTM! But verify the usage offield.EnumType
andschema.AddressKind
in the codebase.The code changes are approved.
However, ensure that all references to
field.EnumType
andschema.AddressKind
are consistent across the codebase.Verification successful
LGTM! The usage of
field.EnumType
andschema.AddressKind
is consistent across the codebase.The code changes are approved.
field.EnumType
references:
schema/module_schema.go
indexer/postgres/column.go
indexer/postgres/internal/testdata/example_schema.go
schema.AddressKind
references:
indexer/postgres/column.go
indexer/postgres/internal/testdata/example_schema.go
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all references to `field.EnumType` and `schema.AddressKind` in the codebase. # Test: Search for the usage of `field.EnumType` and `schema.AddressKind`. Expect: Consistent usage across the codebase. rg --type go -A 5 $'field.EnumType' rg --type go -A 5 $'schema.AddressKind'Length of output: 1763
67-69
: LGTM! But verify the usage offield.EnumType
in the codebase.The code changes are approved.
However, ensure that all references to
field.EnumType
are consistent across the codebase.Verification successful
Verified: The usage of
field.EnumType
is consistent across the codebase.The instances of
field.EnumType
in the filesschema/module_schema.go
,indexer/postgres/column.go
, andindexer/postgres/internal/testdata/example_schema.go
all align with the intended changes and are used correctly.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all references to `field.EnumType` in the codebase. # Test: Search for the usage of `field.EnumType`. Expect: Consistent usage across the codebase. rg --type go -A 5 $'field.EnumType'Length of output: 1083
Script:
#!/bin/bash # Extract more context around the `field.EnumType` usage in the identified files. # Get additional lines of context for `field.EnumType` in schema/module_schema.go rg --type go -A 10 -B 10 'field.EnumType' schema/module_schema.go # Get additional lines of context for `field.EnumType` in indexer/postgres/column.go rg --type go -A 10 -B 10 'field.EnumType' indexer/postgres/column.go # Get additional lines of context for `field.EnumType` in indexer/postgres/internal/testdata/example_schema.go rg --type go -A 10 -B 10 'field.EnumType' indexer/postgres/internal/testdata/example_schema.goLength of output: 1760
indexer/postgres/column.go (2)
28-28
: LGTM! But verify the usage offield.EnumType
in the codebase.The code changes are approved.
However, ensure that all references to
field.EnumType
are consistent across the codebase.Verification successful
The usage of
field.EnumType
is consistent across the codebase.The references to
field.EnumType
have been verified and are consistent in the following files:
schema/module_schema.go
indexer/postgres/column.go
indexer/postgres/internal/testdata/example_schema.go
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all references to `field.EnumType` in the codebase. # Test: Search for the usage of `field.EnumType`. Expect: Consistent usage across the codebase. rg --type go -A 5 $'field.EnumType'Length of output: 1083
103-103
: LGTM! But verify the usage ofschema.AddressKind
in the codebase.The code changes are approved.
However, ensure that all references to
schema.AddressKind
are consistent across the codebase.Verification successful
The usage of
schema.AddressKind
is consistent across the codebase, and no instances ofschema.Bech32AddressKind
were found.
indexer/postgres/column.go
indexer/postgres/internal/testdata/example_schema.go
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all references to `schema.AddressKind` in the codebase. # Test: Search for the usage of `schema.AddressKind`. Expect: Consistent usage across the codebase. rg --type go -A 5 $'schema.AddressKind'Length of output: 679
Script:
#!/bin/bash # Description: Verify that there are no remaining instances of `schema.Bech32AddressKind` in the codebase. # Test: Search for the usage of `schema.Bech32AddressKind`. Expect: No occurrences in the codebase. rg --type go $'schema.Bech32AddressKind'Length of output: 39
* main: feat(log): remove core dependency and update core interface to be dependency free (#21045) chore: fix some comments (#21085) feat: simulate nested messages (#20291) chore(network): remove `DefaultConfigWithAppConfigWithQueryGasLimit` (#21055) fix(runtime): remove `appv1alpha1.Config` from runtime (#21042) feat(simapp/v2): Add store server to testnet init cmd (#21076) chore(indexer/postgres): update to changes on main (#21077) feat(schema/appdata): async listener mux'ing (#20879) ci: Use large box for 052 branch sims on CI (#21067) chore(all): replace all `fmt.Errorf` without paramters with `errors.New` (#21068)
Description
This PR updates cosmossdk.io/postgres/indexer to the latest changes to cosmossdk.io/schema on main. I'm using a replace for now and holding off tagging schema 0.2.0 for a bit. A bit of code deletion was possible with this update.
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
in the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.
I have...
Summary by CodeRabbit
New Features
Bug Fixes
Chores