From 1364c882c6ae2cc7d1416e53581a1a00a4469cd7 Mon Sep 17 00:00:00 2001 From: Vishal More Date: Mon, 13 Jul 2026 06:27:05 +0530 Subject: [PATCH] promtool: add promql-binop-fill-modifiers to --enable-feature handling (#19153) Signed-off-by: vishal --- cmd/promtool/main.go | 2 ++ cmd/promtool/main_test.go | 2 +- cmd/promtool/testdata/features.yml | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/promtool/main.go b/cmd/promtool/main.go index e50f67fd4a..e333fab191 100644 --- a/cmd/promtool/main.go +++ b/cmd/promtool/main.go @@ -364,6 +364,8 @@ func main() { // This feature is now permanently enabled and therefore a no-op. case "promql-extended-range-selectors": promtoolParserOpts.EnableExtendedRangeSelectors = true + case "promql-binop-fill-modifiers": + promtoolParserOpts.EnableBinopFillModifiers = true case "": continue default: diff --git a/cmd/promtool/main_test.go b/cmd/promtool/main_test.go index 7a15cf1c0b..470f9db109 100644 --- a/cmd/promtool/main_test.go +++ b/cmd/promtool/main_test.go @@ -702,7 +702,7 @@ func TestCheckRulesWithFeatureFlag(t *testing.T) { // As opposed to TestCheckRules calling CheckRules directly we run promtool // so the feature flag parsing can be tested. - args := []string{"-test.main", "--enable-feature=promql-experimental-functions", "--enable-feature=promql-extended-range-selectors", "check", "rules", "testdata/features.yml"} + args := []string{"-test.main", "--enable-feature=promql-experimental-functions", "--enable-feature=promql-extended-range-selectors", "--enable-feature=promql-binop-fill-modifiers", "check", "rules", "testdata/features.yml"} tool := exec.Command(promtoolPath, args...) err := tool.Run() require.NoError(t, err) diff --git a/cmd/promtool/testdata/features.yml b/cmd/promtool/testdata/features.yml index 946e07d0d7..36d374b120 100644 --- a/cmd/promtool/testdata/features.yml +++ b/cmd/promtool/testdata/features.yml @@ -8,3 +8,5 @@ groups: expr: rate(up[1m * 2]) - record: promql-extended-range-selectors expr: rate(up[1m] anchored) + - record: promql-binop-fill-modifiers + expr: rate(up[5m]) + fill(0) rate(down[5m])