Skip to content

Add UUID fields to Chronicler schema for project/run/result tracking #57

Description

@grdumas

Description

Zathras is introducing UUIDs to support better tracking and linking of test results across the pipeline. Chronicler's schema needs to include three new UUID fields to align with this change.

Required Changes

Add the following UUID fields to the Chronicler schema:

  1. project_uuid - Identifies the parent project/test suite
  2. run_uuid - Identifies the specific test run/execution
  3. result_uuid - Identifies the individual result document

Affected Components

Primary: chronicler/src/chronicler/schema.py

The UUID fields should be added to the Metadata dataclass:

@dataclass
class Metadata:
    """Document metadata section"""
    document_id: str
    document_type: str = "zathras_test_result"
    zathras_version: str = "1.0"
    
    # UUIDs for tracking
    project_uuid: Optional[str] = None
    run_uuid: Optional[str] = None
    result_uuid: Optional[str] = None
    
    # Timestamps
    test_timestamp: Optional[str] = None
    # ...rest of existing fields...

Secondary: Schema validation

Update validate_json_schema() if these fields should be validated (format checks, required vs optional).

Context

  • Zathras is introducing UUID-based tracking for better result correlation
  • UUIDs enable linking results across different indices and systems
  • This change supports the OpenSearch migration to v2 schema

Implementation Notes

  • All three UUID fields should be optional (Optional[str]) to maintain backward compatibility
  • UUIDs should be included in the to_dict() method output when present
  • Consider whether UUIDs should be excluded from calculate_content_hash() (likely yes, as they're identifiers not content)

Testing

  • Verify schema serialization/deserialization with UUIDs present and absent
  • Confirm backward compatibility with documents that lack UUID fields
  • Update test_schema.py with UUID test cases

Related Files

  • chronicler/src/chronicler/schema.py - Main schema definition
  • chronicler/tests/test_schema.py - Schema validation tests
  • Downstream: OpenSearch index mappings may need updates to include these fields

Priority: Medium
Type: Enhancement
Component: Schema

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions