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

feat: Add version_of and matches to rules and conditions #4988

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

zachaysan
Copy link
Contributor

Changes

When creating a new change request for segments we need a way of tracing which provided rules and conditions match the candidate change request so that the frontend can more visually associate which rules and conditions match between the change request and the targeted segment (the one that will be updated).

To do so I've reused the concept of version_of which was originally used for segments and I associate a rule to another rule (or sub-rule to sub-rule) and in that process also match up conditions at the same layer. If at least one condition matches, then the sub-rule and rule match and future matching for the subsequent sub-rule is guided by holding onto the match between the parent rule and its sister rule. This way matches are only ever tree like in nature.

Remaining work

Since the matching code is ready in this PR another PR will need to be opened to tie in these changes into the relevant code. Probably both the Workflows and Commons will need to be updated.

How did you test this code?

Lots of new tests. Some are simple, like checking that version_of gets correctly set, which is necessary due to an audit log bug we had when version_of was setup for the segments work.

@zachaysan zachaysan requested a review from a team as a code owner January 10, 2025 14:57
@zachaysan zachaysan requested review from matthewelwell and removed request for a team January 10, 2025 14:57
Copy link

vercel bot commented Jan 10, 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 Jan 10, 2025 4:29pm
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview Jan 10, 2025 4:29pm
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview Jan 10, 2025 4:29pm

@github-actions github-actions bot added api Issue related to the REST API feature New feature or request labels Jan 10, 2025
Copy link
Contributor

github-actions bot commented Jan 10, 2025

Docker builds report

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

Copy link
Contributor

github-actions bot commented Jan 10, 2025

Uffizzi Ephemeral Environment deployment-59778

☁️ https://app.uffizzi.com/github.com/Flagsmith/flagsmith/pull/4988

📄 View Application Logs etc.

What is Uffizzi? Learn more!

Copy link

codecov bot commented Jan 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.40%. Comparing base (8cd2731) to head (3c5ffea).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4988      +/-   ##
==========================================
+ Coverage   97.39%   97.40%   +0.01%     
==========================================
  Files        1191     1192       +1     
  Lines       41633    41849     +216     
==========================================
+ Hits        40549    40765     +216     
  Misses       1084     1084              

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

@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jan 10, 2025
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.

1 participant