feat: allow computed fractional bucket variants
维护者通常 2 天内回复
评估
调研方向
首先找到 Java 中 fractional bucketing 的实现及其测试;issue 指向 Go 实现,并将对应的 terminal-variant 测试作为行为参考。检查 variant 表达式是否在 bucketing 之前只求值一次,以及其结果类型是否会被拒绝。为计算得到的 variant 添加测试,包括一个 resolve 表达式,并确认 bucketing 仍然只取决于 bucketing 值和权重。
由索引模型根据 Issue 内容生成。
描述
A fractional bucket variant can be any JSON Logic expression, not only a literal:
{
"state": "ENABLED",
"defaultVariant": "blue",
"variants": {
"red": "#FF0000",
"blue": "#0000FF"
},
"targeting": {
"fractional": [
[{ "cat": ["r", "ed"] }, 50],
["blue", 50]
]
}
}
- Evaluate each variant expression once, before bucketing, and return the result for the selected bucket.
- Accept a primitive (string, number, boolean, null) or the
resolveresult as the variant. Any other result (e.g. an object or array) makesfractionalreturnnull, so the flag falls back to its default variant. - Bucketing doesn't change; it depends only on the bucketing value and the weights.
This may already work, or only need a variant type check adjusted. Either way, please add tests for a computed variant and for a non-primitive result.
Why: this allows the new resolve operator as a bucket variant (e.g. [{ "resolve": ["red", "SPLIT"] }, 50]), so each bucket can set its own reason and metadata.
References:
- Go implementation: open-feature/flagd#2127 (the
fractional.gochange and the "fractional bucket variant is terminal" test inresolve_test.go) - Gherkin scenarios: open-feature/flagd-testbed#448
- 主要语言
- Java
- 星标
- 51
- 派生
- 90
- 平均合并
- 1 天 6 小时
- 30 天内合并 PR
- 14
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
open-feature/java-sdk-contrib 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
open-feature/java-sdk-contrib#1991 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
open-feature/java-sdk-contrib#1973 ·
维护者通常 2 天内回复
-
test(flagd): drop the per-scenario /stop in e2e teardown once the testbed includes flagd-testbed#396未关闭
难度 2/5 1-3 小时 新手友好度 68/100
open-feature/java-sdk-contrib#1891 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
open-feature/java-sdk-contrib#1861 ·
维护者通常 2 天内回复
-
fix!: opentelemetry-semconv-incubating bump renames feature_flag.provider_name attribute可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
open-feature/java-sdk-contrib#1843 ·
维护者通常 2 天内回复
查看 open-feature/java-sdk-contrib 的全部 Issue
相似的 Issue
-
documentation good first issue help wanted
难度 1/5 1 小时以内 新手友好度 90/100
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 2 天内回复
-
bug key bindings
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复
-
Android Bug Core Drape
难度 2/5 1-3 小时 新手友好度 77/100
organicmaps/organicmaps#14449 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
openhab/openhab-addons#22512 ·
维护者通常 1 天内回复