A-284, A-285: a group's check gives every TypeScript fetch the packages the group changes
The fetch's single `package` and its tagged form go; `group-packages` lists each TypeScript package a member's merge changes, at the member's head with its directory there. The checker asks every member's other fetches first, so every merge's changed paths are known before any TypeScript fetch, and gives each the whole list; the registry's version stays only for a package no member changes. Builds: design 47 G A-284, A-285 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"path"
|
||||
"slices"
|
||||
"sort"
|
||||
"strconv"
|
||||
@@ -387,30 +388,49 @@ func (r *repoModules) ModuleDir(module string) (string, bool) {
|
||||
return d, ok && d != ""
|
||||
}
|
||||
|
||||
// PackagePaths are the paths, relative to the repository, that the TypeScript package artifacts of a repository's modules
|
||||
// are built from, sorted: the named paths the indexer keeps in each module's value (meshcatalog.ModulesByModuleValue.ArtifactPaths; only the
|
||||
// indexer reads them from a manifest, the lead's decision L8), under the module's directory. None for a module whose value
|
||||
// holds no paths.
|
||||
func (r *repoModules) PackagePaths(repository string) []string {
|
||||
// TypeScriptPackages are the TypeScript package artifacts of a repository's modules, sorted by directory: each by its
|
||||
// directory in the repository and the paths, relative to the repository, it is built from: the named paths the indexer
|
||||
// keeps in each module's value (meshcatalog.ModulesByModuleValue.ArtifactPaths; only the indexer reads them from a
|
||||
// manifest, the lead's decision L8), under the module's directory. A package's directory is the one path it names when
|
||||
// that names a directory (the contracts folders, ts/seats/<seat>, each with its own package.json), else the module's
|
||||
// directory (the SDK's lib names its package.json beside its sources), as the Node build module reads it
|
||||
// (mesh-build-node artifact.packageDir). None for a module whose value holds no paths.
|
||||
func (r *repoModules) TypeScriptPackages(repository string) []check.TypeScriptPackage {
|
||||
r.mu.Lock()
|
||||
defer r.mu.Unlock()
|
||||
var out []string
|
||||
var out []check.TypeScriptPackage
|
||||
for module, repo := range r.repoOf {
|
||||
if repo != repository {
|
||||
continue
|
||||
}
|
||||
dir := strings.Trim(r.path[module], "/")
|
||||
for _, name := range r.tsPkgs[r.typed[module]] {
|
||||
for _, p := range r.named[module][name] {
|
||||
p = strings.Trim(strings.TrimPrefix(p, "./"), "/")
|
||||
if dir != "" && dir != meshcatalogclient.RootPath {
|
||||
p = dir + "/" + p
|
||||
}
|
||||
out = append(out, p)
|
||||
if dir == meshcatalogclient.RootPath || dir == "." {
|
||||
dir = ""
|
||||
}
|
||||
under := func(p string) string {
|
||||
p = strings.Trim(strings.TrimPrefix(p, "./"), "/")
|
||||
if dir != "" {
|
||||
p = dir + "/" + p
|
||||
}
|
||||
return p
|
||||
}
|
||||
for _, name := range r.tsPkgs[r.typed[module]] {
|
||||
named := r.named[module][name]
|
||||
if len(named) == 0 {
|
||||
continue
|
||||
}
|
||||
pkg := check.TypeScriptPackage{Dir: dir}
|
||||
if one := strings.Trim(strings.TrimPrefix(named[0], "./"), "/"); len(named) == 1 && one != "" && !strings.Contains(path.Base(one), ".") {
|
||||
pkg.Dir = under(one)
|
||||
}
|
||||
for _, p := range named {
|
||||
pkg.Paths = append(pkg.Paths, under(p))
|
||||
}
|
||||
sort.Strings(pkg.Paths)
|
||||
out = append(out, pkg)
|
||||
}
|
||||
}
|
||||
sort.Strings(out)
|
||||
sort.Slice(out, func(i, j int) bool { return out[i].Dir < out[j].Dir })
|
||||
return out
|
||||
}
|
||||
|
||||
|
||||
@@ -105,19 +105,29 @@ func TestTheTypeScriptPackagesPathsComeFromTheIndexersModulesNotTheManifest(t *t
|
||||
}
|
||||
r.Put(context.Background(), "mesh-sdk", v, false)
|
||||
}
|
||||
put(".", map[string][]string{"lib": {"src", "package.json"}}) // the indexer's word, not the manifest's five paths
|
||||
if got := strings.Join(r.PackagePaths("novox/mesh-sdk"), ","); got != "package.json,src" {
|
||||
t.Errorf("paths = %q, want the indexer's, at the repository's root", got)
|
||||
str := func(pkgs []check.TypeScriptPackage) string {
|
||||
var out []string
|
||||
for _, p := range pkgs {
|
||||
out = append(out, p.Dir+":"+strings.Join(p.Paths, ","))
|
||||
}
|
||||
return strings.Join(out, " ")
|
||||
}
|
||||
put("ts", map[string][]string{"lib": {"src"}})
|
||||
if got := strings.Join(r.PackagePaths("novox/mesh-sdk"), ","); got != "ts/src" {
|
||||
t.Errorf("paths = %q, want them under the module's directory", got)
|
||||
for _, row := range []struct {
|
||||
name, path string
|
||||
paths map[string][]string
|
||||
want string
|
||||
}{
|
||||
{"the indexer's word, not the manifest's five paths: the SDK's lib at the root", ".", map[string][]string{"lib": {"src", "package.json"}}, ":package.json,src"},
|
||||
{"under the module's directory", "ts", map[string][]string{"lib": {"package.json", "src"}}, "ts:ts/package.json,ts/src"},
|
||||
{"one path naming a directory is the package's own (A-285)", "modules/mesh-delivery-contracts", map[string][]string{"lib": {"ts/seats/git"}}, "modules/mesh-delivery-contracts/ts/seats/git:modules/mesh-delivery-contracts/ts/seats/git"},
|
||||
{"a value written before the indexer kept paths: nothing to serve by", ".", nil, ""},
|
||||
} {
|
||||
put(row.path, row.paths)
|
||||
if got := str(r.TypeScriptPackages("novox/mesh-sdk")); got != row.want {
|
||||
t.Errorf("%s: packages = %q, want %q", row.name, got, row.want)
|
||||
}
|
||||
}
|
||||
put(".", nil) // a value written before the indexer kept paths: nothing to serve by
|
||||
if got := r.PackagePaths("novox/mesh-sdk"); len(got) != 0 {
|
||||
t.Errorf("paths = %v, want none", got)
|
||||
}
|
||||
if got := r.PackagePaths("novox/mesh-delivery"); len(got) != 0 {
|
||||
if got := r.TypeScriptPackages("novox/mesh-delivery"); len(got) != 0 {
|
||||
t.Errorf("another repository: %v", got)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -999,20 +999,25 @@ func TestADigestThatEchoesOtherSiblingsKeepsNothing(t *testing.T) { // 1287 with
|
||||
}
|
||||
}
|
||||
|
||||
type pkgPaths map[string][]string
|
||||
type pkgPaths map[string][]TypeScriptPackage
|
||||
|
||||
func (p pkgPaths) PackagePaths(repository string) []string { return p[repository] }
|
||||
func (p pkgPaths) TypeScriptPackages(repository string) []TypeScriptPackage { return p[repository] }
|
||||
|
||||
// groupPackageBench is a group of a TypeScript member (mesh-delivery) and the mesh-sdk member, whose merge changes sdkChanged.
|
||||
func groupPackageBench(t *testing.T, sdkChanged []string) *bench {
|
||||
// contractsGit is a contracts package of mesh-delivery: one directory with its own package.json.
|
||||
const contractsGit = "modules/mesh-delivery-contracts/ts/seats/git"
|
||||
|
||||
// groupPackageBench is a group of a TypeScript member (mesh-delivery, with a contracts package) and the mesh-sdk member,
|
||||
// whose merges change changed of each repository.
|
||||
func groupPackageBench(t *testing.T, changed map[string][]string) *bench {
|
||||
b := newBench(t)
|
||||
b.ex.Modules = langs{repoA: {goBuildModule, nodeBuildModule}, repoSDK: {goBuildModule, nodeBuildModule}}
|
||||
b.ex.Packages = pkgPaths{repoSDK: {"src", "test", "package.json", "package-lock.json", "tsconfig.json"}}
|
||||
b.ex.Packages = pkgPaths{
|
||||
repoSDK: {{Dir: "", Paths: []string{"package-lock.json", "package.json", "src", "tsconfig.json"}}},
|
||||
repoA: {{Dir: contractsGit, Paths: []string{contractsGit}}},
|
||||
}
|
||||
fetch := func(c stepCall) (any, error) {
|
||||
f := b.fetch
|
||||
if c.args["repository"] == repoSDK {
|
||||
f.Changed = sdkChanged
|
||||
}
|
||||
f.Changed = changed[c.args["repository"].(string)]
|
||||
return f, nil
|
||||
}
|
||||
b.steps.handlers["build_go_fetch"], b.steps.handlers["build_node_fetch"] = fetch, fetch
|
||||
@@ -1028,36 +1033,60 @@ func nodeFetchOf(b *bench, repo string) stepCall {
|
||||
return stepCall{}
|
||||
}
|
||||
|
||||
func TestATypeScriptMemberTakesTheGroupsPackageWhenTheSDKMemberChangesItsPaths(t *testing.T) { // ADR 0500 §5, C11b
|
||||
b := groupPackageBench(t, []string{"go/delivery/x.go", "src/state.ts"})
|
||||
b.judge(t, caseOf(t, pullOf(repoA, 7, head1), pullOf(repoSDK, 12, head2)))
|
||||
want := map[string]any{"repository": repoSDK, "commit": head2, "ref": "refs/pull/12/head"}
|
||||
if got := nodeFetchOf(b, repoA).args["package"]; !reflect.DeepEqual(got, want) {
|
||||
t.Errorf("mesh-delivery's Node fetch was given the package %v, want %v", got, want)
|
||||
}
|
||||
if got := nodeFetchOf(b, repoSDK).args["package"]; got != nil {
|
||||
t.Errorf("the mesh-sdk member's own fetch was given %v: it builds its package itself", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestATypeScriptMemberResolvesTheRegistryWhenTheSDKMemberLeavesItsPaths(t *testing.T) { // ADR 0500 §5: the manifest alone, or Go alone
|
||||
for _, changed := range [][]string{{"go/delivery/x.go"}, {"module.json"}, {"srcx/a.ts"}} {
|
||||
b := groupPackageBench(t, changed)
|
||||
// design 47 G A-284, A-285 (ADR 0500 §5): every TypeScript fetch of a group's check is given every package any member's
|
||||
// merge changes, each at its member's head with its directory there; the registry's only for a package none changes.
|
||||
func TestATypeScriptMemberTakesEveryPackageTheGroupChanges(t *testing.T) {
|
||||
sdk := map[string]any{"repository": repoSDK, "commit": head2, "ref": "refs/pull/12/head"}
|
||||
git := map[string]any{"repository": repoA, "commit": head1, "ref": "refs/pull/7/head", "path": contractsGit}
|
||||
for _, row := range []struct {
|
||||
name string
|
||||
changed map[string][]string
|
||||
want []any
|
||||
}{
|
||||
{"the SDK's sources", map[string][]string{repoSDK: {"go/delivery/x.go", "src/state.ts"}}, []any{sdk}},
|
||||
{"another member's contracts package", map[string][]string{repoA: {contractsGit + "/index.ts"}}, []any{git}},
|
||||
{"both", map[string][]string{repoSDK: {"package.json"}, repoA: {contractsGit + "/package.json", "go.mod"}}, []any{sdk, git}},
|
||||
{"Go alone", map[string][]string{repoSDK: {"go/delivery/x.go"}, repoA: {"modules/mesh-delivery-contracts/go/seats/git/contract.go"}}, nil},
|
||||
{"the manifest alone", map[string][]string{repoSDK: {"module.json"}}, nil},
|
||||
{"beside the named paths", map[string][]string{repoSDK: {"srcx/a.ts"}, repoA: {contractsGit + "x/a.ts"}}, nil},
|
||||
} {
|
||||
b := groupPackageBench(t, row.changed)
|
||||
b.judge(t, caseOf(t, pullOf(repoA, 7, head1), pullOf(repoSDK, 12, head2)))
|
||||
if got := nodeFetchOf(b, repoA).args["package"]; got != nil {
|
||||
t.Errorf("%v: the Node fetch was given %v, want the registry", changed, got)
|
||||
for _, repo := range []string{repoA, repoSDK} {
|
||||
got, _ := nodeFetchOf(b, repo).args["group-packages"].([]any)
|
||||
if !reflect.DeepEqual(got, row.want) {
|
||||
t.Errorf("%s: the Node fetch of %s was given %v, want %v", row.name, repo, got, row.want)
|
||||
}
|
||||
if pkg, ok := nodeFetchOf(b, repo).args["package"]; ok {
|
||||
t.Errorf("%s: the Node fetch of %s was given the retired package %v", row.name, repo, pkg)
|
||||
}
|
||||
}
|
||||
}
|
||||
// A lone TypeScript pull request: no group package either.
|
||||
b := groupPackageBench(t, []string{"src/state.ts"})
|
||||
// A lone pull request: no group package.
|
||||
b := groupPackageBench(t, map[string][]string{repoA: {contractsGit + "/index.ts"}})
|
||||
b.judge(t, caseOf(t, pullOf(repoA, 7, head1)))
|
||||
if got := nodeFetchOf(b, repoA).args["package"]; got != nil {
|
||||
if got, ok := nodeFetchOf(b, repoA).args["group-packages"]; ok {
|
||||
t.Errorf("a lone pull request's Node fetch was given %v", got)
|
||||
}
|
||||
}
|
||||
|
||||
// design 47 G A-284: the mesh-sdk member is judged first, and its TypeScript fetch still learns the package another
|
||||
// member's merge changes: every member's other fetches come before any TypeScript one.
|
||||
func TestEveryMembersMergeIsKnownBeforeATypeScriptFetch(t *testing.T) {
|
||||
b := groupPackageBench(t, map[string][]string{repoA: {contractsGit + "/index.ts"}})
|
||||
b.judge(t, caseOf(t, pullOf(repoA, 7, head1), pullOf(repoSDK, 12, head2)))
|
||||
var order []string
|
||||
for _, c := range b.steps.tool("fetch") {
|
||||
order = append(order, c.module+" "+c.args["repository"].(string))
|
||||
}
|
||||
want := []string{goBuildModule + " " + repoSDK, goBuildModule + " " + repoA, nodeBuildModule + " " + repoSDK, nodeBuildModule + " " + repoA}
|
||||
if !reflect.DeepEqual(order, want) {
|
||||
t.Errorf("fetches in the order %v, want %v", order, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNoStepOfACheckCarriesPublish(t *testing.T) { // ADR 0500 §4, 1309 (the checker's half): only the builder's trunk build publishes
|
||||
b := groupPackageBench(t, []string{"src/state.ts"})
|
||||
b := groupPackageBench(t, map[string][]string{repoSDK: {"src/state.ts"}})
|
||||
b.judge(t, caseOf(t, pullOf(repoA, 7, head1), pullOf(repoSDK, 12, head2)))
|
||||
if len(b.steps.calls) == 0 {
|
||||
t.Fatal("no step ran")
|
||||
|
||||
@@ -115,10 +115,11 @@ type Examiner struct {
|
||||
Dirs interface {
|
||||
ModuleDir(module string) (string, bool)
|
||||
}
|
||||
// Packages names, of a repository, the paths (repository-relative) its TypeScript package artifacts are built from, from
|
||||
// the indexer's modules (meshcatalog.ModulesByModuleValue.ArtifactPaths, lead decision L8); nil serves no group package.
|
||||
// Packages names, of a repository, its TypeScript package artifacts, each by its directory and the paths
|
||||
// (repository-relative) it is built from, from the indexer's modules (meshcatalog.ModulesByModuleValue.ArtifactPaths,
|
||||
// lead decision L8); nil serves no group package.
|
||||
Packages interface {
|
||||
PackagePaths(repository string) []string
|
||||
TypeScriptPackages(repository string) []TypeScriptPackage
|
||||
}
|
||||
// Trunks are the trunk heads of every repository, for the siblings a repository's tests read.
|
||||
Trunks interface{ Heads() map[string]string }
|
||||
@@ -210,6 +211,13 @@ func besideLines(refs []BesideRef) []string {
|
||||
return out
|
||||
}
|
||||
|
||||
// TypeScriptPackage is one TypeScript package artifact of a repository's module: Dir, its directory in the repository
|
||||
// ("" for the repository's root), and Paths, the repository-relative paths it is built from.
|
||||
type TypeScriptPackage struct {
|
||||
Dir string
|
||||
Paths []string
|
||||
}
|
||||
|
||||
// target is a pull request on one build module: the node that pulled its ask, the workspace its fetch made and what it
|
||||
// said.
|
||||
type target struct {
|
||||
@@ -520,9 +528,11 @@ func (st *state) levelsOf() []string {
|
||||
// judges each answer. A head that does not merge, a pin that is not allowed or a level that fails is a failure of that
|
||||
// member; every other member is still judged, and the verdict names every failure (the operator, 2026-11-02), unjoined
|
||||
// to its first lines (settled does that). Only a check whose context ended stops.
|
||||
//
|
||||
// Every member's asks of the other languages come first and its TypeScript asks after them all: the merges those
|
||||
// fetches answer say which TypeScript packages the group changes, and each TypeScript fetch is given them all
|
||||
// (groupPackages; design 47 G A-284, A-285).
|
||||
func (st *state) judgeAll(ctx context.Context) {
|
||||
// The mesh-sdk member first: whether its merge changes the TypeScript package's paths decides whether the other members'
|
||||
// Node fetches take the group's package (ADR 0500 §5).
|
||||
pulls := slices.Clone(st.c.Pulls)
|
||||
slices.SortStableFunc(pulls, func(a, b Pull) int {
|
||||
if (a.Repository == SDKRepository) != (b.Repository == SDKRepository) {
|
||||
@@ -533,66 +543,111 @@ func (st *state) judgeAll(ctx context.Context) {
|
||||
}
|
||||
return 0
|
||||
})
|
||||
var groupPackage *buildstep.FetchPackage
|
||||
met := len(st.facts)
|
||||
for _, p := range pulls {
|
||||
if ctx.Err() != nil {
|
||||
if !st.failedSince(met) { // an ask that ended with the context said it already
|
||||
st.fail(CheckerModule, ctx.Err().Error())
|
||||
}
|
||||
break
|
||||
stopped := func() bool {
|
||||
if ctx.Err() == nil {
|
||||
return false
|
||||
}
|
||||
var merged []Fetched
|
||||
modules := st.j.Modules.BuildModules(p.Repository)
|
||||
for _, bm := range modules {
|
||||
t := &target{pull: p, module: bm, language: st.j.languageOf(bm)}
|
||||
if tc, none := buildstep.AgreedToolchain(st.j.Toolchains.Entries(t.language)); none == "" {
|
||||
t.toolchain = tc.Version
|
||||
t.agreed = &buildstep.ToolchainUsed{Language: t.language, Version: tc.Version, Recipe: tc.Recipe}
|
||||
}
|
||||
args := buildstep.Fetch{Repository: p.Repository, Commit: p.Head, Ref: refOf(p.Number), Base: p.Trunk}
|
||||
if t.language == languageTypeScript {
|
||||
if groupPackage != nil && p.Repository != SDKRepository {
|
||||
args.Package = groupPackage
|
||||
}
|
||||
}
|
||||
if t.language == languageGo {
|
||||
beside, err := st.j.besideFor(ctx, st.c, p)
|
||||
if err != nil {
|
||||
st.fail(forgeMachine(err, bm), err.Error()+unheardWords(err))
|
||||
continue
|
||||
}
|
||||
if len(beside) > 0 {
|
||||
args.Beside = fetchBeside(beside)
|
||||
t.beside = besideLines(beside)
|
||||
besideAtTrunk(st.c, beside, st.beside)
|
||||
}
|
||||
if p.Repository == catalogueRepository {
|
||||
t.runner = RunnerWorkspace // used by the build module when the merge changes it (ADR 0535 §1)
|
||||
}
|
||||
}
|
||||
t.fetchArgs = args
|
||||
st.targets = append(st.targets, t)
|
||||
st.ask(ctx, t, &merged)
|
||||
if !st.failedSince(met) { // an ask that ended with the context said it already
|
||||
st.fail(CheckerModule, ctx.Err().Error())
|
||||
}
|
||||
return true
|
||||
}
|
||||
merged := make([][]Fetched, len(pulls))
|
||||
modules := make([][]string, len(pulls))
|
||||
for i, p := range pulls {
|
||||
modules[i] = st.j.Modules.BuildModules(p.Repository)
|
||||
for _, bm := range modules[i] {
|
||||
if st.j.languageOf(bm) == languageTypeScript {
|
||||
continue
|
||||
}
|
||||
if stopped() {
|
||||
return
|
||||
}
|
||||
st.askMember(ctx, p, bm, nil, &merged[i])
|
||||
}
|
||||
}
|
||||
var group []buildstep.FetchPackage
|
||||
if len(st.c.Pulls) > 1 {
|
||||
group = st.groupPackages(pulls, merged)
|
||||
}
|
||||
for i, p := range pulls {
|
||||
for _, bm := range modules[i] {
|
||||
if st.j.languageOf(bm) != languageTypeScript {
|
||||
continue
|
||||
}
|
||||
if stopped() {
|
||||
return
|
||||
}
|
||||
st.askMember(ctx, p, bm, group, &merged[i])
|
||||
}
|
||||
}
|
||||
for i, p := range pulls {
|
||||
// Every build module's fetch merged (each is in merged once): the preview is written, also when the member's tests
|
||||
// or a later step failed, so the indexer holds its manifests and the assigner can compose the change (review of
|
||||
// 650a1d0; design 47 G A-286).
|
||||
switch {
|
||||
case st.narrowTry(): // a try of a level or some tests owes the indexer no preview: it judges no manifest
|
||||
case len(merged) == len(modules):
|
||||
st.j.writePreview(ctx, p, merged)
|
||||
case len(merged[i]) == len(modules[i]):
|
||||
st.j.writePreview(ctx, p, merged[i])
|
||||
case st.conflicted[pullKey(p)]:
|
||||
st.unpreviewed = append(st.unpreviewed, pullKey(p)+" (its head does not merge)")
|
||||
default:
|
||||
st.unpreviewed = append(st.unpreviewed, pullKey(p)+" (its fetch did not answer)")
|
||||
}
|
||||
st.judgedByMember(p, merged)
|
||||
// The group's package member packed by the Node fetch (ADR 0500 §5).
|
||||
if p.Repository == SDKRepository && len(st.c.Pulls) > 1 && st.j.changesPackage(p, merged) {
|
||||
groupPackage = &buildstep.FetchPackage{Repository: p.Repository, Commit: p.Head, Ref: refOf(p.Number)}
|
||||
st.judgedByMember(p, merged[i])
|
||||
}
|
||||
}
|
||||
|
||||
// askMember puts the check ask of one build module of a member and judges its answer; a TypeScript fetch is given the
|
||||
// group's packages.
|
||||
func (st *state) askMember(ctx context.Context, p Pull, bm string, group []buildstep.FetchPackage, merged *[]Fetched) {
|
||||
t := &target{pull: p, module: bm, language: st.j.languageOf(bm)}
|
||||
if tc, none := buildstep.AgreedToolchain(st.j.Toolchains.Entries(t.language)); none == "" {
|
||||
t.toolchain = tc.Version
|
||||
t.agreed = &buildstep.ToolchainUsed{Language: t.language, Version: tc.Version, Recipe: tc.Recipe}
|
||||
}
|
||||
args := buildstep.Fetch{Repository: p.Repository, Commit: p.Head, Ref: refOf(p.Number), Base: p.Trunk}
|
||||
if t.language == languageTypeScript {
|
||||
args.GroupPackages = group
|
||||
}
|
||||
if t.language == languageGo {
|
||||
beside, err := st.j.besideFor(ctx, st.c, p)
|
||||
if err != nil {
|
||||
st.fail(forgeMachine(err, bm), err.Error()+unheardWords(err))
|
||||
return
|
||||
}
|
||||
if len(beside) > 0 {
|
||||
args.Beside = fetchBeside(beside)
|
||||
t.beside = besideLines(beside)
|
||||
besideAtTrunk(st.c, beside, st.beside)
|
||||
}
|
||||
if p.Repository == catalogueRepository {
|
||||
t.runner = RunnerWorkspace // used by the build module when the merge changes it (ADR 0535 §1)
|
||||
}
|
||||
}
|
||||
t.fetchArgs = args
|
||||
st.targets = append(st.targets, t)
|
||||
st.ask(ctx, t, merged)
|
||||
}
|
||||
|
||||
// groupPackages are the TypeScript packages the group's merges change (design 47 G A-284, A-285): every package of a
|
||||
// member whose named paths a merge of that member changes, each at the member's head with its directory there, in the
|
||||
// order of the members and then of the directories. A change of the manifest alone, or of files outside those paths,
|
||||
// changes no package (ADR 0500 §5).
|
||||
func (st *state) groupPackages(pulls []Pull, merged [][]Fetched) []buildstep.FetchPackage {
|
||||
if st.j.Packages == nil {
|
||||
return nil
|
||||
}
|
||||
var out []buildstep.FetchPackage
|
||||
for i, p := range pulls {
|
||||
for _, pkg := range st.j.Packages.TypeScriptPackages(p.Repository) {
|
||||
if changesPaths(pkg.Paths, merged[i]) {
|
||||
out = append(out, buildstep.FetchPackage{Repository: p.Repository, Commit: p.Head, Ref: refOf(p.Number), Path: pkg.Dir})
|
||||
}
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// failedSince says a failure was recorded among the facts from the nth on.
|
||||
@@ -840,13 +895,8 @@ func (st *state) level(ctx context.Context, t *target, la buildstep.LevelAnswer)
|
||||
return elapsed
|
||||
}
|
||||
|
||||
// changesPackage says whether the merge of a pull request changes a file inside the named paths of one of its repository's
|
||||
// TypeScript packages: a change of the manifest alone, or of files outside those paths, does not (ADR 0500 §5).
|
||||
func (j *Examiner) changesPackage(p Pull, merged []Fetched) bool {
|
||||
if j.Packages == nil {
|
||||
return false
|
||||
}
|
||||
paths := j.Packages.PackagePaths(p.Repository)
|
||||
// changesPaths says whether a merge changes a file inside one of the named paths (repository-relative).
|
||||
func changesPaths(paths []string, merged []Fetched) bool {
|
||||
for _, f := range merged {
|
||||
for _, changed := range f.Changed {
|
||||
for _, named := range paths {
|
||||
|
||||
@@ -496,29 +496,20 @@ type FetchBuildsItem struct {
|
||||
Package string `json:"package"`
|
||||
}
|
||||
|
||||
// FetchPackage is the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's.
|
||||
type FetchPackage struct {
|
||||
Commit string `json:"commit,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Ref string `json:"ref,omitempty"`
|
||||
Repository string `json:"repository,omitempty"`
|
||||
Version string `json:"version,omitempty"`
|
||||
}
|
||||
|
||||
// Fetch is what a build module's fetch tool is asked: the repository and the full commit, the pull request's ref when only its head carries the commit, the trunk commit to merge onto for a merge preview, the module's directory and named paths, the mesh packages to build against, and the sibling repositories placed beside.
|
||||
// Fetch is what a build module's fetch tool is asked: the repository and the full commit, the pull request's ref when only its head carries the commit, the trunk commit to merge onto for a merge preview, the module's directory and named paths, the mesh packages to build against, the group's TypeScript packages, and the sibling repositories placed beside.
|
||||
type Fetch struct {
|
||||
// the trunk commit a merge preview merges onto
|
||||
Base string `json:"base,omitempty"`
|
||||
// the sibling repositories placed beside the fetched tree
|
||||
Beside []FetchBesideItem `json:"beside,omitempty"`
|
||||
// a group run's package members, each by its build's digest: the build module reads each from the artifact store at artifact-store://<module>/<artifact>/blobs/<digest>, checks the bytes against the digest and lays them as the group package; a package named here is named in neither packages nor package
|
||||
// a group run's package members, each by its build's digest: the build module reads each from the artifact store at artifact-store://<module>/<artifact>/blobs/<digest>, checks the bytes against the digest and lays them as the group package; a package named here is named in neither packages nor group-packages
|
||||
Builds []FetchBuildsItem `json:"builds,omitempty"`
|
||||
// the full commit
|
||||
Commit string `json:"commit"`
|
||||
// the module's directory in the repository ("." for its root), with paths
|
||||
Dir string `json:"dir,omitempty"`
|
||||
// the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's
|
||||
Package *FetchPackage `json:"package,omitempty"`
|
||||
// a group's check: the TypeScript packages the group's members change, each a package of a member at its commit with its directory there; the build module packs each and places it by its package.json name in every module of the tree that names it, in place of the registry's (design 47 G A-284, A-285)
|
||||
GroupPackages []FetchPackage `json:"group-packages,omitempty"`
|
||||
// the version (a full commit) of each mesh package to build against, by its module path
|
||||
Packages map[string]string `json:"packages,omitempty"`
|
||||
// the paths the module names, relative to dir
|
||||
@@ -547,6 +538,18 @@ type FetchAnswer struct {
|
||||
Workspace string `json:"workspace"`
|
||||
}
|
||||
|
||||
// FetchPackage is one TypeScript package of a group's member: the member's repository, the commit packed (the member's head), the pull request's ref when only its head carries it, and the package's directory in the member (empty for the member's root).
|
||||
type FetchPackage struct {
|
||||
// the full commit
|
||||
Commit string `json:"commit"`
|
||||
// the package's directory in the member, empty for the member's root
|
||||
Path string `json:"path,omitempty"`
|
||||
// the pull request's ref, when only its head carries the commit
|
||||
Ref string `json:"ref,omitempty"`
|
||||
// <owner>/<name>
|
||||
Repository string `json:"repository"`
|
||||
}
|
||||
|
||||
// FetchRefusal is a TypeScript module whose packages the fetch did not install, with why.
|
||||
type FetchRefusal struct {
|
||||
Module string `json:"module"`
|
||||
|
||||
@@ -494,29 +494,20 @@ type FetchBuildsItem struct {
|
||||
Package string `json:"package"`
|
||||
}
|
||||
|
||||
// FetchPackage is the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's.
|
||||
type FetchPackage struct {
|
||||
Commit string `json:"commit,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Ref string `json:"ref,omitempty"`
|
||||
Repository string `json:"repository,omitempty"`
|
||||
Version string `json:"version,omitempty"`
|
||||
}
|
||||
|
||||
// Fetch is what a build module's fetch tool is asked: the repository and the full commit, the pull request's ref when only its head carries the commit, the trunk commit to merge onto for a merge preview, the module's directory and named paths, the mesh packages to build against, and the sibling repositories placed beside.
|
||||
// Fetch is what a build module's fetch tool is asked: the repository and the full commit, the pull request's ref when only its head carries the commit, the trunk commit to merge onto for a merge preview, the module's directory and named paths, the mesh packages to build against, the group's TypeScript packages, and the sibling repositories placed beside.
|
||||
type Fetch struct {
|
||||
// the trunk commit a merge preview merges onto
|
||||
Base string `json:"base,omitempty"`
|
||||
// the sibling repositories placed beside the fetched tree
|
||||
Beside []FetchBesideItem `json:"beside,omitempty"`
|
||||
// a group run's package members, each by its build's digest: the build module reads each from the artifact store at artifact-store://<module>/<artifact>/blobs/<digest>, checks the bytes against the digest and lays them as the group package; a package named here is named in neither packages nor package
|
||||
// a group run's package members, each by its build's digest: the build module reads each from the artifact store at artifact-store://<module>/<artifact>/blobs/<digest>, checks the bytes against the digest and lays them as the group package; a package named here is named in neither packages nor group-packages
|
||||
Builds []FetchBuildsItem `json:"builds,omitempty"`
|
||||
// the full commit
|
||||
Commit string `json:"commit"`
|
||||
// the module's directory in the repository ("." for its root), with paths
|
||||
Dir string `json:"dir,omitempty"`
|
||||
// the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's
|
||||
Package *FetchPackage `json:"package,omitempty"`
|
||||
// a group's check: the TypeScript packages the group's members change, each a package of a member at its commit with its directory there; the build module packs each and places it by its package.json name in every module of the tree that names it, in place of the registry's (design 47 G A-284, A-285)
|
||||
GroupPackages []FetchPackage `json:"group-packages,omitempty"`
|
||||
// the version (a full commit) of each mesh package to build against, by its module path
|
||||
Packages map[string]string `json:"packages,omitempty"`
|
||||
// the paths the module names, relative to dir
|
||||
@@ -545,6 +536,18 @@ type FetchAnswer struct {
|
||||
Workspace string `json:"workspace"`
|
||||
}
|
||||
|
||||
// FetchPackage is one TypeScript package of a group's member: the member's repository, the commit packed (the member's head), the pull request's ref when only its head carries it, and the package's directory in the member (empty for the member's root).
|
||||
type FetchPackage struct {
|
||||
// the full commit
|
||||
Commit string `json:"commit"`
|
||||
// the package's directory in the member, empty for the member's root
|
||||
Path string `json:"path,omitempty"`
|
||||
// the pull request's ref, when only its head carries the commit
|
||||
Ref string `json:"ref,omitempty"`
|
||||
// <owner>/<name>
|
||||
Repository string `json:"repository"`
|
||||
}
|
||||
|
||||
// FetchRefusal is a TypeScript module whose packages the fetch did not install, with why.
|
||||
type FetchRefusal struct {
|
||||
Module string `json:"module"`
|
||||
|
||||
@@ -494,29 +494,20 @@ type FetchBuildsItem struct {
|
||||
Package string `json:"package"`
|
||||
}
|
||||
|
||||
// FetchPackage is the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's.
|
||||
type FetchPackage struct {
|
||||
Commit string `json:"commit,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Ref string `json:"ref,omitempty"`
|
||||
Repository string `json:"repository,omitempty"`
|
||||
Version string `json:"version,omitempty"`
|
||||
}
|
||||
|
||||
// Fetch is what a build module's fetch tool is asked: the repository and the full commit, the pull request's ref when only its head carries the commit, the trunk commit to merge onto for a merge preview, the module's directory and named paths, the mesh packages to build against, and the sibling repositories placed beside.
|
||||
// Fetch is what a build module's fetch tool is asked: the repository and the full commit, the pull request's ref when only its head carries the commit, the trunk commit to merge onto for a merge preview, the module's directory and named paths, the mesh packages to build against, the group's TypeScript packages, and the sibling repositories placed beside.
|
||||
type Fetch struct {
|
||||
// the trunk commit a merge preview merges onto
|
||||
Base string `json:"base,omitempty"`
|
||||
// the sibling repositories placed beside the fetched tree
|
||||
Beside []FetchBesideItem `json:"beside,omitempty"`
|
||||
// a group run's package members, each by its build's digest: the build module reads each from the artifact store at artifact-store://<module>/<artifact>/blobs/<digest>, checks the bytes against the digest and lays them as the group package; a package named here is named in neither packages nor package
|
||||
// a group run's package members, each by its build's digest: the build module reads each from the artifact store at artifact-store://<module>/<artifact>/blobs/<digest>, checks the bytes against the digest and lays them as the group package; a package named here is named in neither packages nor group-packages
|
||||
Builds []FetchBuildsItem `json:"builds,omitempty"`
|
||||
// the full commit
|
||||
Commit string `json:"commit"`
|
||||
// the module's directory in the repository ("." for its root), with paths
|
||||
Dir string `json:"dir,omitempty"`
|
||||
// the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's
|
||||
Package *FetchPackage `json:"package,omitempty"`
|
||||
// a group's check: the TypeScript packages the group's members change, each a package of a member at its commit with its directory there; the build module packs each and places it by its package.json name in every module of the tree that names it, in place of the registry's (design 47 G A-284, A-285)
|
||||
GroupPackages []FetchPackage `json:"group-packages,omitempty"`
|
||||
// the version (a full commit) of each mesh package to build against, by its module path
|
||||
Packages map[string]string `json:"packages,omitempty"`
|
||||
// the paths the module names, relative to dir
|
||||
@@ -545,6 +536,18 @@ type FetchAnswer struct {
|
||||
Workspace string `json:"workspace"`
|
||||
}
|
||||
|
||||
// FetchPackage is one TypeScript package of a group's member: the member's repository, the commit packed (the member's head), the pull request's ref when only its head carries it, and the package's directory in the member (empty for the member's root).
|
||||
type FetchPackage struct {
|
||||
// the full commit
|
||||
Commit string `json:"commit"`
|
||||
// the package's directory in the member, empty for the member's root
|
||||
Path string `json:"path,omitempty"`
|
||||
// the pull request's ref, when only its head carries the commit
|
||||
Ref string `json:"ref,omitempty"`
|
||||
// <owner>/<name>
|
||||
Repository string `json:"repository"`
|
||||
}
|
||||
|
||||
// FetchRefusal is a TypeScript module whose packages the fetch did not install, with why.
|
||||
type FetchRefusal struct {
|
||||
Module string `json:"module"`
|
||||
|
||||
@@ -59,7 +59,7 @@ func TestFixtures(t *testing.T) {
|
||||
decode: func(b []byte) (any, error) { var v DeliveryAccept; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.node-build-node\\.accept\\.delivery$")},
|
||||
{name: "a build ask with the version the builder reserved (G 573)", subject: "mesh.seat.node-build-node.accept.delivery", given: "{\"asker\":\"mesh-delivery-builder\",\"build\":{\"artifacts\":[{\"artifact\":\"go\"}],\"module\":\"nats\"},\"id\":\"a1b3\",\"kind\":\"build\",\"language\":\"go\",\"version\":\"1.4.2\"}", wire: "{\"asker\":\"mesh-delivery-builder\",\"build\":{\"artifacts\":[{\"artifact\":\"go\"}],\"module\":\"nats\"},\"id\":\"a1b3\",\"kind\":\"build\",\"language\":\"go\",\"version\":\"1.4.2\"}",
|
||||
decode: func(b []byte) (any, error) { var v DeliveryAccept; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.node-build-node\\.accept\\.delivery$")},
|
||||
{name: "a check ask with the group's tagged package", subject: "mesh.seat.node-build-node.accept.check", given: "{\"asker\":\"mesh-delivery-checker\",\"at\":\"2026-11-05T10:00:00Z\",\"check\":{\"fetch\":{\"base\":\"89abcdef0123456789abcdef0123456789abcdef\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"package\":{\"name\":\"@novox/mesh-sdk\",\"version\":\"0.1.15-feat-x.1\"},\"ref\":\"refs/pull/7/head\",\"repository\":\"novox/mesh-delivery\"},\"kept\":true,\"levels\":[\"unit\",\"integration\"],\"node-names\":[\"ace\",\"g14\"],\"toolchain\":{\"language\":\"typescript\",\"recipe\":\"1\",\"version\":\"26.12.0\"}},\"id\":\"c3d5\",\"kind\":\"check\",\"language\":\"typescript\",\"v\":1}", wire: "{\"asker\":\"mesh-delivery-checker\",\"at\":\"2026-11-05T10:00:00Z\",\"check\":{\"fetch\":{\"base\":\"89abcdef0123456789abcdef0123456789abcdef\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"package\":{\"name\":\"@novox/mesh-sdk\",\"version\":\"0.1.15-feat-x.1\"},\"ref\":\"refs/pull/7/head\",\"repository\":\"novox/mesh-delivery\"},\"kept\":true,\"levels\":[\"unit\",\"integration\"],\"node-names\":[\"ace\",\"g14\"],\"toolchain\":{\"language\":\"typescript\",\"recipe\":\"1\",\"version\":\"26.12.0\"}},\"id\":\"c3d5\",\"kind\":\"check\",\"language\":\"typescript\",\"v\":1}",
|
||||
{name: "a check ask with the group's packages", subject: "mesh.seat.node-build-node.accept.check", given: "{\"asker\":\"mesh-delivery-checker\",\"at\":\"2026-11-05T10:00:00Z\",\"check\":{\"fetch\":{\"base\":\"89abcdef0123456789abcdef0123456789abcdef\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"group-packages\":[{\"commit\":\"fedcba9876543210fedcba9876543210fedcba98\",\"ref\":\"refs/pull/12/head\",\"repository\":\"novox/mesh-sdk\"},{\"commit\":\"76543210fedcba9876543210fedcba9876543210\",\"path\":\"modules/mesh-delivery-contracts/ts/seats/git\",\"ref\":\"refs/pull/9/head\",\"repository\":\"novox/mesh-delivery\"}],\"ref\":\"refs/pull/7/head\",\"repository\":\"novox/mesh-catalog\"},\"kept\":true,\"levels\":[\"unit\",\"integration\"],\"node-names\":[\"ace\",\"g14\"],\"toolchain\":{\"language\":\"typescript\",\"recipe\":\"1\",\"version\":\"26.12.0\"}},\"id\":\"c3d5\",\"kind\":\"check\",\"language\":\"typescript\",\"v\":1}", wire: "{\"asker\":\"mesh-delivery-checker\",\"at\":\"2026-11-05T10:00:00Z\",\"check\":{\"fetch\":{\"base\":\"89abcdef0123456789abcdef0123456789abcdef\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"group-packages\":[{\"commit\":\"fedcba9876543210fedcba9876543210fedcba98\",\"ref\":\"refs/pull/12/head\",\"repository\":\"novox/mesh-sdk\"},{\"commit\":\"76543210fedcba9876543210fedcba9876543210\",\"path\":\"modules/mesh-delivery-contracts/ts/seats/git\",\"ref\":\"refs/pull/9/head\",\"repository\":\"novox/mesh-delivery\"}],\"ref\":\"refs/pull/7/head\",\"repository\":\"novox/mesh-catalog\"},\"kept\":true,\"levels\":[\"unit\",\"integration\"],\"node-names\":[\"ace\",\"g14\"],\"toolchain\":{\"language\":\"typescript\",\"recipe\":\"1\",\"version\":\"26.12.0\"}},\"id\":\"c3d5\",\"kind\":\"check\",\"language\":\"typescript\",\"v\":1}",
|
||||
decode: func(b []byte) (any, error) { var v CheckAccept; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.node-build-node\\.accept\\.check$")},
|
||||
{name: "a finished check step of a TypeScript merge preview", subject: "", given: "{\"ended\":\"2026-11-05T10:01:00Z\",\"id\":\"c3d6\",\"node\":\"ace\",\"result\":{\"fetch\":{\"base\":\"abcdef0123456789abcdef0123456789abcdef01\",\"changed\":[\"modules/m/package.json\"],\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"merge\":\"0123456789abcdef0123456789abcdef01234567\",\"modules\":[\"modules/m\"],\"trees\":{\"modules/m\":{\"manifest\":\"0581b699d9d05517e69b21f5cedbeb2eee8aba2b205280b561be731594d7feef\",\"tree\":\"0123456789abcdef0123456789abcdef01234567\"}},\"workspace\":\"mvii1sxt979f67\"}},\"started\":\"2026-11-05T10:00:00Z\",\"state\":\"passed\",\"tool\":\"check\",\"v\":1}", wire: "{\"ended\":\"2026-11-05T10:01:00Z\",\"id\":\"c3d6\",\"node\":\"ace\",\"result\":{\"fetch\":{\"base\":\"abcdef0123456789abcdef0123456789abcdef01\",\"changed\":[\"modules/m/package.json\"],\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"merge\":\"0123456789abcdef0123456789abcdef01234567\",\"modules\":[\"modules/m\"],\"trees\":{\"modules/m\":{\"manifest\":\"0581b699d9d05517e69b21f5cedbeb2eee8aba2b205280b561be731594d7feef\",\"tree\":\"0123456789abcdef0123456789abcdef01234567\"}},\"workspace\":\"mvii1sxt979f67\"}},\"started\":\"2026-11-05T10:00:00Z\",\"state\":\"passed\",\"tool\":\"check\",\"v\":1}",
|
||||
decode: func(b []byte) (any, error) { var v StepsByNodeIDValue; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
|
||||
|
||||
@@ -855,7 +855,7 @@
|
||||
},
|
||||
"Fetch": {
|
||||
"type": "object",
|
||||
"description": "what a build module's fetch tool is asked: the repository and the full commit, the pull request's ref when only its head carries the commit, the trunk commit to merge onto for a merge preview, the module's directory and named paths, the mesh packages to build against, and the sibling repositories placed beside",
|
||||
"description": "what a build module's fetch tool is asked: the repository and the full commit, the pull request's ref when only its head carries the commit, the trunk commit to merge onto for a merge preview, the module's directory and named paths, the mesh packages to build against, the group's TypeScript packages, and the sibling repositories placed beside",
|
||||
"properties": {
|
||||
"repository": {
|
||||
"type": "string",
|
||||
@@ -891,25 +891,11 @@
|
||||
},
|
||||
"description": "the version (a full commit) of each mesh package to build against, by its module path"
|
||||
},
|
||||
"package": {
|
||||
"type": "object",
|
||||
"description": "the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"version": {
|
||||
"type": "string"
|
||||
},
|
||||
"repository": {
|
||||
"type": "string"
|
||||
},
|
||||
"commit": {
|
||||
"type": "string"
|
||||
},
|
||||
"ref": {
|
||||
"type": "string"
|
||||
}
|
||||
"group-packages": {
|
||||
"type": "array",
|
||||
"description": "a group's check: the TypeScript packages the group's members change, each a package of a member at its commit with its directory there; the build module packs each and places it by its package.json name in every module of the tree that names it, in place of the registry's (design 47 G A-284, A-285)",
|
||||
"items": {
|
||||
"$ref": "#/defs/FetchPackage"
|
||||
}
|
||||
},
|
||||
"beside": {
|
||||
@@ -933,7 +919,7 @@
|
||||
},
|
||||
"builds": {
|
||||
"type": "array",
|
||||
"description": "a group run's package members, each by its build's digest: the build module reads each from the artifact store at artifact-store://<module>/<artifact>/blobs/<digest>, checks the bytes against the digest and lays them as the group package; a package named here is named in neither packages nor package",
|
||||
"description": "a group run's package members, each by its build's digest: the build module reads each from the artifact store at artifact-store://<module>/<artifact>/blobs/<digest>, checks the bytes against the digest and lays them as the group package; a package named here is named in neither packages nor group-packages",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -966,6 +952,32 @@
|
||||
"commit"
|
||||
]
|
||||
},
|
||||
"FetchPackage": {
|
||||
"type": "object",
|
||||
"description": "one TypeScript package of a group's member: the member's repository, the commit packed (the member's head), the pull request's ref when only its head carries it, and the package's directory in the member (empty for the member's root)",
|
||||
"properties": {
|
||||
"repository": {
|
||||
"type": "string",
|
||||
"description": "<owner>/<name>"
|
||||
},
|
||||
"commit": {
|
||||
"type": "string",
|
||||
"description": "the full commit"
|
||||
},
|
||||
"ref": {
|
||||
"type": "string",
|
||||
"description": "the pull request's ref, when only its head carries the commit"
|
||||
},
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "the package's directory in the member, empty for the member's root"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"repository",
|
||||
"commit"
|
||||
]
|
||||
},
|
||||
"ToolchainUsed": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "a check ask with the group's tagged package",
|
||||
"name": "a check ask with the group's packages",
|
||||
"of": "accept:check",
|
||||
"subject": "mesh.seat.node-build-node.accept.check",
|
||||
"given": {
|
||||
@@ -104,14 +104,23 @@
|
||||
"at": "2026-11-05T10:00:00Z",
|
||||
"check": {
|
||||
"fetch": {
|
||||
"repository": "novox/mesh-delivery",
|
||||
"repository": "novox/mesh-catalog",
|
||||
"commit": "0123456789abcdef0123456789abcdef01234567",
|
||||
"ref": "refs/pull/7/head",
|
||||
"base": "89abcdef0123456789abcdef0123456789abcdef",
|
||||
"package": {
|
||||
"name": "@novox/mesh-sdk",
|
||||
"version": "0.1.15-feat-x.1"
|
||||
}
|
||||
"group-packages": [
|
||||
{
|
||||
"repository": "novox/mesh-sdk",
|
||||
"commit": "fedcba9876543210fedcba9876543210fedcba98",
|
||||
"ref": "refs/pull/12/head"
|
||||
},
|
||||
{
|
||||
"repository": "novox/mesh-delivery",
|
||||
"commit": "76543210fedcba9876543210fedcba9876543210",
|
||||
"ref": "refs/pull/9/head",
|
||||
"path": "modules/mesh-delivery-contracts/ts/seats/git"
|
||||
}
|
||||
]
|
||||
},
|
||||
"levels": [
|
||||
"unit",
|
||||
|
||||
+16
-13
@@ -132,29 +132,20 @@ export interface FetchBuildsItem {
|
||||
"package": string;
|
||||
}
|
||||
|
||||
/** the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's */
|
||||
export interface FetchPackage {
|
||||
"commit"?: string;
|
||||
"name"?: string;
|
||||
"ref"?: string;
|
||||
"repository"?: string;
|
||||
"version"?: string;
|
||||
}
|
||||
|
||||
/** what a build module's fetch tool is asked: the repository and the full commit, the pull request's ref when only its head carries the commit, the trunk commit to merge onto for a merge preview, the module's directory and named paths, the mesh packages to build against, and the sibling repositories placed beside */
|
||||
/** what a build module's fetch tool is asked: the repository and the full commit, the pull request's ref when only its head carries the commit, the trunk commit to merge onto for a merge preview, the module's directory and named paths, the mesh packages to build against, the group's TypeScript packages, and the sibling repositories placed beside */
|
||||
export interface Fetch {
|
||||
/** the trunk commit a merge preview merges onto */
|
||||
"base"?: string;
|
||||
/** the sibling repositories placed beside the fetched tree */
|
||||
"beside"?: FetchBesideItem[];
|
||||
/** a group run's package members, each by its build's digest: the build module reads each from the artifact store at artifact-store://<module>/<artifact>/blobs/<digest>, checks the bytes against the digest and lays them as the group package; a package named here is named in neither packages nor package */
|
||||
/** a group run's package members, each by its build's digest: the build module reads each from the artifact store at artifact-store://<module>/<artifact>/blobs/<digest>, checks the bytes against the digest and lays them as the group package; a package named here is named in neither packages nor group-packages */
|
||||
"builds"?: FetchBuildsItem[];
|
||||
/** the full commit */
|
||||
"commit": string;
|
||||
/** the module's directory in the repository ("." for its root), with paths */
|
||||
"dir"?: string;
|
||||
/** the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's */
|
||||
"package"?: FetchPackage;
|
||||
/** a group's check: the TypeScript packages the group's members change, each a package of a member at its commit with its directory there; the build module packs each and places it by its package.json name in every module of the tree that names it, in place of the registry's (design 47 G A-284, A-285) */
|
||||
"group-packages"?: FetchPackage[];
|
||||
/** the version (a full commit) of each mesh package to build against, by its module path */
|
||||
"packages"?: Record<string, string>;
|
||||
/** the paths the module names, relative to dir */
|
||||
@@ -183,6 +174,18 @@ export interface FetchAnswer {
|
||||
"workspace": string;
|
||||
}
|
||||
|
||||
/** one TypeScript package of a group's member: the member's repository, the commit packed (the member's head), the pull request's ref when only its head carries it, and the package's directory in the member (empty for the member's root) */
|
||||
export interface FetchPackage {
|
||||
/** the full commit */
|
||||
"commit": string;
|
||||
/** the package's directory in the member, empty for the member's root */
|
||||
"path"?: string;
|
||||
/** the pull request's ref, when only its head carries the commit */
|
||||
"ref"?: string;
|
||||
/** <owner>/<name> */
|
||||
"repository": string;
|
||||
}
|
||||
|
||||
/** a TypeScript module whose packages the fetch did not install, with why */
|
||||
export interface FetchRefusal {
|
||||
"module": string;
|
||||
|
||||
+16
-13
@@ -132,29 +132,20 @@ export interface FetchBuildsItem {
|
||||
"package": string;
|
||||
}
|
||||
|
||||
/** the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's */
|
||||
export interface FetchPackage {
|
||||
"commit"?: string;
|
||||
"name"?: string;
|
||||
"ref"?: string;
|
||||
"repository"?: string;
|
||||
"version"?: string;
|
||||
}
|
||||
|
||||
/** what a build module's fetch tool is asked: the repository and the full commit, the pull request's ref when only its head carries the commit, the trunk commit to merge onto for a merge preview, the module's directory and named paths, the mesh packages to build against, and the sibling repositories placed beside */
|
||||
/** what a build module's fetch tool is asked: the repository and the full commit, the pull request's ref when only its head carries the commit, the trunk commit to merge onto for a merge preview, the module's directory and named paths, the mesh packages to build against, the group's TypeScript packages, and the sibling repositories placed beside */
|
||||
export interface Fetch {
|
||||
/** the trunk commit a merge preview merges onto */
|
||||
"base"?: string;
|
||||
/** the sibling repositories placed beside the fetched tree */
|
||||
"beside"?: FetchBesideItem[];
|
||||
/** a group run's package members, each by its build's digest: the build module reads each from the artifact store at artifact-store://<module>/<artifact>/blobs/<digest>, checks the bytes against the digest and lays them as the group package; a package named here is named in neither packages nor package */
|
||||
/** a group run's package members, each by its build's digest: the build module reads each from the artifact store at artifact-store://<module>/<artifact>/blobs/<digest>, checks the bytes against the digest and lays them as the group package; a package named here is named in neither packages nor group-packages */
|
||||
"builds"?: FetchBuildsItem[];
|
||||
/** the full commit */
|
||||
"commit": string;
|
||||
/** the module's directory in the repository ("." for its root), with paths */
|
||||
"dir"?: string;
|
||||
/** the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's */
|
||||
"package"?: FetchPackage;
|
||||
/** a group's check: the TypeScript packages the group's members change, each a package of a member at its commit with its directory there; the build module packs each and places it by its package.json name in every module of the tree that names it, in place of the registry's (design 47 G A-284, A-285) */
|
||||
"group-packages"?: FetchPackage[];
|
||||
/** the version (a full commit) of each mesh package to build against, by its module path */
|
||||
"packages"?: Record<string, string>;
|
||||
/** the paths the module names, relative to dir */
|
||||
@@ -183,6 +174,18 @@ export interface FetchAnswer {
|
||||
"workspace": string;
|
||||
}
|
||||
|
||||
/** one TypeScript package of a group's member: the member's repository, the commit packed (the member's head), the pull request's ref when only its head carries it, and the package's directory in the member (empty for the member's root) */
|
||||
export interface FetchPackage {
|
||||
/** the full commit */
|
||||
"commit": string;
|
||||
/** the package's directory in the member, empty for the member's root */
|
||||
"path"?: string;
|
||||
/** the pull request's ref, when only its head carries the commit */
|
||||
"ref"?: string;
|
||||
/** <owner>/<name> */
|
||||
"repository": string;
|
||||
}
|
||||
|
||||
/** a TypeScript module whose packages the fetch did not install, with why */
|
||||
export interface FetchRefusal {
|
||||
"module": string;
|
||||
|
||||
+16
-13
@@ -132,29 +132,20 @@ export interface FetchBuildsItem {
|
||||
"package": string;
|
||||
}
|
||||
|
||||
/** the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's */
|
||||
export interface FetchPackage {
|
||||
"commit"?: string;
|
||||
"name"?: string;
|
||||
"ref"?: string;
|
||||
"repository"?: string;
|
||||
"version"?: string;
|
||||
}
|
||||
|
||||
/** what a build module's fetch tool is asked: the repository and the full commit, the pull request's ref when only its head carries the commit, the trunk commit to merge onto for a merge preview, the module's directory and named paths, the mesh packages to build against, and the sibling repositories placed beside */
|
||||
/** what a build module's fetch tool is asked: the repository and the full commit, the pull request's ref when only its head carries the commit, the trunk commit to merge onto for a merge preview, the module's directory and named paths, the mesh packages to build against, the group's TypeScript packages, and the sibling repositories placed beside */
|
||||
export interface Fetch {
|
||||
/** the trunk commit a merge preview merges onto */
|
||||
"base"?: string;
|
||||
/** the sibling repositories placed beside the fetched tree */
|
||||
"beside"?: FetchBesideItem[];
|
||||
/** a group run's package members, each by its build's digest: the build module reads each from the artifact store at artifact-store://<module>/<artifact>/blobs/<digest>, checks the bytes against the digest and lays them as the group package; a package named here is named in neither packages nor package */
|
||||
/** a group run's package members, each by its build's digest: the build module reads each from the artifact store at artifact-store://<module>/<artifact>/blobs/<digest>, checks the bytes against the digest and lays them as the group package; a package named here is named in neither packages nor group-packages */
|
||||
"builds"?: FetchBuildsItem[];
|
||||
/** the full commit */
|
||||
"commit": string;
|
||||
/** the module's directory in the repository ("." for its root), with paths */
|
||||
"dir"?: string;
|
||||
/** the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's */
|
||||
"package"?: FetchPackage;
|
||||
/** a group's check: the TypeScript packages the group's members change, each a package of a member at its commit with its directory there; the build module packs each and places it by its package.json name in every module of the tree that names it, in place of the registry's (design 47 G A-284, A-285) */
|
||||
"group-packages"?: FetchPackage[];
|
||||
/** the version (a full commit) of each mesh package to build against, by its module path */
|
||||
"packages"?: Record<string, string>;
|
||||
/** the paths the module names, relative to dir */
|
||||
@@ -183,6 +174,18 @@ export interface FetchAnswer {
|
||||
"workspace": string;
|
||||
}
|
||||
|
||||
/** one TypeScript package of a group's member: the member's repository, the commit packed (the member's head), the pull request's ref when only its head carries it, and the package's directory in the member (empty for the member's root) */
|
||||
export interface FetchPackage {
|
||||
/** the full commit */
|
||||
"commit": string;
|
||||
/** the package's directory in the member, empty for the member's root */
|
||||
"path"?: string;
|
||||
/** the pull request's ref, when only its head carries the commit */
|
||||
"ref"?: string;
|
||||
/** <owner>/<name> */
|
||||
"repository": string;
|
||||
}
|
||||
|
||||
/** a TypeScript module whose packages the fetch did not install, with why */
|
||||
export interface FetchRefusal {
|
||||
"module": string;
|
||||
|
||||
@@ -265,12 +265,13 @@ type Fetch struct {
|
||||
Dir string `json:"dir,omitempty"`
|
||||
Paths []string `json:"paths,omitempty"`
|
||||
Packages PackageVersions `json:"packages,omitempty"`
|
||||
// Package is the TypeScript module's group package: the group's tagged version ({name, version}) or the group's package
|
||||
// member ({repository, commit, ref}).
|
||||
Package *FetchPackage `json:"package,omitempty"`
|
||||
Beside []FetchBeside `json:"beside,omitempty"`
|
||||
// GroupPackages are, in a group's check, the TypeScript packages the group's members change (design 47 G A-284, A-285):
|
||||
// the build module packs each and places it by its package.json name in every module of the tree that names it, in place
|
||||
// of the registry's. Packages stays the Go mesh packages' versions.
|
||||
GroupPackages []FetchPackage `json:"group-packages,omitempty"`
|
||||
Beside []FetchBeside `json:"beside,omitempty"`
|
||||
// Builds name a group run's package members by their builds' digests (design 47 G §465): a package named here is named in
|
||||
// neither Packages nor Package.
|
||||
// neither Packages nor GroupPackages.
|
||||
Builds []FetchBuild `json:"builds,omitempty"`
|
||||
}
|
||||
|
||||
@@ -283,14 +284,14 @@ type FetchBuild struct {
|
||||
Digest string `json:"digest"`
|
||||
}
|
||||
|
||||
// FetchPackage is the group package a TypeScript fetch takes (ADR 0607 §3, ADR 0500 §5): either the group's tagged version
|
||||
// (Name and Version) or the group's package member (Repository, Commit and Ref).
|
||||
// FetchPackage is one TypeScript package of a group's member (design 47 G A-285, ADR 0500 §5): the member's repository,
|
||||
// the commit packed (its head), the pull request's ref when only its head carries the commit, and Path, the package's
|
||||
// directory in the member ("" for the member's root).
|
||||
type FetchPackage struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
Version string `json:"version,omitempty"`
|
||||
Repository string `json:"repository,omitempty"`
|
||||
Commit string `json:"commit,omitempty"`
|
||||
Repository string `json:"repository"`
|
||||
Commit string `json:"commit"`
|
||||
Ref string `json:"ref,omitempty"`
|
||||
Path string `json:"path,omitempty"`
|
||||
}
|
||||
|
||||
// FetchBeside is a sibling repository placed beside the fetched tree.
|
||||
|
||||
Reference in New Issue
Block a user