Forget a replaced or detached board's robots.txt verdict and detail lists with its failure record

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-09-29 19:43:24 +02:00
1 parent 60136765b2
commit 7f04c10e9e
2 files changed
+23 -1

No files matched your search

+5 -1
View File
@@ -109,8 +109,12 @@ def detach_board(store: Store, key: str) -> int:
def _forget_failing(store: Store, target: str) -> None:
"""Drop what the pull recorded about a board nobody reads any more: a
record of `target` failing would otherwise outlive the board, and count
in `app companies check` for good."""
in `app companies check` for good. The `ats` plugin's robots.txt verdict
and its lists of roles read and failed in detail go with it, since they
are about that board alone and would only grow stale."""
store.state.pop(FAILING + target, None)
for key in ("ats:robots:", "ats:detailed:", "ats:detailfailed:"):
store.state.pop(key + target, None)
def add_board(store: Store, board: str, name: str) -> tuple[Subscription, int]:
+18
View File
@@ -305,6 +305,24 @@ def test_replacing_or_detaching_a_board_forgets_that_it_was_failing(
assert failing_boards(store) == {}
def test_replacing_or_detaching_a_board_forgets_its_robots_and_detail_records(
store: Store, boards: Boards) -> None:
kept = ("ats:robots:", "ats:detailed:", "ats:detailfailed:")
sources.set_board(store, "acme", "greenhouse:acme", name="Acme")
for key in kept:
store.state[key + "greenhouse:acme"] = "[]"
store.state["ats:robots:lever:other"] = "{}"
sources.set_board(store, "acme", "ashby:acme")
assert not any(key + "greenhouse:acme" in store.state for key in kept)
assert "ats:robots:lever:other" in store.state
for key in kept:
store.state[key + "ashby:acme"] = "[]"
sources.detach_board(store, "acme")
assert not any(key + "ashby:acme" in store.state for key in kept)
def test_search_params_keeps_only_what_the_provider_reads() -> None:
assert sources.search_params("jobindex", " python ", area=1, region="CaRE_1nn_cSU") == {
"q": "python", "area": 1}