forge

package
v0.70.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: MIT Imports: 5 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 forge resolves a heraut config into one or more port.ForgeIdentity values, filling gaps from the ambient CI environment or the git origin remote when the config leaves fields unset. See ADR-0043 and docs/superpowers/specs/2026-07-24-forge-abstraction-design.md §3.

Index

Constants

This section is empty.

Variables

View Source
var ErrAmbiguousForge = errors.New("ambiguous forge")

ErrAmbiguousForge is returned by Resolve when zero-config auto-detection finds more than one candidate forge type and nothing (CI, git origin) pins a single one.

Functions

func DetectForWizard added in v0.57.0

func DetectForWizard(getenv func(string) string, gitOrigin string) (typ, projectOrRepo string, ok bool)

DetectForWizard identifies a forge's platform type and project/repository path for wizard pre-fill: CI environment markers take priority, then a git origin URL matching one of the three known public hosts. ok is false when neither source identifies a recognized type — unlike Resolve's zero-config path, this never falls back to inspecting ambient token env vars, since the wizard always asks the user to pick (or confirm) a type explicitly when detection is inconclusive rather than guessing from which token happens to be set.

Types

type Resolved

type Resolved struct {
	Forges          []port.ForgeIdentity
	EnrichmentIndex int
}

Resolved is the outcome of Resolve: the resolved forge identities (by config order, or the single auto-detected one) and the index into Forges that is the enrichment source.

func Resolve

func Resolve(cfg *config.Config, getenv func(string) string, gitOrigin string) (Resolved, error)

Resolve builds one port.ForgeIdentity per cfg.Forges entry (filling gaps from CI/git origin), or — when cfg.Forges is empty — auto-detects exactly one forge from the CI environment or the git origin remote. getenv and gitOrigin are injected for testability; production callers pass os.Getenv and the parsed `git remote get-url origin`.

Directories

Path Synopsis
Package azure implements port.Forge for Azure DevOps over stdlib net/http.
Package azure implements port.Forge for Azure DevOps over stdlib net/http.
Package github implements port.Forge for GitHub over stdlib net/http, so changelog enrichment needs no `gh` CLI on PATH.
Package github implements port.Forge for GitHub over stdlib net/http, so changelog enrichment needs no `gh` CLI on PATH.
Package gitlab implements port.Forge for GitLab over stdlib net/http.
Package gitlab implements port.Forge for GitLab over stdlib net/http.

Jump to

Keyboard shortcuts

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