ciimport

package
v1.5.20 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: Apache-2.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ciimport converts other CI systems' pipeline files into pipeline definitions. It only reads text: nothing from the input is ever executed.

Index

Constants

View Source
const DefaultImage = "ubuntu:24.04"

DefaultImage is the job image used when the source names a hosted runner.

Variables

View Source
var DefaultLimits = Limits{MaxBytes: 512 << 10, MaxDepth: 40, MaxNodes: 20000, MaxFiles: 100}

DefaultLimits are used for any limit left at zero.

Functions

func Sources

func Sources() []string

Sources lists the supported source names.

Types

type File

type File struct {
	Name string
	Data []byte
}

File is one converted pipeline.

type Limits

type Limits struct {
	MaxBytes int
	MaxDepth int
	MaxNodes int
	MaxFiles int
}

Limits bound what one import reads and walks.

func LimitsFromEnv

func LimitsFromEnv(lookup func(string) (string, bool)) Limits

LimitsFromEnv reads APP_CI_IMPORT_MAX_* overrides.

type Options

type Options struct {
	Limits Limits
	// Image replaces DefaultImage.
	Image string
}

Options tune a conversion.

type Report

type Report struct {
	Source  string   `json:"source"`
	Rows    []Row    `json:"rows"`
	Secrets []string `json:"secrets"`
}

Report lists every construct and the secrets the pipelines expect, by name.

func (Report) Counts

func (r Report) Counts() map[Status]int

Counts tallies rows per status.

func (Report) Markdown

func (r Report) Markdown() string

Markdown renders the report.

func (Report) Summary

func (r Report) Summary() string

Summary is a one line tally.

type Result

type Result struct {
	Files  []File
	Report Report
	// Failed counts inputs that produced no pipeline.
	Failed int
}

Result is the converted pipelines and the account of every construct.

func Import

func Import(name, path string, opts Options) (*Result, error)

Import converts a file, or every pipeline file under a directory.

type Row

type Row struct {
	File      string `json:"file"`
	Line      int    `json:"line"`
	Construct string `json:"construct"`
	Status    Status `json:"status"`
	Note      string `json:"note,omitempty"`
}

Row accounts for one source construct.

type Status

type Status string

Status says how faithfully one construct was converted.

const (
	StatusMapped      Status = "mapped"
	StatusPartial     Status = "partial"
	StatusUnsupported Status = "unsupported"
)

Report statuses.

Jump to

Keyboard shortcuts

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