All of mesh-build-go's buildstep Go module leaves mesh-catalog for modules/mesh-delivery-sdk: the step run, fetch and release and the regenerate-and-compare step as the package steprun, the CPU share as steprun/buildcpu, the conformance kit as steprun/conformance, the seat generator as seatgen with cmd/seatgen, and cmd/mesh-pack. The three build modules and the builder's and checker's tests import the SDK and keep no copy; the SDK requires nothing of mesh-catalog. Code the build modules share is the delivery domain's SDK, not one module's package. It carries the build-module round's two new files of that package (dropdetected.go247c422f, storedbuilds.go904b8aed). Builds: design 47 G §464, §680, §327, §420, §495 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
39 lines
1.2 KiB
Go
39 lines
1.2 KiB
Go
package main
|
|
|
|
// The merge preview of a fetch (novox/hq ADR 0484 clause 3; issue 1676), as build_go_fetch answers it. The merge itself
|
|
// is the SDK's (steprun.MergeInto), the one every build module's fetch step makes.
|
|
|
|
import (
|
|
"context"
|
|
|
|
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/steprun"
|
|
"git.novox.be/novox/mesh-sdk/go/forgekey"
|
|
)
|
|
|
|
// remote is the address a repository is fetched from: the forge over ssh as the account, or RemoteBase when a test set it.
|
|
func (m *Module) remote(repository string) string {
|
|
base := m.RemoteBase
|
|
if base == "" {
|
|
base = "ssh://" + ForgeAlias + "/"
|
|
}
|
|
return base + repository + ".git"
|
|
}
|
|
|
|
// merge makes the merge preview of the head onto base and writes the answer into res.
|
|
func (m *Module) merge(ctx context.Context, run forgekey.Runner, res *FetchResult, tree, remote, base, commit string) error {
|
|
mr, err := steprun.MergeInto(ctx, run, tree, remote, base, commit, m.FetchOptions...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
res.Base = mr.Base
|
|
res.Conflicts, res.Merge, res.Changed = mr.Conflicts, mr.Merge, mr.Changed
|
|
if mr.Merge != "" {
|
|
res.Programs = &mr.Programs
|
|
}
|
|
if res.Merge == "" {
|
|
return nil
|
|
}
|
|
res.Trees, err = steprun.ModuleTrees(ctx, m.Run, m.baseEnv(), tree, res.Merge)
|
|
return err
|
|
}
|