diff --git a/internals/checks/e2e-attestations/cc-nice-lovelace-7db4qt.json b/internals/checks/e2e-attestations/cc-nice-lovelace-7db4qt.json new file mode 100644 index 000000000..308f687ba --- /dev/null +++ b/internals/checks/e2e-attestations/cc-nice-lovelace-7db4qt.json @@ -0,0 +1,7 @@ +{ + "command": "uv run python -m pytest tests/e2e -x -q", + "ran_at": 1787257108, + "exit_code": 0, + "commit": "047bd55743d01b021d0913aa52fa4824ea40c4a0", + "branch": "cc/nice-lovelace-7db4qt" +} diff --git a/internals/checks/src/checks/changelog_gate/decide.py b/internals/checks/src/checks/changelog_gate/decide.py index 0bee15539..daaa15967 100644 --- a/internals/checks/src/checks/changelog_gate/decide.py +++ b/internals/checks/src/checks/changelog_gate/decide.py @@ -55,6 +55,8 @@ def _is_exempt(path: str, pkg: str) -> bool: The package ``CHANGELOG.md`` / ``MIGRATIONS.md`` are pointer stubs; the ``changelog.d/`` / ``migrations.d/`` folders are the entries themselves; the ``e2e-attestations/`` folder holds CI freshness receipts, not source; + a package-root ``testing-conventions.toml`` is gate config that ships in no + published artifact, so nothing user-facing can follow from editing one; dirsql colocates Python unit tests as ``*_test.py`` and TS as ``*.test.*`` / ``*.spec.*``; and anything under a ``tests/`` directory is a test tier. """ @@ -63,6 +65,7 @@ def _is_exempt(path: str, pkg: str) -> bool: re.fullmatch(rf"{p}/(CHANGELOG|MIGRATIONS)\.md", path) or re.match(rf"{p}/(changelog|migrations)\.d/", path) or re.match(rf"{p}/e2e-attestations/", path) + or re.fullmatch(rf"{p}/testing-conventions\.toml", path) or re.fullmatch(rf"{p}/.*_test\.py", path) or re.fullmatch(rf"{p}/.*\.(test|spec)\.(ts|tsx|js|mjs|cjs)", path) or re.match(rf"{p}/tests?/", path) diff --git a/internals/checks/src/checks/changelog_gate/decide_test.py b/internals/checks/src/checks/changelog_gate/decide_test.py index eabcb26f0..02635ee19 100644 --- a/internals/checks/src/checks/changelog_gate/decide_test.py +++ b/internals/checks/src/checks/changelog_gate/decide_test.py @@ -156,6 +156,22 @@ def true_for_a_dir_that_merely_prefixes_e2e_attestations(): ["packages/python/e2e-attestationsX/foo.py"], "packages/python" ) + def false_for_the_package_root_gate_config(): + assert not code_touched( + ["packages/python/testing-conventions.toml"], "packages/python" + ) + assert not code_touched(["packages/ts/testing-conventions.toml"], "packages/ts") + assert not code_touched( + ["plugins/dirsql-plugin-embeddings/testing-conventions.toml"], + "plugins/dirsql-plugin-embeddings", + ) + + def true_for_a_gate_config_that_is_not_at_the_package_root(): + assert code_touched( + ["packages/python/dirsql/testing-conventions.toml"], "packages/python" + ) + assert code_touched(["packages/ts/my-testing-conventions.toml"], "packages/ts") + def ignores_other_packages(): assert not code_touched(["packages/ts/src/bar.ts"], "packages/python") diff --git a/internals/checks/tests/e2e/changelog_gate_test.py b/internals/checks/tests/e2e/changelog_gate_test.py index 5248c029c..cdfb4b94d 100644 --- a/internals/checks/tests/e2e/changelog_gate_test.py +++ b/internals/checks/tests/e2e/changelog_gate_test.py @@ -117,6 +117,17 @@ def it_exits_zero_when_a_colocated_plugin_fragment_is_added(repo): proc = _gate(tmp_path, base_sha, head_sha) assert proc.returncode == 0, f"stdout={proc.stdout!r} stderr={proc.stderr!r}" + def it_exits_zero_when_only_the_package_gate_config_changes(repo): + tmp_path, base_sha = repo + _write( + tmp_path / "packages" / "python" / "testing-conventions.toml", + "[python.coverage]\nfail_under = 100\n", + ) + head_sha = _commit(tmp_path, "narrow the python coverage config") + + proc = _gate(tmp_path, base_sha, head_sha) + assert proc.returncode == 0, f"stdout={proc.stdout!r} stderr={proc.stderr!r}" + def it_exits_zero_via_the_skip_changelog_line(repo): tmp_path, base_sha = repo _write(tmp_path / "packages" / "rust" / "src" / "lib.rs") diff --git a/internals/checks/tests/integration/changelog_gate_test.py b/internals/checks/tests/integration/changelog_gate_test.py index ce4287dc0..ef77df17f 100644 --- a/internals/checks/tests/integration/changelog_gate_test.py +++ b/internals/checks/tests/integration/changelog_gate_test.py @@ -168,6 +168,16 @@ def it_passes_via_the_skip_changelog_line(repo, capsys): assert run(base_sha, head_sha) == 0 assert "bypassing changelog enforcement" in capsys.readouterr().out + def it_passes_when_only_the_package_gate_config_changes(repo, capsys): + tmp_path, base_sha = repo + _write( + tmp_path / "packages" / "python" / "testing-conventions.toml", + "[python.coverage]\nfail_under = 100\n", + ) + head_sha = _commit("narrow the python coverage config") + + assert run(base_sha, head_sha) == 0 + def it_passes_when_no_package_source_changed(repo, capsys): tmp_path, base_sha = repo (tmp_path / "README.md").write_text("hello again\n")