Skip to content

fix(Segments): Standardise regex matching in the Rust server-side SDK - #47

Open
linear-code[bot] wants to merge 1 commit into
mainfrom
linear/sdk-29-standardise-regex-matching-in-the-rust-server-side-sdk-948c
Open

linear-code[bot] wants to merge 1 commit into
mainfrom
linear/sdk-29-standardise-regex-matching-in-the-rust-server-side-sdk-948c

Conversation

@linear-code

@linear-code linear-code Bot commented Nov 3, 2026

Copy link
Copy Markdown

Local evaluation in the Rust SDK accepted a regex match anywhere in a trait value, so prod put nonproduction in a segment. The documented behaviour is that a match must start at the beginning of the value but doesn't need to cover all of it. This applies to every alternative, so prod|dev matches development but not nondev. The SDK picks this up once it's released and the SDK's engine dependency is bumped.

Changes

  • Regex segment conditions match only from the start of the trait value, with no full-match requirement
  • The same rule applies to the legacy segment condition API
  • Invalid patterns still never match. The pattern isn't rewritten, so something like a)(b can't turn into a valid regex.
  • Added regression cases for prefix, mid-string, alternation, end-anchored and case-sensitive matching
  • Rust SDK uses an engine release that includes this fix

Closes https://linear.app/flagsmith/issue/SDK-29/standardise-regex-matching-in-the-rust-server-side-sdk

Review effort: 1/5

Regex segment conditions now match from the start of the trait value
without requiring a full match, for every alternative.

Generated with [Linear](https://linear.app/flagsmith/agent-session/66b7a12c-3bbd-4599-ab9e-1707ded40ef2)

Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
@linear-code
linear-code Bot requested a review from a team as a code owner November 3, 2026 15:46
@linear-code
linear-code Bot removed the request for review from a team November 3, 2026 15:46
@linear-code
linear-code Bot requested a review from emyller November 3, 2026 15:46
@linear-code

linear-code Bot commented Nov 3, 2026

Copy link
Copy Markdown
Author

SDK-29

@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 91fc3d78-be16-4851-9830-aa310a82c548

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@linear-code

linear-code Bot commented Nov 3, 2026

Copy link
Copy Markdown
Author

@coderabbitai review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants