<#9411 feat: Implement UUIDv7 for time-ordered job...
# meltano-repo-activity
g
#9411 feat: Implement UUIDv7 for time-ordered job run IDs Pull request opened by tayloramurphy ## Summary Implements UUIDv7 support to enable chronological sorting of job run IDs and log directories. This addresses the need for time-ordered unique identifiers that can be lexicographically sorted by creation time. ## Changes ### Core Implementation • UUIDv7 Utility: Added RFC 9562-compliant
uuidv7()
function to
src/meltano/core/utils/
• Job Run IDs: Updated
Job
class to use UUIDv7 for
run_id
generation • CLI Integration: Modified
meltano run
and
meltano elt
commands to generate UUIDv7 run IDs • Database Schema: Updated SQLAlchemy
GUIDType
default to use UUIDv7 for new GUID columns ### System-Wide Adoption • Plugin System: Container names and Singer plugin instance UUIDs now use UUIDv7 • Tracking System: All telemetry and tracking context UUIDs converted to UUIDv7 • Project Initialization: New projects receive UUIDv7 project IDs ## Technical Details UUIDv7 encodes a 48-bit timestamp in milliseconds as the first component, enabling: • Lexicographic Sorting: UUIDs generated later have lexicographically larger string representations • Time Ordering: Log directories and job runs can be chronologically sorted • Format Compatibility: Maintains standard UUID format and interface compatibility ## Testing • Added comprehensive tests for UUIDv7 generation, format validation, and time-ordering behavior • Verified all existing tests pass with no breaking changes • Validated RFC 9562 compliance for version bits and variant encoding ## Backward Compatibility The implementation maintains full backward compatibility: • Existing UUIDs continue to work without modification • All UUID interfaces remain unchanged • No database migrations required for existing data ## Performance Impact Minimal performance impact as UUIDv7 generation is comparable to UUID4 with added timestamp encoding. Fixes #8919 ## Summary by Sourcery Implement time-ordered version 7 UUID support throughout the codebase by introducing a uuidv7() utility and replacing uuid4 usage in key identifiers to enable chronological sorting of job runs, logs, telemetry, and container names. New Features: • Add uuidv7() utility generating RFC 9562-compliant version 7 UUIDs with embedded timestamps for lexicographic sorting Enhancements: • Replace uuid4 defaults across the system with uuidv7 for job run IDs, CLI commands, plugin instance IDs, telemetry and tracking contexts, state store identifiers, SQLAlchemy GUID defaults, and project initialization Tests: • Add tests verifying uuidv7 format, version, timestamp encoding, and lexicographic ordering including integration with job run IDs meltano/meltano