Files
galaxy/test/unit/model
John Chilton 32b7ceee07 Migrate WES pagination to unified keyset-based approach
Replace offset-based and security.encode_id() pagination with generalized
keyset abstraction supporting both single-ID and composite keysets.

New abstraction (lib/galaxy/model/keyset_token_pagination.py):
- KeysetToken Protocol: polymorphic via to_values()/from_values()
- SingleKeysetToken: single ID keyset for runs pagination
- KeysetPagination: base64+JSON encoder/decoder
- TaskKeysetToken (wes.py): composite (step_order, job_index) keyset

Changes to WES pagination:
- list_runs: SingleKeysetToken with WHERE id < last_id (unchanged query)
- get_run_tasks: TaskKeysetToken with tuple comparison WHERE (step_order, job_index) > (last_step, last_idx)
- Removed offset-based _encode_page_token/_decode_page_token
- Removed _encode_keyset_token/_decode_keyset_token

Benefits:
- Cursor-stable pagination under concurrent changes
- Efficient composite keyset filtering on UNION queries
- Consistent token encoding across all WES endpoints
- Protocol-based design - no type checking needed

Tests: 9 unit tests for keyset pagination abstraction (all passing)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-20 14:30:53 -05:00
..