Repository navigation
Conversation
The valid_uuid audit only allowed version digits 1-5, so well-formed UUIDv6, UUIDv7 and UUIDv8 values (RFC 9562) were reported as invalid. Widen the version digit to 1-8 and update the documented pattern. Signed-off-by: Dhruv Gupta <todhruvg@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #6167
The
valid_uuidaudit only allowed version digits1-5, so well-formed UUIDv6, UUIDv7 and UUIDv8 values (RFC 9562) failed the audit. UUIDv7 in particular is now a common key format (uuidv7()in DuckDB and PostgreSQL 18, many application libraries).This widens the version digit in the pattern to
1-8and updates the pattern shown in the audits docs. The variant check ([89ab]) and the rest of the pattern are unchanged.Models that use
valid_uuidwill see the audit change as a metadata change on their next plan, since the built-in audit query changed.Test Plan
test_valid_uuid_auditintests/core/test_audit.py. It checks the rendered query and runs it on DuckDB against the RFC 9562 example UUIDs of versions 1-8 (one upper case), plus values with an unknown version, a non-RFC variant, no hyphens, a non-UUID string and NULL. Only the invalid values are returned. The test fails onmainand passes with this change.pytest tests/core/test_audit.py tests/core/test_model.py tests/core/test_snapshot.py tests/core/test_context.py -n 8 -m "fast and not cicdonly and not isolated": 611 passed.pytest -n auto -m "fast and not cicdonly and not isolated": 2695 passed, 6 skipped, 6 failed. The 6 failures are the pyodbc connection-string tests intests/core/test_connection_config.py, which cannot import pyodbc locally because unixODBC is not installed; they are unrelated to this change.SKIP=prettier,eslint pre-commit run --all-files(ruff, ruff-format, mypy, valid migrations): all passed.Checklist
make styleand fixed any issuesmake fast-test)git commit -s) per the DCOSummary by CodeRabbit