Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Support `$.flags` context values in segment conditions

Đang mở
#40 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
52/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu bằng cách xác định đường dẫn get_value_from_jsonpath của engine và lệnh gọi JsonPath::parse, sau đó đọc luồng đánh giá xung quanh các điều kiện segment và AST serde_json_path_core::spec. Sử dụng các trường hợp dependency dùng chung từ engine-test-data và so sánh với implementation tham chiếu trong flagsmith-engine#343. Được xem là hoàn tất khi các trường hợp dependency đều pass, các context không có $.flags tránh được overhead ở mỗi lần đánh giá và việc phát hiện tuân theo AST của parser.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Dependent flags let a segment condition read another flag's result via a $.flags.<feature name>.<enabled|value|variant> property, so that flag has to be resolved before the condition is evaluated. Behaviour is defined by the shared cases in Flagsmith/engine-test-data#59; schema in Flagsmith/flagsmith#8396; reference implementation in Flagsmith/flagsmith-engine#343.

The reference implementation resolves a flag lazily, on first read, rather than scanning every condition up front to discover dependencies. Three things in this engine currently prevent that:

  • get_value_from_jsonpath calls serde_json::to_value(ec) on every lookup, serialising the whole context (~268 µs on a 263-feature environment, of which the query itself is 389 ns). A lazily resolved flags map has nothing to be inserted into, and lookups already dominate evaluation.
  • JsonPath::parse also runs on every lookup (~1.5 µs), uncached.
  • serde_json::Value exposes no lookup hook, so resolution must be triggered by inspecting the parsed path. serde_json_path::JsonPath keeps its Query private, though the AST is public in serde_json_path_core::spec.
Acceptance criteria
  • engine-test-data is bumped from v3.7.0 to the tag containing the flag dependency cases, and they pass.
  • An environment with no $.flags conditions gains no per-evaluation cost.
  • Dependency detection uses the parser's AST, not a bespoke matcher, so all pinned spellings of a query agree.
Ngôn ngữ chính
Rust
Star
1
Fork
0
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Flagsmith/flagsmith-rust-flag-engine

Tất cả issue của Flagsmith/flagsmith-rust-flag-engine

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.