Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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"
}
3 changes: 3 additions & 0 deletions internals/checks/src/checks/changelog_gate/decide.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand All @@ -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)
Expand Down
16 changes: 16 additions & 0 deletions internals/checks/src/checks/changelog_gate/decide_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
11 changes: 11 additions & 0 deletions internals/checks/tests/e2e/changelog_gate_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
10 changes: 10 additions & 0 deletions internals/checks/tests/integration/changelog_gate_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down