Skip to content

Generate RFC 4122 version 4 catalog ids (0.8.3) - #21

Merged
TonisOrmisson merged 1 commit into
mainfrom
fix/uuid-variant
Nov 21, 2026
Merged

TonisOrmisson merged 1 commit into
mainfrom
fix/uuid-variant

Conversation

@TonisOrmisson

@TonisOrmisson TonisOrmisson commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

NormativeCatalog::uuid() returned 16 random bytes without version or variant bits, so about 5 of 8 imported datasets got an id that InPlaceApplyRequest rejects with invalid_dataset_id: in-place transformations could not be applied to them. Found by a three-way benchmark with Statscraft and the Python adapter. The audit writer already sets the bits; this aligns the catalog ids. Regression test fails before the fix and passes after; full local check (style, phpstan, 770 tests) passes. Changelog: 0.8.3.

Summary by CodeRabbit

  • New Features
    • Newly generated catalog identifiers now follow the RFC 4122 version 4 UUID format.
  • Documentation
    • Updated the changelog with the 0.8.3 release notes. Catalog identifiers generated by earlier versions remain unchanged.

@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

NormativeCatalog::uuid() now sets RFC 4122 version 4 and variant bits in generated UUIDs. A PHPUnit test checks 500 generated values. The changelog records the change and notes that earlier imported datasets retain their identifiers.

Changes: Catalog UUID generation

Layer / File(s) Summary
Generate and verify catalog UUIDs
src/Sql/NormativeCatalog.php, tests/Sql/NormativeCatalogUuidTest.php, CHANGELOG.md
uuid() sets version 4 and accepted variant bits before formatting the random bytes. The test checks 500 UUIDs for lowercase format, version, and variant. The changelog records the change and states that earlier imported datasets retain their identifiers.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Merge Risk: Minimal · up to 70aa5

Catalog IDs become valid version 4 UUIDs, so newly imported datasets are accepted for in-place transformations. Datasets imported earlier keep their old IDs and may need re-import, as the changelog notes. The risk of merging is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: NormativeCatalog::uuid() now produces RFC 4122 version 4 catalog IDs by setting the version and variant bits. The changelog, code change, and tests all match this. The…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: NormativeCatalog::uuid() now produces RFC 4122 version 4 catalog IDs by setting the version and variant bits. The changelog, code change, and tests all match this. The version tag (0.8.3) matches the changelog entry.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5b176e7a-f8b5-408e-a9d5-40a3399d0805
Commits

Reviewing files that changed from the base of the PR and between 78f74b4 and 70aa52d.

Files selected for processing: 3

  • CHANGELOG.md
  • src/Sql/NormativeCatalog.php
  • tests/Sql/NormativeCatalogUuidTest.php

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@TonisOrmisson
TonisOrmisson merged commit 925a8d2 into main Nov 21, 2026
43 checks passed
@TonisOrmisson
TonisOrmisson deleted the fix/uuid-variant branch November 21, 2026 22:21
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