Skip to content
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

deps: remove sqs from sqsdomain #522

Merged
merged 1 commit into from
Sep 27, 2024
Merged

Conversation

p0mvn
Copy link
Member

@p0mvn p0mvn commented Sep 27, 2024

  • Remove sqs from sqsdomain so that we do not accidentally cause non-existent tag issues to clients that import sqsdomain

https://osmosis-network.slack.com/archives/C060VCJAVBL/p1727353457634799

Summary by CodeRabbit

Release Notes

  • New Features

    • Updated data types for pool APR and fees to enhance modularity and clarity.
  • Bug Fixes

    • Resolved inconsistencies in data fetching methods related to pool APRs and fees.
  • Refactor

    • Transitioned references from the passthroughdomain package to the sqspassthroughdomain package across multiple components.
  • Chores

    • Removed outdated dependencies to streamline the project’s dependency management.

@p0mvn p0mvn marked this pull request as ready for review September 27, 2024 18:19
Copy link
Contributor

coderabbitai bot commented Sep 27, 2024

Walkthrough

The changes involve a comprehensive update across multiple files, primarily transitioning the references from the passthroughdomain package to the sqspassthroughdomain package. This includes modifications to variable types, method signatures, and data structures to align with the new package. The overall functionality remains consistent, focusing on the restructuring of the codebase for better organization and clarity.

Changes

File Path Change Summary
app/sidecar_query_server.go Updated aprFetcher type from passthroughdomain.PoolAPR to sqspassthroughdomain.PoolAPR.
domain/mocks/pool_mock.go Replaced passthroughdomain with sqspassthroughdomain in MockRoutablePool struct and its methods.
domain/passthrough/numia_http_client.go Changed return type of GetPoolAPRsRange method from ([]PoolAPR, error) to ([]sqspassthroughdomain.PoolAPR, error).
domain/passthrough/timeseries_http_client.go Updated return type of GetPoolFees method from (*PoolFees, error) to (*sqspassthroughdomain.PoolFees, error).
pools/delivery/http/pools_handler.go Updated APRData and FeesData fields in PoolResponse struct to reference sqspassthroughdomain types.
pools/usecase/pools_usecase.go Updated aprPrefetcher and poolFeesPrefetcher to use sqspassthroughdomain types, modified method signatures for RegisterAPRFetcher and RegisterPoolFeesFetcher.
sqsdomain/go.mod Removed dependency on github.com/osmosis-labs/sqs v0.19.2-rc2.0.20240826173240-e5733bb3700d.
sqsdomain/passthroughdomain/passthrough_pools_data.go Renamed package from passthroughdomain to sqspassthroughdomain.
sqsdomain/passthroughdomain/pool_apr.go Renamed package from passthroughdomain to sqspassthroughdomain.
sqsdomain/passthroughdomain/pool_fees.go Renamed package from passthroughdomain to sqspassthroughdomain.
sqsdomain/pools.go Updated PoolI interface and PoolWrapper struct to use sqspassthroughdomain types.
sqsutil/datafetchers/numia_apr_fetcher.go Updated functions to return maps of sqspassthroughdomain.PoolAPR and sqspassthroughdomain.PoolFee instead of their previous counterparts.

Possibly related PRs

Poem

🐇 In the garden where bunnies play,
New paths of code have found their way.
From passthrough to sqs they leap,
With changes made, our code runs deep.
Hopping along, we celebrate,
A brighter future, oh, how great! 🌼


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
9.1% Coverage on New Code (required ≥ 50%)

See analysis details on SonarCloud

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (1)
pools/delivery/http/pools_handler.go (1)

17-17: Summary: Changes are consistent but verify broader impact.

The modifications to the import statement and PoolResponse struct are consistent and aligned with the PR objective of reorganizing the codebase. However, given the nature of these changes, it's crucial to ensure they are reflected consistently across the entire project.

Consider running a project-wide search and replace to catch any instances that might have been missed, and update any relevant documentation or configuration files that might reference the old package structure.

Also applies to: 42-43

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 890cd3c and ce10c7c.

⛔ Files ignored due to path filters (2)
  • pools/usecase/pools_usecase_test.go is excluded by !**/*_test.go
  • sqsdomain/go.sum is excluded by !**/*.sum
📒 Files selected for processing (12)
  • app/sidecar_query_server.go (2 hunks)
  • domain/mocks/pool_mock.go (2 hunks)
  • domain/passthrough/numia_http_client.go (2 hunks)
  • domain/passthrough/timeseries_http_client.go (2 hunks)
  • pools/delivery/http/pools_handler.go (2 hunks)
  • pools/usecase/pools_usecase.go (5 hunks)
  • sqsdomain/go.mod (0 hunks)
  • sqsdomain/passthroughdomain/passthrough_pools_data.go (1 hunks)
  • sqsdomain/passthroughdomain/pool_apr.go (1 hunks)
  • sqsdomain/passthroughdomain/pool_fees.go (1 hunks)
  • sqsdomain/pools.go (5 hunks)
  • sqsutil/datafetchers/numia_apr_fetcher.go (4 hunks)
💤 Files not reviewed due to no reviewable changes (1)
  • sqsdomain/go.mod
✅ Files skipped from review due to trivial changes (3)
  • sqsdomain/passthroughdomain/passthrough_pools_data.go
  • sqsdomain/passthroughdomain/pool_apr.go
  • sqsdomain/passthroughdomain/pool_fees.go
🔇 Additional comments (34)
domain/passthrough/timeseries_http_client.go (2)

6-6: LGTM: Import statement added correctly.

The new import for sqspassthroughdomain is correctly formatted and follows Go conventions. The use of an alias enhances code readability.


33-34: LGTM: Method implementation updated correctly.

The GetPoolFees method implementation has been properly updated to use the sqspassthroughdomain.PoolFees type. The change is consistent with the interface update and maintains the existing logic and error handling.

domain/passthrough/numia_http_client.go (4)

6-6: LGTM: Import statement added correctly.

The new import for sqspassthroughdomain is correctly added and aliased, which aligns with the subsequent changes in the file.


34-35: LGTM: Implementation updated correctly.

The GetPoolAPRsRange method implementation is correctly updated to use sqspassthroughdomain.PoolAPR. The logic remains the same, and error handling is preserved.


Line range hint 1-40: Summary: Changes align with PR objective, broader verification recommended.

The changes in this file consistently update the PoolAPR type to use sqspassthroughdomain.PoolAPR, aligning with the PR objective of removing SQS dependency. The modifications include updating the import statement, interface method signature, and implementation.

While the changes in this file are correct, they are likely part of a larger refactoring effort.

Consider the following recommendations:

  1. Ensure all files that previously used the local PoolAPR type are updated to use sqspassthroughdomain.PoolAPR.
  2. Verify that this change doesn't introduce any circular dependencies between packages.
  3. Update any relevant documentation or comments that might reference the old type.
  4. If there are any tests related to this functionality, make sure they are updated and passing.

Run the following script to help identify potential areas that might need updates:

#!/bin/bash
# Description: Find potential areas that might need updates due to PoolAPR type change

# Test: Search for any remaining references to the old PoolAPR type
rg --type go '\bPoolAPR\b' --glob '!domain/passthrough/numia_http_client.go'

# Test: Search for files that import the old package and might need updating
rg --type go 'import.*"github.com/osmosis-labs/sqs/domain/passthrough"'

# Test: Search for test files that might need updating
fd -e go -e test

12-12: LGTM: Interface method signature updated correctly.

The GetPoolAPRsRange method signature is correctly updated to use sqspassthroughdomain.PoolAPR.

Please ensure all implementations of NumiaHTTPClient interface are updated accordingly. Run the following script to verify:

✅ Verification successful

LGTM: All NumiaHTTPClient implementations are correctly updated.
The GetPoolAPRsRange method in NumiaHTTPClientImpl now returns []sqspassthroughdomain.PoolAPR, error as expected.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find all implementations of NumiaHTTPClient interface

# Test: Search for struct types that implement NumiaHTTPClient
ast-grep --lang go --pattern 'type $_ struct {
  $$$
}

var _ NumiaHTTPClient = $_'

# Test: Search for GetPoolAPRsRange method implementations
rg --type go 'func \(.*\) GetPoolAPRsRange\(\) \(.*\) {'

Length of output: 11083


Script:

#!/bin/bash
# Description: Verify all implementations of NumiaHTTPClient have updated GetPoolAPRsRange method signature

# Search for implementations of NumiaHTTPClient
ast-grep --lang go --pattern '
type $_ struct {
  $$$
}

var _ NumiaHTTPClient = $_
'

# Check GetPoolAPRsRange method signatures in implementations
rg --type go 'func \(.*\) GetPoolAPRsRange\(\) \(\[]sqspassthroughdomain\.PoolAPR, error\) {'

Length of output: 880


Script:

#!/bin/bash
# Description: Verify all implementations of NumiaHTTPClient have updated GetPoolAPRsRange method signature

# Search for all struct types that implement NumiaHTTPClient
ast-grep --lang go --pattern '
type $_ struct {
    $$$
}
'

# Verify that the struct implements NumiaHTTPClient
# This assumes that the implementation assertion follows immediately after the struct definition
ast-grep --lang go --pattern '
var _ NumiaHTTPClient = $_
'

# Check GetPoolAPRsRange method signatures in all implementations
rg --type go 'func\s+\([^)]*\)\s+GetPoolAPRsRange\(\)\s+\(\[\]sqspassthroughdomain\.PoolAPR,\s+error\)\s+\{'

Length of output: 1267


Script:

#!/bin/bash
# Description: Verify all implementations of NumiaHTTPClient have updated GetPoolAPRsRange method signature

# Step 1: Find all struct types that implement NumiaHTTPClient
ast-grep --lang go --pattern 'type $_ struct { $... }'

# Step 2: Ensure each struct implements NumiaHTTPClient
ast-grep --lang go --pattern 'var _ NumiaHTTPClient = $_'

# Step 3: Check GetPoolAPRsRange method signatures in all implementations
rg --type go 'func\s+\([^)]*\)\s+GetPoolAPRsRange\(\)\s+\(\[\]sqspassthroughdomain\.PoolAPR,\s+error\)\s+\{'

Length of output: 448

sqsutil/datafetchers/numia_apr_fetcher.go (4)

41-42: LGTM! Verify impact on dependent code.

The changes in the GetFetchPoolPoolFeesFromTimeseries function are consistent with the transition from passthroughdomain to sqspassthroughdomain and align with the changes made to the GetFetchPoolAPRsFromNumiaCb function. The core logic remains intact, with only type updates.

To ensure these changes don't introduce breaking changes, run the following script:

#!/bin/bash
# Description: Verify the impact of PoolFee type change on the codebase

# Test: Check for any remaining uses of passthroughdomain.PoolFee
echo "Checking for any remaining uses of passthroughdomain.PoolFee:"
rg --type go 'passthroughdomain\.PoolFee'

# Test: Verify the new sqspassthroughdomain.PoolFee is used consistently
echo "Verifying the new sqspassthroughdomain.PoolFee is used consistently:"
rg --type go 'sqspassthroughdomain\.PoolFee'

# Test: Check for any function calls to GetFetchPoolPoolFeesFromTimeseries
echo "Checking for function calls to GetFetchPoolPoolFeesFromTimeseries:"
rg --type go 'GetFetchPoolPoolFeesFromTimeseries\('

Also applies to: 54-54


Line range hint 1-68: Overall LGTM! Verify consistency across the entire codebase.

The changes in this file consistently replace passthroughdomain with sqspassthroughdomain while maintaining the core logic of the functions. This appears to be part of a larger refactoring effort.

To ensure consistency across the entire codebase, run the following script:

#!/bin/bash
# Description: Verify the transition from passthroughdomain to sqspassthroughdomain across the codebase

# Test: Check for any remaining uses of the old passthroughdomain package
echo "Checking for any remaining uses of the old passthroughdomain package:"
rg --type go '"github.com/osmosis-labs/sqs/domain/passthrough"'

# Test: Verify the new sqspassthroughdomain package is used consistently
echo "Verifying the new sqspassthroughdomain package is used consistently:"
rg --type go '"github.com/osmosis-labs/sqs/sqsdomain/passthroughdomain"'

# Test: Check for any remaining types or functions from the old package
echo "Checking for any remaining types or functions from the old package:"
rg --type go 'passthroughdomain\.'

# Test: Verify the new package's types and functions are used consistently
echo "Verifying the new package's types and functions are used consistently:"
rg --type go 'sqspassthroughdomain\.'

This script will help identify any inconsistencies or remaining references to the old package across the entire codebase, ensuring a complete and consistent transition.


16-17: LGTM! Verify impact on dependent code.

The changes in the GetFetchPoolAPRsFromNumiaCb function are consistent with the transition from passthroughdomain to sqspassthroughdomain. The core logic remains intact, with only type updates.

To ensure these changes don't introduce breaking changes, run the following script:

#!/bin/bash
# Description: Verify the impact of PoolAPR type change on the codebase

# Test: Check for any remaining uses of passthroughdomain.PoolAPR
echo "Checking for any remaining uses of passthroughdomain.PoolAPR:"
rg --type go 'passthroughdomain\.PoolAPR'

# Test: Verify the new sqspassthroughdomain.PoolAPR is used consistently
echo "Verifying the new sqspassthroughdomain.PoolAPR is used consistently:"
rg --type go 'sqspassthroughdomain\.PoolAPR'

# Test: Check for any function calls to GetFetchPoolAPRsFromNumiaCb
echo "Checking for function calls to GetFetchPoolAPRsFromNumiaCb:"
rg --type go 'GetFetchPoolAPRsFromNumiaCb\('

Also applies to: 29-29


9-9: LGTM! Verify consistent usage across the codebase.

The addition of the sqspassthroughdomain import aligns with the changes in the function signatures. This change suggests a project restructuring, moving from passthroughdomain to sqspassthroughdomain.

To ensure consistency across the codebase, run the following script:

sqsdomain/pools.go (8)

93-97: LGTM: PoolWrapper struct fields updated correctly.

The field types in the PoolWrapper struct have been properly updated to use sqspassthroughdomain instead of passthroughdomain. This change is consistent with the PR objective and maintains the struct's functionality while adapting to the new package structure.


210-210: LGTM: SetAPRData method signature updated.

The parameter type for the SetAPRData method has been correctly updated to use sqspassthroughdomain.PoolAPRDataStatusWrap. This change is consistent with the previous updates and aligns with the PR objective.


215-215: LGTM: SetFeesData method signature updated.

The parameter type for the SetFeesData method has been correctly updated to use sqspassthroughdomain.PoolFeesDataStatusWrap. This change is consistent with the previous updates and aligns with the PR objective.


220-220: LGTM: GetAPRData method signature updated.

The return type for the GetAPRData method has been correctly updated to sqspassthroughdomain.PoolAPRDataStatusWrap. This change is consistent with the previous updates and aligns with the PR objective.


Line range hint 1-226: Summary: Comprehensive and consistent updates to remove SQS from sqsdomain

The changes in this file consistently replace passthroughdomain with sqspassthroughdomain across import statements, interface methods, struct fields, and method implementations. These modifications align well with the PR objective of removing SQS from sqsdomain.

Key points:

  1. Import statement updated (line 15)
  2. PoolI interface methods updated (lines 45, 47, 61, 64)
  3. PoolWrapper struct fields updated (lines 93-97)
  4. SetAPRData, SetFeesData, GetAPRData, and GetFeesData method signatures updated (lines 210, 215, 220, 225)

All changes appear to be correct and consistent. The verification steps suggested in the review comments should be executed to ensure that these changes are applied consistently across the entire codebase.


45-47: LGTM: PoolI interface methods updated consistently.

The method signatures for GetAPRData, GetFeesData, SetAPRData, and SetFeesData have been correctly updated to use sqspassthroughdomain instead of passthroughdomain. This change is consistent with the PR objective and maintains the interface's functionality.

Let's verify that these changes are implemented consistently across the codebase:

#!/bin/bash
# Description: Check for consistent implementation of updated PoolI interface methods

# Test 1: Search for any remaining method signatures using 'passthroughdomain'
echo "Searching for any remaining method signatures using 'passthroughdomain':"
rg 'func.*passthroughdomain\.Pool(APR|Fees)DataStatusWrap' --type go

# Test 2: Confirm usage of updated method signatures
echo "Confirming usage of updated method signatures:"
rg 'func.*sqspassthroughdomain\.Pool(APR|Fees)DataStatusWrap' --type go

Also applies to: 61-64


225-225: LGTM: GetFeesData method signature updated.

The return type for the GetFeesData method has been correctly updated to sqspassthroughdomain.PoolFeesDataStatusWrap. This change is consistent with the previous updates and aligns with the PR objective.

As a final verification step, let's ensure that all references to passthroughdomain have been replaced throughout the codebase:

#!/bin/bash
# Description: Verify complete removal of 'passthroughdomain' references

# Test 1: Search for any remaining 'passthroughdomain' references in Go files
echo "Searching for any remaining 'passthroughdomain' references in Go files:"
rg 'passthroughdomain' --type go

# Test 2: Confirm usage of 'sqspassthroughdomain' in Go files
echo "Confirming usage of 'sqspassthroughdomain' in Go files:"
rg 'sqspassthroughdomain' --type go

15-15: LGTM: Import statement updated.

The import statement has been correctly updated to use sqspassthroughdomain. This change aligns with the PR objective of removing SQS from sqsdomain.

Let's verify that this new import is used consistently throughout the file:

pools/delivery/http/pools_handler.go (2)

17-17: LGTM! Verify the import usage across the codebase.

The import change aligns with the PR objective of reorganizing the codebase. The use of an alias maintains consistency with the previous naming convention.

To ensure this change doesn't introduce any issues, please run the following script to verify the import usage:

✅ Verification successful

Import usage verified successfully.

All references to the old import have been removed, and the new import github.com/osmosis-labs/sqs/sqsdomain/passthroughdomain is consistently used across the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the new import across the codebase

# Test: Search for any remaining usage of the old import
rg --type go 'github\.com/osmosis-labs/sqs/domain/passthroughdomain'

# Test: Confirm the usage of the new import
rg --type go 'github\.com/osmosis-labs/sqs/sqsdomain/passthroughdomain'

Length of output: 1168


42-43: LGTM! Verify the struct usage in related functions.

The changes to the PoolResponse struct are consistent with the import modification. The field types remain the same, ensuring that the structure and behavior of PoolResponse should not be affected.

To ensure this change doesn't introduce any issues, please run the following script to verify the struct usage:

✅ Verification successful

Verified: Struct usage consistent after import update.

All references to passthroughdomain have been successfully replaced with sqspassthroughdomain in the PoolResponse struct and related functions. No residual usages of the old package were found.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of PoolResponse struct and its fields

# Test: Search for any remaining usage of the old package in relation to PoolResponse
rg --type go 'passthroughdomain\.Pool(APR|Fees)DataStatusWrap'

# Test: Confirm the usage of the new package in relation to PoolResponse
rg --type go 'sqspassthroughdomain\.Pool(APR|Fees)DataStatusWrap'

# Test: Check for any potential issues in functions using PoolResponse
rg --type go -A 10 'PoolResponse'

Length of output: 9052

domain/mocks/pool_mock.go (6)

12-12: LGTM: Import statement updated correctly.

The import statement has been updated to use sqspassthroughdomain instead of passthroughdomain, which aligns with the PR objective of removing the SQS dependency.


36-37: LGTM: Struct field types updated correctly.

The types for APRData and FeesData fields in the MockRoutablePool struct have been updated to use sqspassthroughdomain instead of passthroughdomain, maintaining consistency with the import changes.


44-44: LGTM: Method signature updated correctly.

The return type of the GetAPRData method has been updated to use sqspassthroughdomain.PoolAPRDataStatusWrap, maintaining consistency with the struct field type changes.


49-49: LGTM: Method signature updated correctly.

The return type of the GetFeesData method has been updated to use sqspassthroughdomain.PoolFeesDataStatusWrap, maintaining consistency with the struct field type changes.


54-54: LGTM: Method signatures updated correctly.

The parameter types for both SetAPRData and SetFeesData methods have been updated to use sqspassthroughdomain types, maintaining consistency with the struct field type changes.

Also applies to: 59-59


Line range hint 1-279: Summary: Consistent package reference updates throughout the file.

The changes in this file are focused on updating the package reference from passthroughdomain to sqspassthroughdomain. This update has been consistently applied to the import statement, struct field types, and method signatures. The changes align with the PR objective of removing the SQS dependency while maintaining the existing functionality of the mock implementation.

These updates should not introduce any functional changes to the mock, but they ensure that the mock remains compatible with the updated package structure. The consistency of these changes across the file is commendable.

app/sidecar_query_server.go (2)

52-52: LGTM: New import for sqspassthroughdomain

The addition of the import statement for sqspassthroughdomain is necessary to support the type change for aprFetcher. This import aligns with the PR objective of restructuring the codebase.


52-52: Summary: Refactoring impact and testing recommendation

The changes in this file are part of a larger refactoring effort to move functionality from passthroughdomain to sqspassthroughdomain. The modifications are localized to the type of aprFetcher and its corresponding import, which suggests a careful approach to minimize impact on the existing codebase.

To ensure the refactoring hasn't introduced any regressions:

  1. Thoroughly test the APR fetching functionality to verify it still works as expected with the new type.
  2. Check if any other parts of the system that interact with PoolAPR need to be updated or tested.
  3. Run the full test suite to catch any potential issues in areas that might be indirectly affected by this change.

To help with testing, you can use the following command to find all files that use the PoolAPR type:

#!/bin/bash
# Find all Go files that use PoolAPR
rg 'PoolAPR' --type go

This will help identify any other areas of the codebase that might need attention due to this refactoring.

Also applies to: 220-220

pools/usecase/pools_usecase.go (6)

32-32: LGTM: Import statement added correctly.

The new import for sqspassthroughdomain is correctly added and aligns with the changes in the code.


57-58: LGTM: Struct field types updated correctly.

The aprPrefetcher and poolFeesPrefetcher field types in the poolsUseCase struct have been correctly updated to use the new sqspassthroughdomain package.


511-511: LGTM: Method signature updated correctly.

The RegisterAPRFetcher method signature has been properly updated to use sqspassthroughdomain.PoolAPR, maintaining consistency with the struct field changes.


516-516: LGTM: Method signature updated correctly.

The RegisterPoolFeesFetcher method signature has been properly updated to use sqspassthroughdomain.PoolFee, maintaining consistency with the struct field changes.


658-658: LGTM: Method updated correctly to use new types.

The setPoolAPRAndFeeDataIfConfigured method has been properly updated to use sqspassthroughdomain.PoolAPRDataStatusWrap and sqspassthroughdomain.PoolFeesDataStatusWrap, maintaining consistency with the package changes.

Also applies to: 672-672


32-32: Summary: Consistent package update from passthroughdomain to sqspassthroughdomain

The changes in this file are part of a larger refactoring effort to move from the passthroughdomain package to the sqspassthroughdomain package. The updates are consistent across imports, struct fields, method signatures, and internal method calls. These changes do not introduce any logical errors and maintain the existing functionality.

To ensure the refactoring is complete:

  1. Verify that all other files in the project that used passthroughdomain have been updated similarly.
  2. Update any relevant documentation or comments that might reference the old package name.
  3. If there are any external dependencies or APIs that interact with these types, ensure they are also updated or that proper compatibility is maintained.

Also applies to: 57-58, 511-511, 516-516, 658-658, 672-672

"github.com/osmosis-labs/sqs/sqsutil/sqshttp"
)

type TimeSeriesHTTPClient interface {
GetPoolFees() (*PoolFees, error)
GetPoolFees() (*sqspassthroughdomain.PoolFees, error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Potential Issue Detected: GetPoolFees usage in sqsutil/datafetchers/numia_apr_fetcher.go

  • The GetPoolFees method in TimeSeriesHTTPClientImpl now returns *sqspassthroughdomain.PoolFees, which may not be compatible with its usage in sqsutil/datafetchers/numia_apr_fetcher.go.
🔗 Analysis chain

LGTM: Interface method signature updated correctly.

The GetPoolFees method signature has been properly updated to use the sqspassthroughdomain.PoolFees type, which aligns with the PR objective of removing SQS dependencies.

To ensure this change doesn't break existing implementations or usages, please run the following script:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of the TimeSeriesHTTPClient interface change

# Test: Search for implementations of the TimeSeriesHTTPClient interface
echo "Searching for TimeSeriesHTTPClient implementations:"
rg --type go "type \w+ struct" -A 5 | rg "TimeSeriesHTTPClient"

# Test: Search for usages of the GetPoolFees method
echo "Searching for GetPoolFees method usages:"
rg --type go "GetPoolFees\(\)"

Length of output: 716

@@ -216,7 +217,7 @@ func NewSideCarQueryServer(appCodec codec.Codec, config domain.Config, logger lo

// Iniitialize data fetcher for pool APRs
fetchPoolAPRsCallback := datafetchers.GetFetchPoolAPRsFromNumiaCb(numiaHTTPClient, logger)
var aprFetcher datafetchers.MapFetcher[uint64, passthroughdomain.PoolAPR] = datafetchers.NewMapFetcher(fetchPoolAPRsCallback, time.Minute*time.Duration(passthroughConfig.APRFetchIntervalMinutes))
var aprFetcher datafetchers.MapFetcher[uint64, sqspassthroughdomain.PoolAPR] = datafetchers.NewMapFetcher(fetchPoolAPRsCallback, time.Minute*time.Duration(passthroughConfig.APRFetchIntervalMinutes))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Remaining occurrences of passthroughdomain.PoolAPR found

Multiple instances of passthroughdomain.PoolAPR are still present in the codebase and need to be updated to sqspassthroughdomain.PoolAPR to ensure consistency with the refactoring effort:

  • sqsdomain/pools.go
  • sqsdomain/passthroughdomain/pool_apr.go
  • sqsutil/datafetchers/numia_apr_fetcher.go
  • pools/usecase/pools_usecase_test.go
  • pools/usecase/pools_usecase.go
  • domain/passthrough/numia_http_client.go
  • domain/mocks/pool_mock.go
  • pools/delivery/http/pools_handler.go
  • app/sidecar_query_server.go

Please update these references accordingly.

🔗 Analysis chain

LGTM: Type update for aprFetcher

The change from passthroughdomain.PoolAPR to sqspassthroughdomain.PoolAPR is consistent with the PR objective of removing SQS from sqsdomain. This modification doesn't alter the functionality of the code and appears to be part of a larger refactoring effort.

To ensure consistency across the codebase, let's verify if there are any other occurrences of passthroughdomain.PoolAPR that might need to be updated:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining occurrences of passthroughdomain.PoolAPR
rg 'passthroughdomain\.PoolAPR' --type go

Length of output: 9334

@p0mvn p0mvn merged commit 382296c into v26.x Sep 27, 2024
8 of 9 checks passed
@p0mvn p0mvn deleted the roman/remove-sqs-from-sqsdomain branch September 27, 2024 20:30
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.

2 participants