Skip to content

test: add production-scale reorder fixture and deterministic failure reproduction - #992

Open
devin-ai-integration[bot] wants to merge 4 commits into
mainfrom
devin/1785262304-reorder-fixture
Open

test: add production-scale reorder fixture and deterministic failure reproduction#992
devin-ai-integration[bot] wants to merge 4 commits into
mainfrom
devin/1785262304-reorder-fixture

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

Closes #976 (first sub-issue of epic #975).

Adds the deterministic, production-scale reorder fixture and the regression scaffolding the rest of the epic builds on:

  • backend/app/reorder_fixture.pybuild_fixture_spec() / seed_reorder_fixture() / purge_reorder_fixture() plus a CLI (python -m app.reorder_fixture [--purge]). Deterministic IDs in reserved high ranges (9_100_000+ categories, 9_200_000+ images) and RF- prefixed names; 80 sibling categories, 600 sibling images, mixed root scope, 4-level nested scope, and duplicate sort_order values in every scope. Seeding purges first, so it is idempotent with no manual cleanup.
  • backend/tests/test_reorder_fixture.py — spec tests (always run) + PostgreSQL integration tests gated on REORDER_FIXTURE_DATABASE_URL: idempotent reseed, purge, and a full 80-category authoritative-order round-trip through the real reorder_categories endpoint. Two xfail(strict=True) regressions document current bugs and will flip to failures when fixed:
  • .github/workflows/ci.yamlbackend-tests now runs a postgres:16-alpine service, applies Alembic migrations, and sets REORDER_FIXTURE_DATABASE_URL so the integration tests run in CI.
  • frontend/tests/helpers/reorderFixture.ts — mirrored deterministic generators + createDeferred() for injecting latency into category/image persistence and refreshes independently.
  • frontend/tests/components/SortableTileGridReorderRegression.test.tsx — passing baselines (695-tile render, 20 consecutive awaited reorders) and three it.fails(...) regressions asserting the desired behaviour:
    • a second drop during an in-flight save is silently discarded (reorderInFlightRef early return);
    • a stale refresh response overwrites a newer saved order;
    • partial category/image persistence.
  • docs/reorder-fixture.md — fixture-loading workflow, scenario mapping, and observed timings at fixture scale (linked from README).

Needs human verification

None — but note the navigation-away-during-save and reload-and-compare journeys are documented as browser-level (Playwright) scenarios to be driven against a fixture-seeded environment; they are not automated in this PR.

Testing

  • backend: poetry run pytest — 940 passed, 2 xfailed, coverage 86%.
  • frontend: npm test — 1323 passed, 3 expected fail; npm run format:check clean.

Link to Devin session: https://app.devin.ai/sessions/414754bd88374dc693f47100ac269e78

…reproduction

Establishes the epic #975 fixture: 80 sibling categories, 600 sibling
images, mixed root and nested scopes, duplicate sort_order values, with
idempotent CLI seeding, backend integration tests against real PostgreSQL,
and frontend latency-injected regression tests reproducing the silent-drop,
stale-refresh-overwrite, and partial-persistence failures.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration
devin-ai-integration Bot requested a review from kphunter as a code owner July 28, 2026 18:12
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

github-code-quality[bot]

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 potential issues.

Open in Devin Review

Comment thread frontend/tests/helpers/reorderFixture.ts Outdated
Comment thread backend/tests/test_reorder_fixture.py
Comment thread .github/workflows/ci.yaml
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 new potential issues.

Open in Devin Review

Comment thread backend/app/reorder_fixture.py
Comment thread backend/app/reorder_fixture.py
…arent

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 new potential issues.

Open in Devin Review

Comment thread frontend/tests/helpers/reorderFixture.ts
Comment thread backend/tests/test_reorder_fixture.py
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 new potential issues.

Open in Devin Review

Comment thread backend/app/reorder_fixture.py
Comment thread backend/app/reorder_fixture.py
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.

Establish a production-scale reorder fixture and deterministic failure reproduction

0 participants