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 ¶
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 ¶
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. |