From 6c97d8a4590673cd9ce5c338ec074014f71af3e4 Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Mon, 5 Jan 2026 17:16:57 +0900 Subject: [PATCH 1/2] github: scripts: commit_linter: Handle bin prefix for fluent-bit.c Signed-off-by: Hiroshi Hatake --- .github/scripts/commit_prefix_check.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/scripts/commit_prefix_check.py b/.github/scripts/commit_prefix_check.py index fffba6d87ae..b8c14c2e3c5 100644 --- a/.github/scripts/commit_prefix_check.py +++ b/.github/scripts/commit_prefix_check.py @@ -62,11 +62,14 @@ def infer_prefix_from_paths(paths): component_prefixes.add(f"{parts[1]}:") # ----- src/ → flb_xxx.* → xxx: OR src// → : ----- + # ----- src/fluent-bit.c → bin: ----- if p.startswith("src/"): filename = os.path.basename(p) if filename.startswith("flb_"): core = filename[4:].split(".")[0] component_prefixes.add(f"{core}:") + elif filename == "fluent-bit.c": + component_prefixes.add("bin:") else: parts = p.split("/") if len(parts) > 1: From 1864ee4c3995046098ea3f108edf26a49f10b8bb Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Mon, 5 Jan 2026 17:17:39 +0900 Subject: [PATCH 2/2] github: scripts: commit_linter: Add test cases for entrypoint Signed-off-by: Hiroshi Hatake --- .github/scripts/tests/test_commit_lint.py | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/scripts/tests/test_commit_lint.py b/.github/scripts/tests/test_commit_lint.py index 575a7f814b2..ec6b9982a03 100644 --- a/.github/scripts/tests/test_commit_lint.py +++ b/.github/scripts/tests/test_commit_lint.py @@ -66,6 +66,16 @@ def test_infer_multiple_prefixes(): # At least one real component touched → build is optional assert build_optional is True +def test_infer_prefix_fluent_bit_entrypoint(): + """ + Test that src/fluent-bit.c infers bin: prefix. + + fluent-bit.c is the main entry point of the fluent-bit binary, + so commits touching this file should allow the 'bin:' prefix. + """ + prefixes, build_optional = infer_prefix_from_paths(["src/fluent-bit.c"]) + assert prefixes == {"bin:"} + assert build_optional is True # ----------------------------------------------------------- # Tests: Bad Squash Detection @@ -158,6 +168,21 @@ def test_valid_commit_multiple_signoffs_allowed(): assert ok is True +def test_valid_commit_bin_prefix_for_fluent_bit(): + """ + Test that commits modifying src/fluent-bit.c allow the 'bin:' prefix. + + The fluent-bit.c file represents the binary entry point, so using + 'bin:' as the commit prefix should be valid. + """ + commit = make_commit( + "bin: adjust startup behavior\n\nSigned-off-by: User", + ["src/fluent-bit.c"] + ) + ok, _ = validate_commit(commit) + assert ok is True + + # ----------------------------------------------------------- # Tests: validate_commit ERROR CASES # -----------------------------------------------------------