v0.297.0: burn-down round 2 — 24 small rows (R-591 R-568 R-567 R-363 R-547 R-10 R-552 R-251 R-104 R-619 R-362 R-675 R-256 R-257 R-240 R-365 R-425 R-565 R-564 R-603 R-454 R-208 R-457-swept) + the banner countdown and deepCopyStack twins; MinAgent 0.131.0
gates / gates (push) Failing after 50s
gates / gates (push) Failing after 50s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
@@ -320,3 +320,93 @@ func LocalizeStackPtr(in *Stack, lang string) *Stack {
|
||||
out.Meta = out.Meta.For(lang)
|
||||
return &out
|
||||
}
|
||||
|
||||
// cloneStrPtr returns a fresh pointer to a copy of *p, or nil.
|
||||
func cloneStrPtr(p *string) *string {
|
||||
if p == nil {
|
||||
return nil
|
||||
}
|
||||
v := *p
|
||||
return &v
|
||||
}
|
||||
|
||||
// cloneStrs returns a fresh copy of in, keeping nil as nil and empty as empty.
|
||||
func cloneStrs(in []string) []string {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := make([]string, len(in))
|
||||
copy(out, in)
|
||||
return out
|
||||
}
|
||||
|
||||
// Clone returns a deep copy of the overlay: no pointer, slice or nested struct is shared with the
|
||||
// receiver. It exists for deepCopyStack (R-591) — a Stack copy is "a snapshot the caller may
|
||||
// mutate", and the overlay must be one too. Pinned by TestDeepCopyStackI18nIsNotShared.
|
||||
func (o MetadataOverlay) Clone() MetadataOverlay {
|
||||
c := MetadataOverlay{
|
||||
Description: cloneStrPtr(o.Description),
|
||||
}
|
||||
if o.AppInfo != nil {
|
||||
ai := AppInfoOverlay{
|
||||
Tagline: cloneStrPtr(o.AppInfo.Tagline),
|
||||
UseCases: cloneStrs(o.AppInfo.UseCases),
|
||||
FirstSteps: cloneStrs(o.AppInfo.FirstSteps),
|
||||
Prerequisites: cloneStrs(o.AppInfo.Prerequisites),
|
||||
DefaultCreds: cloneStrPtr(o.AppInfo.DefaultCreds),
|
||||
AddPeople: cloneStrPtr(o.AppInfo.AddPeople),
|
||||
}
|
||||
c.AppInfo = &ai
|
||||
}
|
||||
if o.DeployFields != nil {
|
||||
c.DeployFields = make([]DeployFieldOverlay, len(o.DeployFields))
|
||||
for i, f := range o.DeployFields {
|
||||
nf := DeployFieldOverlay{
|
||||
EnvVar: f.EnvVar,
|
||||
Label: cloneStrPtr(f.Label),
|
||||
Description: cloneStrPtr(f.Description),
|
||||
Placeholder: cloneStrPtr(f.Placeholder),
|
||||
}
|
||||
if f.Options != nil {
|
||||
nf.Options = make([]SelectOptionOverlay, len(f.Options))
|
||||
for j, op := range f.Options {
|
||||
nf.Options[j] = SelectOptionOverlay{Value: op.Value, Label: cloneStrPtr(op.Label)}
|
||||
}
|
||||
}
|
||||
c.DeployFields[i] = nf
|
||||
}
|
||||
}
|
||||
if o.OptionalConfig != nil {
|
||||
c.OptionalConfig = make([]OptionalConfigGroupOverlay, len(o.OptionalConfig))
|
||||
for i, g := range o.OptionalConfig {
|
||||
ng := OptionalConfigGroupOverlay{
|
||||
MatchGroup: g.MatchGroup,
|
||||
Group: cloneStrPtr(g.Group),
|
||||
Description: cloneStrPtr(g.Description),
|
||||
}
|
||||
if g.Fields != nil {
|
||||
ng.Fields = make([]OptionalConfigFieldOverlay, len(g.Fields))
|
||||
for j, f := range g.Fields {
|
||||
ng.Fields[j] = OptionalConfigFieldOverlay{EnvVar: f.EnvVar, Label: cloneStrPtr(f.Label), HelpText: cloneStrPtr(f.HelpText)}
|
||||
}
|
||||
}
|
||||
c.OptionalConfig[i] = ng
|
||||
}
|
||||
}
|
||||
if o.Integrations != nil {
|
||||
c.Integrations = make([]IntegrationOverlay, len(o.Integrations))
|
||||
for i, in := range o.Integrations {
|
||||
c.Integrations[i] = IntegrationOverlay{Target: in.Target, Label: cloneStrPtr(in.Label), Description: cloneStrPtr(in.Description)}
|
||||
}
|
||||
}
|
||||
if o.DataPaths != nil {
|
||||
c.DataPaths = make([]DataPathOverlay, len(o.DataPaths))
|
||||
for i, d := range o.DataPaths {
|
||||
c.DataPaths[i] = DataPathOverlay{Path: d.Path, Label: cloneStrPtr(d.Label)}
|
||||
}
|
||||
}
|
||||
if o.InitialCreds != nil {
|
||||
c.InitialCreds = &InitialCredentialsOverlay{Note: cloneStrPtr(o.InitialCreds.Note)}
|
||||
}
|
||||
return c
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user