Help us shape the future of Go! Take the 2026 Go Developer Survey

prinfo

package
v1.99.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 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.3/pr-info.schema.json"

	// AuthorTypeUser represents a human user account
	AuthorTypeUser = "User"
	// AuthorTypeBot represents a bot/service account
	AuthorTypeBot = "Bot"
	// AuthorTypeUnknown represents an account with unknown type
	AuthorTypeUnknown = "unknown"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Author added in v1.87.0

type Author struct {
	Login string `json:"login" jsonschema:"required,description=Username of the PR/MR author"`
	Type  string `json:"type" jsonschema:"required,enum=User,enum=Bot,enum=unknown,description=Account type of the PR/MR author"`
}

Author represents the author of the PR/MR with account type information

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       *Author    `json:"author,omitempty" jsonschema:"description=The PR/MR author"`
	Reviewers    []Reviewer `json:"reviewers,omitempty" jsonschema:"description=List of reviewers who reviewed or were requested to review"`
}

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

func (*Data) UnmarshalJSON added in v1.87.0

func (d *Data) UnmarshalJSON(b []byte) error

UnmarshalJSON implements custom JSON unmarshaling for Data to handle backwards compatibility where author can be either a string (v1.0-v1.2) or an object (v1.3+).

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

type Reviewer added in v1.82.1

type Reviewer struct {
	Login        string `json:"login" jsonschema:"required,description=Username of the reviewer"`
	Type         string `json:"type" jsonschema:"required,enum=User,enum=Bot,enum=unknown,description=Account type of the reviewer"`
	Requested    bool   `json:"requested" jsonschema:"required,description=Whether the reviewer was explicitly requested to review"`
	ReviewStatus string `` /* 203-byte string literal not displayed */
}

Reviewer represents a reviewer of the PR/MR

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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