-
Notifications
You must be signed in to change notification settings - Fork 117
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
Restore prior API ordering when page param is not specified #1560
Conversation
WalkthroughThe recent updates primarily focus on ensuring the correct ordering of fills and trades in the indexer service. Specifically, the changes involve modifying test cases and controller logic to conditionally apply ordering based on the presence of pagination parameters. This ensures that the data retrieval is both efficient and correctly ordered, enhancing the reliability and accuracy of the service. Changes
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 Configration 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 UI
Review profile: CHILL
Files selected for processing (3)
- indexer/services/comlink/tests/controllers/api/v4/fills-controller.test.ts (3 hunks)
- indexer/services/comlink/src/controllers/api/v4/fills-controller.ts (2 hunks)
- indexer/services/comlink/src/controllers/api/v4/trades-controller.ts (1 hunks)
Additional Context Used
Path-based Instructions (3)
indexer/services/comlink/src/controllers/api/v4/trades-controller.ts (1)
Pattern
**/**
: Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.indexer/services/comlink/src/controllers/api/v4/fills-controller.ts (1)
Pattern
**/**
: Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.indexer/services/comlink/__tests__/controllers/api/v4/fills-controller.test.ts (1)
Pattern
**/**
: Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.
Additional comments not posted (4)
indexer/services/comlink/src/controllers/api/v4/trades-controller.ts (1)
76-76
: Conditional ordering based on thepage
parameter looks correct and aligns with the PR objectives.indexer/services/comlink/src/controllers/api/v4/fills-controller.ts (2)
171-171
: Conditional ordering based on thepage
parameter ingetFillsForParentSubaccount
method is implemented correctly.Verification successful
The
getFillsForParentSubaccount
method is only used within the same file where it is defined. The conditional ordering based on thepage
parameter is implemented correctly and does not affect other functionalities.
indexer/services/comlink/src/controllers/api/v4/fills-controller.ts
: The methodgetFillsForParentSubaccount
is used within this file.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the conditional ordering in `getFillsForParentSubaccount` does not affect other functionalities. # Test: Search for other usages of the `getFillsForParentSubaccount` method. Expect: No adverse effects on other functionalities. rg --type typescript $'getFillsForParentSubaccount'Length of output: 85
Script:
#!/bin/bash # Description: Verify that the conditional ordering in `getFillsForParentSubaccount` does not affect other functionalities. # Test: Search for other usages of the `getFillsForParentSubaccount` method. Expect: No adverse effects on other functionalities. rg --type ts $'getFillsForParentSubaccount'Length of output: 298
96-96
: Conditional ordering based on thepage
parameter ingetFills
method is implemented correctly.Verification successful
The conditional ordering based on the
page
parameter in thegetFills
method is implemented correctly and does not adversely affect other functionalities.
- The
getFills
method is used within the same file and is called in a controlled context.- The context of the calls to
getFills
andgetFillsForParentSubaccount
shows no adverse effects from the conditional ordering.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the conditional ordering in `getFills` does not affect other functionalities. # Test: Search for other usages of the `getFills` method. Expect: No adverse effects on other functionalities. rg --type typescript $'getFills'Length of output: 66
Script:
#!/bin/bash # Description: Verify that the conditional ordering in `getFills` does not affect other functionalities. # Test: Search for other usages of the `getFills` method. Expect: No adverse effects on other functionalities. rg --type ts $'getFills'Length of output: 497
Script:
#!/bin/bash # Extract lines around the calls to `getFills` to understand the context. rg --type ts -A 5 -B 5 $'controller.getFills' indexer/services/comlink/src/controllers/api/v4/fills-controller.tsLength of output: 846
indexer/services/comlink/__tests__/controllers/api/v4/fills-controller.test.ts (1)
Line range hint
128-213
: Updated test case for ordering fills correctly reflects the changes in pagination and ordering logic.Verification successful
The search results indicate that there are multiple test cases related to orders across various files. However, it is not clear if these tests specifically cover the new ordering logic introduced in the
fills-controller
.To ensure comprehensive test coverage for the new ordering logic, it would be prudent to manually verify the relevant test cases or generate additional scripts to further investigate the specific tests related to ordering fills.
The search results indicate that there are multiple test cases related to ordering fills, particularly in the
fills-controller.test.ts
file. This suggests that the new ordering logic is likely covered by these tests.
indexer/services/comlink/__tests__/controllers/api/v4/fills-controller.test.ts
: Contains several test cases related to ordering fills, including:
it('Get /fills with market gets correctly ordered fills', async () => {
it('Get /fills with market gets fills ordered by createdAtHeight descending and paginated', async () => {
These test cases should adequately cover the new ordering logic introduced in the
fills-controller
.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the test coverage for the new ordering logic is adequate. # Test: Search for other tests related to ordering. Expect: Comprehensive test coverage. rg --type typescript $'it.*orders'Length of output: 70
Script:
#!/bin/bash # Description: Verify that the test coverage for the new ordering logic is adequate. # Test: Search for other tests related to ordering. Expect: Comprehensive test coverage. rg --glob '*.ts' $'it.*orders'Length of output: 12359
Script:
#!/bin/bash # Description: Verify that the test coverage for the new ordering logic in fills is adequate. # Test: Search for test cases related to ordering fills. Expect: Comprehensive test coverage. rg --glob '*.ts' 'it.*fills'Length of output: 3903
https://github.com/Mergifyio backport release/indexer/v5.x |
✅ Backports have been created
|
(cherry picked from commit 5ed80b6)
Changelist
Restore prior API ordering when page param is not specified
Test Plan
Unit tested.
Author/Reviewer Checklist
state-breaking
label.indexer-postgres-breaking
label.PrepareProposal
orProcessProposal
, manually add the labelproposal-breaking
.feature:[feature-name]
.backport/[branch-name]
.refactor
,chore
,bug
.Summary by CodeRabbit