From 78e6f9758631f05cd316c1b9adc2f85b4b7164ab Mon Sep 17 00:00:00 2001 From: Alexander Schwartzman Date: Mon, 19 Oct 2026 11:53:54 -0400 Subject: [PATCH 1/2] fix(ci): the plugin API check compares a used function's signature, not only that it exists --- .github/scripts/check_plugin_api.py | 6 ++++-- tst/unit/test_check_plugin_api.py | 8 +++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/scripts/check_plugin_api.py b/.github/scripts/check_plugin_api.py index 962fbd91..c66d524c 100644 --- a/.github/scripts/check_plugin_api.py +++ b/.github/scripts/check_plugin_api.py @@ -419,8 +419,10 @@ def caller_breaks(path: str, old: griffe.Object, new: griffe.Object, reshaped: s else: found += [f"{path}.{name}: no longer in __all__" for name in sorted(set(before or ()) - set(after or ())) if name in new.members] - for breakage in griffe.find_breaking_changes(old, new): - if _benign(breakage, old, new) or breakage.obj.path in reshaped: + scope = (old.parent, new.parent) if old.is_function else (old, new) + for breakage in griffe.find_breaking_changes(*scope): + if (old.is_function and breakage.obj.path != old.path) or _benign(breakage, old, new) \ + or breakage.obj.path in reshaped: continue found.append(_describe(breakage, public)) return found diff --git a/tst/unit/test_check_plugin_api.py b/tst/unit/test_check_plugin_api.py index 84fc4c5b..c517e278 100644 --- a/tst/unit/test_check_plugin_api.py +++ b/tst/unit/test_check_plugin_api.py @@ -116,6 +116,10 @@ def settings(package, config=None): "internal.py": ''' def compute(x): return x +''', + "runner/store.py": ''' +def count_runs(task_id=None): + return 0 ''', } @@ -188,11 +192,13 @@ def _check(tmp_path: Path, edits: list[tuple[str, str, str]], title: str | None "agent_env.plugins.ENVS: Attribute value was changed"), ([(ARTIFACT, "Field(default=0,", "Field(default=1,")], "agent_env.artifact.artifact.Artifact.version: Attribute value was changed"), + ([("runner/store.py", "def count_runs(task_id=None):", "def count_runs(task_id):")], + "agent_env.runner.store.count_runs(task_id): Parameter is now required"), ], ids=["method-removed", "parameter-renamed", "required-parameter-added", "default-changed", "class-attribute-changed", "base-removed", "abstract-method-added", "method-became-abstract", "method-became-required", "hook-parameter-added", "async-to-sync", "classmethod-to-staticmethod", "required-private-method-changed", "dataclass-field-removed", "dropped-from-all", "export-removed", "settings-signature-changed", - "group-name-changed", "field-default-changed"]) + "group-name-changed", "field-default-changed", "used-function-signature-changed"]) def test_reports_a_break(tmp_path, edits, reported): result = _check(tmp_path, edits) From a66f987c4d0d70f894a866116d2ed9594cafb9be Mon Sep 17 00:00:00 2001 From: Alexander Schwartzman Date: Mon, 19 Oct 2026 12:54:00 -0400 Subject: [PATCH 2/2] test(ci): a change to a used function's sibling passes the check --- tst/unit/test_check_plugin_api.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tst/unit/test_check_plugin_api.py b/tst/unit/test_check_plugin_api.py index c517e278..e0aad0e7 100644 --- a/tst/unit/test_check_plugin_api.py +++ b/tst/unit/test_check_plugin_api.py @@ -120,6 +120,10 @@ def compute(x): "runner/store.py": ''' def count_runs(task_id=None): return 0 + + +def prune_runs(days=30): + return 0 ''', } @@ -219,9 +223,10 @@ def test_reports_a_break(tmp_path, edits, reported): [(CONTEXT, " agent_model: str | None = None\n", " agent_harness: str | None = None\n agent_model: str | None = None\n")], [(ARTIFACT, 'Field(description="Unique id")', 'Field(description="The artifact\'s id")')], + [("runner/store.py", "def prune_runs(days=30):", "def prune_runs(days):")], ], ids=["docstring", "new-optional-method", "private-rename", "internal-module", "parameter-swallowed-by-kwargs", "annotation-gains-a-value", "instance-attribute-expression", "default-to-equal-literal", - "dataclass-field-inserted", "field-description"]) + "dataclass-field-inserted", "field-description", "unused-sibling-of-a-used-function"]) def test_passes_a_compatible_change(tmp_path, edits): result = _check(tmp_path, edits)