Skip to content
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

Config v6 #96

Merged
merged 28 commits into from
Nov 23, 2023
Merged

Config v6 #96

merged 28 commits into from
Nov 23, 2023

Conversation

adams85
Copy link
Contributor

@adams85 adams85 commented Oct 20, 2023

Implements config v6 support.

Features/improvements:

  • Fetch new config json version (config_v6.json) and update config model
  • SDK key format validation (when client is not set up to use local-only flag overrides)
  • AND conditions
  • New condition types
    • Prerequisite flag condition
    • Segment condition
  • Changed comparison operators
    • (NOT) CONTAINS ANY OF
  • New comparison operators
    • BEFORE/AFTER
    • TEXT (NOT) EQUALS (both hashed and cleartext)
    • TEXT (NOT) STARTS/ENDS WITH ANY OF (both hashed and cleartext)
    • ARRAY CONTAINS ANY OF (both hashed and cleartext)
  • Percentage options within targeting rules
  • Percentage options based on custom attributes
  • Custom User Object attribute handling (don't force string values + autoconversions under the hood)
  • User Object attribute/comparison value trimming
  • Comparison value hashing changes (SHA256, salting)
  • Flag overrides vs. config json salt and segments
  • IEvaluationDetails.matchedTargetingRule/matchedPercentageOption properties (rename + set combinations correctly)

Tests:

  • Evaluation matrix tests
  • Evaluation log tests
  • SDK key format validation
  • Custom User Object attribute handling (don't force string values + autoconversions under the hood)
  • Flag overrides vs. prerequisite flags (circular dependency, comparison value type mismatch, dependent/prereq flag overriding)
  • Flag overrides vs. config json salt and segments (skipped as JS SDKs don't support full config json flag overrides)
  • IEvaluationDetails.matchedTargetingRule/matchedPercentageOption properties (rename + set combinations correctly)

Related improvements/fixes:

  • Dynamically typed languages should log a warning when default value doesn't match the setting type (see https://trello.com/c/Le6vimGu) (because of TS, we need to implement the behavior of statically typed languages)
  • We should go to the cache in all polling modes instead of using the in memory variable (see https://trello.com/c/rreKm64A) (done earlier)

Breaking changes:

  • Rename the matchedEvaluationRule property to matchedTargetingRule and the matchedEvaluationPercentageRule property to matchedPercentageOption in IEvaluationDetails.
  • Change config model (IConfig and related interfaces/enums).

Requirement checklist (only if applicable)

  • I have covered the applied changes with automated tests.
  • I have executed the full automated test set against my changes.
  • I have validated my changes against all supported platform versions.
  • I have read and accepted the contribution agreement.

@adams85 adams85 requested a review from a team as a code owner October 20, 2023 18:23
@adams85 adams85 marked this pull request as draft October 20, 2023 18:24
@codecov
Copy link

codecov bot commented Oct 20, 2023

Codecov Report

Attention: 25 lines in your changes are missing coverage. Please review.

Comparison is base (b21f14e) 91.69% compared to head (6b0866b) 92.70%.

Files Patch % Lines
src/RolloutEvaluator.ts 97.60% 11 Missing ⚠️
src/EvaluateLogBuilder.ts 94.79% 9 Missing ⚠️
src/ConfigCatClient.ts 91.42% 3 Missing ⚠️
src/Utils.ts 95.91% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #96      +/-   ##
==========================================
+ Coverage   91.69%   92.70%   +1.00%     
==========================================
  Files          18       20       +2     
  Lines        1626     2069     +443     
  Branches      412      560     +148     
==========================================
+ Hits         1491     1918     +427     
- Misses        134      150      +16     
  Partials        1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@adams85 adams85 force-pushed the config-v6 branch 4 times, most recently from 96f6570 to 9cb76f9 Compare October 30, 2023 19:12
@adams85 adams85 marked this pull request as ready for review October 31, 2023 18:24
Copy link
Member

@laliconfigcat laliconfigcat left a comment

Choose a reason for hiding this comment

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

hero-cat-only

src/RolloutEvaluator.ts Show resolved Hide resolved
src/RolloutEvaluator.ts Show resolved Hide resolved
@adams85 adams85 force-pushed the config-v6 branch 3 times, most recently from 54f1237 to b88db79 Compare November 7, 2023 09:46
# Conflicts:
#	src/ConfigCatClientOptions.ts
#	test/ConfigCatClientTests.ts
Copy link

sonarcloud bot commented Nov 23, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 63 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@adams85 adams85 merged commit d85b948 into master Nov 23, 2023
16 checks passed
@adams85 adams85 deleted the config-v6 branch November 23, 2023 12:27
@VitaliyPotapov
Copy link

Hi! Could you advice how to use ARRAY CONTAINS ANY OF comparator?
I see it in documentation, but in configcat dashboard I see only these comparators:
image

@adams85
Copy link
Contributor Author

adams85 commented Jan 29, 2024

The ARRAY CONTAINS ANY OF comparator is part of our upcoming new feature pack named Config V2.

Although this feature is already supported by the SDK, it's not available on the dashboard yet.

However, if you are interested in Config V2, you can try it soon as the Beta Test is about to launch in the next weeks. For more details, please watch our news page or join this public slack channel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants