prinfo

package
v1.63.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EvidenceID is the identifier for the PR/MR info material type
	EvidenceID = "CHAINLOOP_PR_INFO"
	// EvidenceSchemaURL is the URL to the JSON schema for PR/MR info
	EvidenceSchemaURL = "https://schemas.chainloop.dev/prinfo/1.0/pr-info.schema.json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Platform     string `json:"platform" jsonschema:"required,enum=github,enum=gitlab,description=The CI/CD platform"`
	Type         string `json:"type" jsonschema:"required,enum=pull_request,enum=merge_request,description=The type of change request"`
	Number       string `json:"number" jsonschema:"required,description=The PR/MR number or identifier"`
	Title        string `json:"title" jsonschema:"description=The PR/MR title"`
	Description  string `json:"description" jsonschema:"description=The PR/MR description or body"`
	SourceBranch string `json:"source_branch" jsonschema:"description=The source branch name"`
	TargetBranch string `json:"target_branch" jsonschema:"description=The target branch name"`
	URL          string `json:"url" jsonschema:"required,format=uri,description=Direct URL to the PR/MR"`
	Author       string `json:"author" jsonschema:"description=Username of the PR/MR author"`
}

Data represents the data payload of the PR/MR info evidence

type Evidence

type Evidence struct {
	ID     string `json:"chainloop.material.evidence.id"`
	Schema string `json:"schema"`
	Data   Data   `json:"data"`
}

Evidence represents the complete evidence structure for PR/MR metadata

func NewEvidence

func NewEvidence(data Data) *Evidence

NewEvidence creates a new Evidence instance

type Generator

type Generator struct {
}

Generator handles the generation of JSON schemas for PR info.

func NewGenerator

func NewGenerator() *Generator

NewGenerator creates a new schema generator

func (*Generator) GeneratePRInfoSchema

func (g *Generator) GeneratePRInfoSchema(version string) *jsonschema.Schema

GeneratePRInfoSchema generates a JSON schema for the PR/MR info data.

func (*Generator) Save

func (g *Generator) Save(schema *jsonschema.Schema, outputDir, version string) error

Save writes the schema to a file

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL