fix(cleanup): fix CI failures and address review feedback (#7527)

- Remove unused typing.Any import from dirs_cache.py (ruff lint)
- Collapse multiline expressions without trailing commas (ruff format)
- Rename ambiguous behave step "the result should be {True,False}" to
  "the dir membership result should be {True,False}" — resolves conflict
  with existing step @then('the result should be {expected}') in
  cli_steps.py that caused all 31 feature workers to crash on load
- Add self._sandbox_dirs_cache = None invalidation to
  CleanupService._purge_sandboxes() — the actual fix for issue #7527;
  without this, subsequent scan() calls return stale deleted paths
- Fix CONTRIBUTORS.md PR reference from #10989 to #11091

ISSUES CLOSED: #7527
This commit is contained in:
2026-06-10 19:58:49 -04:00
committed by Forgejo
parent 9801d34cad
commit 9d5128c265
4 changed files with 9 additions and 15 deletions
+3 -3
View File
@@ -38,18 +38,18 @@ Feature: Sandbox directories cache tracking and invalidation (#7527)
Scenario: Check membership for recorded path
Given a sandbox dirs cache with one path "/tmp/sandboxes/abc" for plan "plan-check"
When I check if dir "/tmp/sandboxes/abc" belongs to plan "plan-check"
Then the result should be True
Then the dir membership result should be True
Scenario: Check membership for non-recorded path returns False
Given a sandbox dirs cache with one path "/tmp/sandboxes/xyz" for plan "plan-wrong"
When I check if dir "/tmp/sandboxes/missing" belongs to plan "plan-wrong"
Then the result should be False
Then the dir membership result should be False
Scenario: Check membership after purge returns False
Given a sandbox dirs cache with one path "/tmp/sandboxes/cached-dir" for plan "plan-expired"
When I purge sandbox dirs for plan "plan-expired"
And I check if dir "/tmp/sandboxes/cached-dir" belongs to plan "plan-expired"
Then the result should be False
Then the dir membership result should be False
Scenario: Clear all entries empties the cache
Given a sandbox dirs cache with paths for plans "plan-clear-1" and "plan-clear-2"