Skip to content

fix: apply grid worker skeleton filters independently - #11

Draft
afonsobspinto wants to merge 1 commit into
metacellfrom
feature/fix-grid-worker-skeleton-filters
Draft

afonsobspinto wants to merge 1 commit into
metacellfrom
feature/fix-grid-worker-skeleton-filters

Conversation

@afonsobspinto

Copy link
Copy Markdown
Member

Purpose

Draft for internal review before opening against upstream catmaid/CATMAID:dev. The worker condition fix is already included in feature/new-ingestion (PR #7). This PR isolates that fix and adds focused regression coverage for upstream preparation.

Problem and resulting behavior

The normal grid cache worker checks n_last_edited_skeletons_limit before reading n_largest_skeletons_limit, although the filters are independently configurable. As a result, configuring only the largest-skeleton filter silently drops it; configuring only the last-edited filter attempts int(None) and fails before refreshing the cell.

Grid settings Before After
Largest = 5; last edited unset Largest-skeleton filter is ignored. Cell generation receives n_largest_skeletons_limit=5.
Largest unset; last edited = 3 TypeError from int(None) prevents refresh. Cell generation receives only n_last_edited_skeletons_limit=3.
Largest = 5; last edited = 3 Both filters are applied. Same.
Both unset No skeleton-count filter. Same.

Changes

  • Gate the largest-skeleton parameter on its own setting and explain why the condition is independent.
  • Add four database-free worker unit tests covering each combination of the two filters, with the database and cell-generation collaborators mocked.

This PR contains no importer, cache transaction, migration or schema changes. It is independent of the cell publication changes in PR #9.

Validation

  • All four regression tests passed in an isolated Python 3.12 / Django 4.2 harness importing the real worker with its web/database collaborators mocked. No PostgreSQL or full deployment startup was exercised.
  • Negative control: restoring the previous condition causes the largest-only case to fail and the last-edited-only case to raise TypeError; the other two cases still pass.
  • Python syntax compilation and git diff --check passed.

In a configured CATMAID environment, run:

python manage.py test catmaid.tests.test_cache_update_worker

The affected worker condition is also present in current upstream dev. After internal review, cherry-pick this commit onto upstream dev for the upstream PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant