Skip to content

feat: Add explicit ordering for segment rule conditions #5671

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

Merged
merged 3 commits into from
Jul 1, 2025

Conversation

khvn26
Copy link
Member

@khvn26 khvn26 commented Jun 30, 2025

Thanks for submitting a PR! Please check the boxes below:

  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

This adds a SEGMENT_RULES_CONDITIONS_EXPLICIT_ORDERING_ENABLED setting to force ORDER BY id ASC clause to all segment condition selects, which remedies the existing problem with no guaranteed ordering (#5669).

How did you test this code?

Modified the existing view test to use the setting and avoid the explicit test data result ordering, which obviously masked the problem in the first place.

@khvn26 khvn26 requested review from a team as code owners June 30, 2025 17:06
@khvn26 khvn26 requested review from Zaimwa9 and removed request for a team June 30, 2025 17:06
Copy link

vercel bot commented Jun 30, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Jul 1, 2025 9:31am
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview Jul 1, 2025 9:31am
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview Jul 1, 2025 9:31am

@github-actions github-actions bot added api Issue related to the REST API docs Documentation updates labels Jun 30, 2025
Copy link
Contributor

github-actions bot commented Jun 30, 2025

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-5671 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-5671 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-5671 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-5671 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-5671 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-5671 Finished ✅ Results

@github-actions github-actions bot added feature New feature or request and removed docs Documentation updates labels Jun 30, 2025
Copy link
Contributor

@emyller emyller left a comment

Choose a reason for hiding this comment

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

LGTM without a comment typo.

I think you mentioned the possibility of making SEGMENT_RULES_CONDITIONS_EXPLICIT_ORDERING_ENABLED = True default for new users. Is that something we'd like to pursue in this PR?

Co-authored-by: Evandro Myller <[email protected]>
@khvn26
Copy link
Member Author

khvn26 commented Jun 30, 2025

the possibility of making SEGMENT_RULES_CONDITIONS_EXPLICIT_ORDERING_ENABLED = True default for new users. Is that something we'd like to pursue in this PR?

Not in this PR, as it's intended to quickly unblock a customer.

@github-actions github-actions bot added docs Documentation updates feature New feature or request and removed feature New feature or request docs Documentation updates labels Jun 30, 2025
Copy link

codecov bot commented Jun 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.76%. Comparing base (0235f18) to head (1be4c5a).
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5671   +/-   ##
=======================================
  Coverage   97.76%   97.76%           
=======================================
  Files        1245     1245           
  Lines       44062    44071    +9     
=======================================
+ Hits        43076    43085    +9     
  Misses        986      986           

☔ 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.

@github-actions github-actions bot added docs Documentation updates feature New feature or request and removed feature New feature or request docs Documentation updates labels Jun 30, 2025
@emyller emyller force-pushed the feat/add-segment-rules-conditions-explicit-ordering branch from 376f5ec to 4ea6956 Compare June 30, 2025 23:59
@github-actions github-actions bot added docs Documentation updates feature New feature or request and removed feature New feature or request docs Documentation updates labels Jun 30, 2025
@emyller emyller force-pushed the feat/add-segment-rules-conditions-explicit-ordering branch from 4ea6956 to b1644d3 Compare July 1, 2025 00:26
@github-actions github-actions bot added the docs Documentation updates label Jul 1, 2025
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request docs Documentation updates labels Jul 1, 2025
@khvn26 khvn26 force-pushed the feat/add-segment-rules-conditions-explicit-ordering branch from b1644d3 to d7eb88e Compare July 1, 2025 09:06
@github-actions github-actions bot added docs Documentation updates feature New feature or request and removed feature New feature or request docs Documentation updates labels Jul 1, 2025
@khvn26 khvn26 force-pushed the feat/add-segment-rules-conditions-explicit-ordering branch from e4bb950 to 1be4c5a Compare July 1, 2025 09:31
@github-actions github-actions bot added docs Documentation updates feature New feature or request and removed feature New feature or request docs Documentation updates labels Jul 1, 2025
@khvn26 khvn26 merged commit f124c76 into main Jul 1, 2025
30 checks passed
@khvn26 khvn26 deleted the feat/add-segment-rules-conditions-explicit-ordering branch July 1, 2025 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants