[O2B-1544] Fix envs query builder and add test#2096
Merged
isaachilly merged 2 commits intomainfrom Mar 5, 2026
Merged
Conversation
Replaced two-query pattern with a single queryBuilder in GetAllEnvironmentsUseCase. Two were unnecessary and pagination was implemented incorrectly (applied too early). Added a test to verify that total count reflects all matching environments and that paginated filtered results are correct across multiple pages.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2096 +/- ##
==========================================
- Coverage 45.63% 45.61% -0.02%
==========================================
Files 1039 1039
Lines 17324 17318 -6
Branches 3148 3147 -1
==========================================
- Hits 7905 7899 -6
Misses 9419 9419 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
NarrowsProjects
requested changes
Mar 5, 2026
Collaborator
NarrowsProjects
left a comment
There was a problem hiding this comment.
Minor code stylisation change request
test/lib/usecases/environment/GetAllEnvironmentsUseCase.test.js
Outdated
Show resolved
Hide resolved
This improves readability and extensibility.
NarrowsProjects
approved these changes
Mar 5, 2026
graduta
approved these changes
Mar 5, 2026
NarrowsProjects
pushed a commit
that referenced
this pull request
Mar 5, 2026
* Replaced the two-query pattern with a single queryBuilder in GetAllEnvironmentsUseCase. The previous approach was redundant following Sequelize performance improvements; furthermore, the original implementation's logic was flawed which resulted in the pagination bug.
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.
Replaced two-query pattern with a single queryBuilder in GetAllEnvironmentsUseCase. Two were unnecessary and pagination was implemented incorrectly (applied too early).
Added a test to verify that total count reflects all matching environments and that paginated filtered results are correct across multiple pages.
I have a JIRA ticket
Notable changes for users:
Notable changes for developers:
Changes made to the database: