Skip to content

Lexicographical targeting. #10741

@wuguishifu

Description

@wuguishifu

Describe the feature request

Lexicographical sorting for strategy targets such as STR_GT, STR_LT, STR_GTE, STR_LTE, STR_BETWEEN.

Background

I have a few tests that have a LOT of strategies because I need to target specific sets of data (e.g. subscription product + expiration date past certain time + app version greater than specific version). So right now my tests look like this:

Strategy 1

  • subscription product IN com.example.mysubscription
  • expiration_date NUM_GT 20250101000000
  • app_version SEMVER_GT 13.0.99

Strategy 2

  • subscription product IN com.example.myothersubscription
  • expiration_date NUM_GT 20230130000000 (different expiration date)
  • app_version SEMVER_GT 13.0.99

So basically, I would like to be able to target based on groups of items.

Solution suggestions

A good pattern for doing this would be using a lexicographical sort. This is similar to how AWS DynamoDB can filter primary keys and makes it very powerful. So for example, I could say like:

value STR_GT "{product ID}#{expiration date}#{app version}"
AND
value STR_LT "{product ID}#{expiration date}"

which would then correctly check for all of these fields at the same time.

A better option would be something like

value STR_BETWEEN "{value 1}" "{value 2}"

so the strategy targeting could be simplified.

Then, it would be nice to be able to group multiple with an OR (similar to IN) so you could do like:

value IN
  - STR_BETWEEN a b
  - STR_BETWEEN c d
  - STR_BETWEEN e f

and this would let you condense a lot of complex strategy queries into a single strategy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    For later

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions