ReleaseSource.Params removed¶
props.ReleaseSource no longer has a Params map. Settings a release provider
needs beyond the connection now come from configuration, in a subtree named for
the source type.
Only tools that set Params are affected — in practice, tools using the
direct provider or a provider of their own. Tools on GitHub, GitLab, Gitea,
Codeberg or Bitbucket never set it and need no change.
Package: pkg/props · Spec: 0192
Breaking Changes¶
props.ReleaseSource.Params is gone¶
Before:
props.Tool.ReleaseSource = props.ReleaseSource{
Type: "direct",
Repo: "mytool",
Params: map[string]string{
"url_template": "https://dl.example.com/{tool}/{version}/{tool}_{os}_{arch}.{ext}",
"checksum_url_template": "https://dl.example.com/{tool}/{version}/checksums.txt",
"version_url": "https://dl.example.com/latest.json",
},
}
After:
# .mytool.yaml, or any layer in your configuration stack
direct:
url_template: https://dl.example.com/{tool}/{version}/{tool}_{os}_{arch}.{ext}
checksum_url_template: https://dl.example.com/{tool}/{version}/checksums.txt
version_url: https://dl.example.com/latest.json
Migration: move each Params key, unchanged, into a subtree named for the
source's Type. The key names are the same — url_template stays
url_template — so this is a relocation, not a rewrite. Any configuration layer
will do: the embedded assets/config.yaml defaults if the values are fixed for
your tool, a project-local file if an operator should override them.
Nothing warns at runtime, because the field is gone: the compiler reports every
call site. If you miss one and remove the field without moving the values, the
direct provider fails construction with a hint naming the configuration key it
wanted.
pkg/vcs/repo.SettingsFromReader takes props.ReleaseSource¶
Before:
func SettingsFromReader(source forge.ReleaseSourceConfig, cfg config.Reader, log gorepo.Logger, fs afero.Fs) gorepo.Settings
After:
func SettingsFromReader(source props.ReleaseSource, cfg config.Reader, log gorepo.Logger, fs afero.Fs) gorepo.Settings
Migration: pass p.Tool.ReleaseSource where you previously built a
forge.ReleaseSourceConfig. SettingsFromProps is unchanged and remains the
usual entry point.
Why¶
go/forge v0.12.0 replaced ReleaseSourceConfig with a comparable
forge.Endpoint{Type, Host, Name} carrying connection identity only, and moved
provider settings into the endpoint's configuration subtree. GTB followed rather
than translating between the two.
The reason upstream moved them is worth knowing, because it is also the reason
not to reintroduce a map: a single Params field on a single ReleaseSource can
describe exactly one source per type. Two direct sources with different URL
templates cannot both be expressed. A configuration subtree can — direct for
the default source, direct.<name> for a named one — which is what
Endpoint.Section resolves.
GTB does not yet expose named sources; Endpoint.Name is always empty, so the
bare <type> subtree is what your tool reads today.