Skip to content

Conversation

@bluesentinelsec
Copy link
Contributor

No description provided.

- Create ArtifactType enum with REPOSITORY, CONTAINER, BINARY, ARCHIVE values
- Support string-to-enum conversion: ArtifactType("repository")
- Validate invalid inputs with ValueError (empty strings, invalid values)
- Add comprehensive test coverage with TDD approach
- Use C-style explicit error handling in tests for clarity
- Foundation for ScanConfig data model and strangler fig pattern

Files:
- entrypoint/entrypoint/data_model.py: Core ArtifactType enum
- entrypoint/tests/test_data_model.py: 7 tests covering all cases
- Add ArtifactType enum with REPOSITORY, CONTAINER, BINARY, ARCHIVE
- Add ScanConfig class with from_args() conversion method
- Replace string-based artifact type comparisons with type-safe enums
- Integrate ScanConfig into orchestrator without breaking existing functionality
- Add comprehensive test coverage (17 tests) following TDD approach

Benefits:
- Type safety prevents string comparison errors
- IDE autocomplete and refactoring support
- Foundation for further data model improvements
- Zero breaking changes to existing functionality

Strangler fig pattern successfully proven - old and new code coexist safely.
- Replace container platform check string comparison with enum comparison
- Change `args.artifact_type == "container"` to `config.artifact_type == ArtifactType.CONTAINER`
- Add comprehensive test coverage for enum comparisons and value access
- Completes strangler fig migration of artifact type logic to type-safe enums

This final change eliminates the last remaining string-based artifact type
comparison in the container platform validation logic, completing the
migration to type-safe enum comparisons throughout the orchestrator.
- Add sbomgen_version, timeout, platform, scanners, skip_scanners, skip_files fields
- Implement parse_comma_list() helper for robust comma-separated string parsing
- Add string-to-int conversion for timeout field
- Add comprehensive test coverage for all new fields and helper function
- ScanConfig now provides complete replacement for scanning-related args

Features:
- Type-safe field access with proper data conversion
- Robust comma parsing with whitespace handling and empty string validation
- 35 comprehensive tests ensuring reliability
- Clean, readable code without syntactic sugar
- Foundation ready for replacing args object usage in orchestrator

This completes the core scanning configuration data model, enabling
the next phase of strangler fig migration to extract services.
- Add VulnScanOutput class with structured vulnerability scan results
- Include core scan fields: scan_success, return_code, scan_results_file_path
- Add performance/timing data: scan_time, results_file_size
- Include vulnerability counts by severity: critical, high, medium, low, other
- Add structured error handling with error_message field
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