Skip to content

docs: add evidence transformation pipeline documentation#1

Open
cyrusagent[bot] wants to merge 1 commit intomainfrom
docs/evidence-transformation-pipeline
Open

docs: add evidence transformation pipeline documentation#1
cyrusagent[bot] wants to merge 1 commit intomainfrom
docs/evidence-transformation-pipeline

Conversation

@cyrusagent
Copy link

@cyrusagent cyrusagent bot commented Nov 3, 2025

Summary

This PR adds comprehensive documentation explaining how JUnit and Jacoco evidence types are transformed before being injected into the policy engine. This addresses issue #2183.

Documentation Contents

The new documentation (docs/evidence-transformation.md) covers:

  • Transformation Pipeline Architecture: Complete flow diagram showing the transformation process from CI/CD input to policy evaluation
  • JUnit XML Transformation: Detailed explanation of how JUnit XML test results are parsed and converted to JSON for policy evaluation
  • Jacoco XML Transformation: Documentation of how Jacoco code coverage reports are processed and transformed
  • Policy Engine Integration: Explanation of the GetEvaluableContent() function and how materials are evaluated
  • Practical Examples: Rego policy examples for both JUnit and Jacoco evidence types
  • Extension Guide: Step-by-step guide for adding support for new evidence types
  • Implementation Reference: Complete list of key files and their roles in the transformation pipeline

Implementation Details

The documentation is based on thorough code analysis of:

  • /pkg/attestation/crafter/api/attestation/v1/crafting_state.go - Core transformation logic
  • /pkg/attestation/crafter/materials/junit_xml.go - JUnit handler
  • /pkg/attestation/crafter/materials/jacoco.go - Jacoco handler
  • /pkg/policies/policies.go - Policy verification orchestrator

Value

This documentation fills a gap identified by the maintainers and provides:

  • Clear understanding of the transformation pipeline for contributors
  • Reference material for implementing new evidence type support
  • Policy examples for users writing custom policies
  • Technical foundation for future enhancements to the policy engine

Closes chainloop-dev#2183

@anoncam anoncam force-pushed the docs/evidence-transformation-pipeline branch from 79063b3 to 93c9550 Compare November 6, 2025 18:18
Document how JUnit and Jacoco evidence types are transformed before being
injected into the policy engine. This addresses issue chainloop-dev#2183 which requested
documentation of the transformation process for non-JSON evidence types.

The documentation covers:
- Complete transformation pipeline architecture with flow diagram
- JUnit XML transformation process and JSON output structure
- Jacoco XML transformation process and coverage metrics
- Policy engine integration via GetEvaluableContent function
- Practical Rego policy examples for both evidence types
- Guide for adding new evidence types to the system
- Performance, security, and error handling considerations
- Complete reference of key implementation files

Signed-off-by: Cameron Banowsky <cameron@shebash.io>
@anoncam anoncam force-pushed the docs/evidence-transformation-pipeline branch from 93c9550 to 94cb3c9 Compare November 11, 2025 17:46
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.

non-json evidence type policies support?

1 participant