Documentation
¶
Overview ¶
Package sources fetches upstream artefacts into the pipeline's working directory and records where they landed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractTarGz ¶
ExtractTarGz unpacks a gzipped tar, refusing any entry that escapes dest.
func ExtractZip ¶
ExtractZip unpacks a zip, refusing any entry that escapes dest.
Types ¶
type Compound ¶
type Compound struct {
pipeline.SourceKind
First, Second pipeline.Source
}
Compound runs two sources in order.
A pipeline takes exactly one source, and the emoji recipe needs both an asset fetch and the CLDR taxonomy. The taxonomy runs first so the asset source owns fetched_path -- reverse them and the categoriser is handed the taxonomy file as its tree.
type Downloader ¶
type Downloader interface {
Download(ctx context.Context, url, dest string, force bool) (string, error)
}
Downloader is the HTTP surface the sources need.
type GithubArchive ¶
type GithubArchive struct {
pipeline.SourceKind
// ArchiveURL is a template with {version}. When empty it is built from
// Owner, Repo and Version -- note the built form hardcodes a `v` prefix,
// which is why a project tagging without one has to supply the template.
ArchiveURL string
Owner string
Repo string
Version string
HTTP Downloader
Log *slog.Logger
}
GithubArchive downloads a tagged archive and extracts it.
func (GithubArchive) Name ¶
func (GithubArchive) Name() string
type NpmTarball ¶
NpmTarball fetches a package with `npm pack` and extracts it.
Shells out to npm rather than resolving the registry directly: npm handles scoped names, auth and the tarball URL indirection, and the image already ships it.
func (NpmTarball) Name ¶
func (NpmTarball) Name() string
type Static ¶
type Static struct {
pipeline.SourceKind
Version string
}
Static satisfies the pipeline's "must have a source" rule for a commit-only pipeline, which has nothing to fetch but still has a version to record.
It replaces Python's _NoOpSource, and the difference is a bug fix rather than a rename. Each pipeline gets its own context, so nothing the emoji recipe's three asset pipelines set reaches its trailing commit pipeline. With a source that set nothing, VersionStamp found no fetched_version, logged "skipping" and did nothing -- so icon-sets-emoji was never stamped at all, and its sync could not converge. That is precisely the V49 failure the vendored-version design exists to prevent, still live in the one recipe that composes several pipelines.
type UnicodeCldr ¶
type UnicodeCldr struct {
pipeline.SourceKind
// UnicodeVersion is the emoji release, e.g. "16.0".
//
// The default has bitten this project: it ran ahead of what Unicode had
// published, every fetch 404'd, and the pack shipped a tagged release with
// zero SVGs. Set it to a version that exists.
UnicodeVersion string
HTTP Downloader
Log *slog.Logger
}
UnicodeCldr downloads the emoji taxonomy the categoriser needs.
func (UnicodeCldr) Name ¶
func (UnicodeCldr) Name() string