Draft
Conversation
- Replace epoch-based captureTime (int) with RFC 3339 strings (Optional[str]) across hardware, software, SBOM, and provenance models - Update Software creation to use RFC 3339 timestamps instead of time.time() - Remove unused `time` import - Add utility (utc_now_rfc3339) to generate schema-compliant UTC timestamps This aligns with CyTRICS v1.0.1 schema requirements: - type: ["string", "null"] - format: "date-time" (RFC 3339) Ensures consistent, timezone-aware timestamps across all captureTime fields.
for more information, see https://pre-commit.ci
- Add tests/schema/test_cytrics_schema.py to validate captureTime against CyTRICS schema (docs/cytrics_schema/schema.json) - Verify RFC 3339 date-time compliance for generated timestamps - Ensure hardware and software captureTime accept string/null as defined - Ensure file captureTime accepts string and rejects null - Add negative tests for invalid formats (missing timezone, epoch integers) - Include JSON Schema FormatChecker to enforce date-time validation These tests prevent regression to epoch-based timestamps and ensure alignment with CyTRICS v1.0.1 captureTime requirements.
Use correct relative import (`..utils`) to resolve ModuleNotFoundError
for more information, see https://pre-commit.ci
🧪 SBOM Results (16/16)
|
- Add validate_capture_time utility enforcing RFC 3339 with required timezone using regex + datetime parsing - Support nullable behavior and consistent error handling across models - Add unit tests for capture_time validation (valid cases, null, and failures) - Remove schema tests that incorrectly assumed jsonschema enforces timezone - Keep schema tests focused on actual schema validation behavior This separates schema validation from stricter application-level validation and ensures captureTime values are consistently timezone-aware.
for more information, see https://pre-commit.ci
- add jsonschema to test dependency groups and optional test extras - update pytest fixtures to use `name=` to avoid pylint redefined-outer-name warnings - ensure schema validation tests run correctly in CI
- validate captureTime in dataclass __post_init__ (File, Hardware, Software, provenance) - add validation at SBOM.create_software boundary - enforce validation on captureTime updates in Software Aligns runtime behavior with CyTRICS schema requirements.
for more information, see https://pre-commit.ci
…dling
- validate captureTime for software entries and nested components in CLI add path
- fix installPath update logic to handle None containerPath/installPath safely
- remove deprecated system-related CLI options and merge logic
- drop create_system_object and captureStart/captureEnd handling
- standardize graph node type comparison ("path" vs "Path")
Aligns CLI and merge behavior with CyTRICS v1.0.1 schema and improves input validation robustness.
for more information, see https://pre-commit.ci
…idation tests - replace legacy epoch-based captureTime values with RFC 3339 strings in test data - update CLI tests to use schema-compliant captureTime values - add tests for nested SoftwareComponent captureTime validation - add negative test for invalid component captureTime - ensure test fixtures align with CyTRICS v1.0.1 date-time requirements Fixes test failures caused by stricter captureTime validation and completes schema migration.
for more information, see https://pre-commit.ci
- remove legacy system config helper from merge tests - update merge test calls to use the new three-argument signature - delete tests for deprecated add_system and system_uuid behavior - add coverage to assert merged output does not emit systems Aligns merge tests with the CyTRICS v1.0.1 merge behavior.
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.
Summary
If merged this pull request will...
Proposed changes