Skip to content

[O2B-1544] Fix envs query builder and add test#2096

Merged
isaachilly merged 2 commits intomainfrom
bug/O2B-1544/fix-env-filtering-pagination
Mar 5, 2026
Merged

[O2B-1544] Fix envs query builder and add test#2096
isaachilly merged 2 commits intomainfrom
bug/O2B-1544/fix-env-filtering-pagination

Conversation

@isaachilly
Copy link
Collaborator

@isaachilly isaachilly commented Mar 4, 2026

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

  • branch and/or PR name(s) include(s) JIRA ID
  • issue has "Fix version" assigned
  • issue "Status" is set to "In review"
  • PR labels are selected

Notable changes for users:

  • N/A

Notable changes for developers:

  • N/A

Changes made to the database:

  • N/A

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.
@isaachilly isaachilly self-assigned this Mar 4, 2026
@isaachilly isaachilly added backend javascript Pull requests that update Javascript code labels Mar 4, 2026
@isaachilly isaachilly marked this pull request as ready for review March 4, 2026 18:47
@isaachilly isaachilly requested a review from graduta as a code owner March 4, 2026 18:47
@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45.61%. Comparing base (55062b6) to head (02d7f53).
⚠️ Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@NarrowsProjects NarrowsProjects left a comment

Choose a reason for hiding this comment

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

Minor code stylisation change request

This improves readability and extensibility.
@isaachilly isaachilly merged commit 70597fe into main Mar 5, 2026
40 of 41 checks passed
@isaachilly isaachilly deleted the bug/O2B-1544/fix-env-filtering-pagination branch March 5, 2026 11:13
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend javascript Pull requests that update Javascript code

Development

Successfully merging this pull request may close these issues.

3 participants