diff --git a/modules/gitea/index.ts b/modules/gitea/index.ts index 4e52c8c3b..6418924f7 100644 --- a/modules/gitea/index.ts +++ b/modules/gitea/index.ts @@ -469,9 +469,8 @@ if (gitea) { } void registrations.start().then(() => reloadHeads()).catch(say); } - // Main takes no push and only the tools' account merges, in every repository, kept and not only when a token is - // minted: at the start and every ten minutes after, so a repository made later gets it too (issue 948, ADR 0398 §2). - // Only while the setting keep-main-rules is true (mainrules.ts); false, the default, leaves every repository's rule as set. + // Main's rule is put right only when the tools' account's token is minted, and only while the setting keep-main-rules is + // true (mainrules.ts); no timer keeps it (design 47 H §764, H-A-100). // The package seats' write token (packages-account.ts): minted at the start; after that renewed only when the Go // bundle that writes with it says the forge refused it (the finding PACKAGES_TOKEN_REFUSED), never on a timer. try { diff --git a/modules/gitea/module.json b/modules/gitea/module.json index 9941bc4e5..40de8e851 100644 --- a/modules/gitea/module.json +++ b/modules/gitea/module.json @@ -220,7 +220,7 @@ }, "keep-main-rules": { "type": "boolean", - "description": "Whether the module keeps main's branch protection as the mesh wants it. True: every ten minutes, and at the start, main's rule in every repository of the organisation novox is put to no push and the tools' account alone merging, and each apply of the `repositories` value narrows the main rule of the repositories it lists, requiring no status. False (the default): the module changes no existing repository's branch protection, whoever set it at the forge, but takes away a required status it finds on a rule covering main, once (ADR 0534 §1); a repository listed in `repositories` that does not exist is still made, with its first protection.", + "description": "Whether the module keeps main's branch protection as the mesh wants it. True: when the tools' account's token is minted, main's rule in every repository of the organisation novox is put to no push and the tools' account alone merging, and each apply of the `repositories` value narrows the main rule of the repositories it lists, requiring no status. False (the default): the module changes no existing repository's branch protection, whoever set it at the forge, but takes away a required status it finds on a rule covering main, once (ADR 0534 §1); a repository listed in `repositories` that does not exist is still made, with its first protection.", "trusted": true, "default": false }, diff --git a/modules/gitea/test/mainrules.test.ts b/modules/gitea/test/mainrules.test.ts index 9575b4361..1d26b745c 100644 --- a/modules/gitea/test/mainrules.test.ts +++ b/modules/gitea/test/mainrules.test.ts @@ -2,7 +2,7 @@ // writes nothing at the forge, true puts main's rule right as before. import { test } from "node:test"; import assert from "node:assert/strict"; -import { mkdtempSync, writeFileSync } from "node:fs"; +import { mkdtempSync, readFileSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; @@ -15,6 +15,14 @@ function env(body?: string): NodeJS.ProcessEnv { return { MESH_GITEA_CONFIG_FILE: f }; } +// No timer keeps main's rules (design 47 H §764, H-A-100): the setting's description says when it acts, and names none. +test("the setting's description names no timer", () => { + const manifest = JSON.parse(readFileSync(new URL("../module.json", import.meta.url), "utf8")); + const said: string = manifest.config["keep-main-rules"].description; + assert.match(said, /token is minted/); + assert.doesNotMatch(said, /every ten minutes|every \w+ minutes/); +}); + test("the setting is false unless the config says true", () => { assert.equal(keepMainRules(env()), false); assert.equal(keepMainRules(env("{}")), false); diff --git a/modules/mesh-issues/cmd/mesh-issues/core_test.go b/modules/mesh-issues/cmd/mesh-issues/core_test.go index 237801475..49b3527ea 100644 --- a/modules/mesh-issues/cmd/mesh-issues/core_test.go +++ b/modules/mesh-issues/cmd/mesh-issues/core_test.go @@ -13,7 +13,7 @@ func TestIsCoreNamesTheBuildModulesAndTheDeliveryParts(t *testing.T) { for _, e := range []string{ "mesh-catalog modules/mesh-build-go", "mesh-catalog modules/mesh-build-node", "mesh-catalog modules/mesh-build-image", "mesh-catalog modules/mesh-build-go/cmd/mesh-build-go", - "mesh-delivery", "mesh-delivery modules/mesh-delivery-checker", "mesh-catalog modules/mesh-delivery-gate", + "mesh-delivery", "mesh-catalog modules/mesh-delivery-gate", "mesh-catalog modules/nats", "mesh-catalog modules/gitea", "mesh-sdk", } { if !IsCore([]string{e}) { @@ -43,5 +43,16 @@ func TestNoOwnerNamesBuildAgent(t *testing.T) { if strings.Contains(o, "build-agent") { t.Errorf("the owner %q is registered: build-agent is gone (ADR 0524 §5)", o) } + if strings.Contains(o, "mesh-delivery-checker") { + t.Errorf("the owner %q is registered: the checker is gone whole (design 47 H §764)", o) + } + } + // The manifest's default owners name it no more either. + raw, err := os.ReadFile(filepath.Join("..", "..", "module.json")) + if err != nil { + t.Fatal(err) + } + if strings.Contains(string(raw), "mesh-delivery-checker") { + t.Error("the manifest names mesh-delivery-checker: the checker is gone whole (design 47 H §764)") } } diff --git a/modules/mesh-issues/cmd/mesh-issues/manifest_test.go b/modules/mesh-issues/cmd/mesh-issues/manifest_test.go index 9cd24d027..9588b3ed6 100644 --- a/modules/mesh-issues/cmd/mesh-issues/manifest_test.go +++ b/modules/mesh-issues/cmd/mesh-issues/manifest_test.go @@ -264,7 +264,7 @@ func TestEveryCodeModuleOfTheCatalogueIsAnOwner(t *testing.T) { } // 1815/AC2: the delivery repository's modules cannot ride on its repository entry (owns refuses a folder // of a repository that is registered only as a whole), so each is named. - for _, m := range []string{"builder", "checker", "indexer"} { + for _, m := range []string{"builder", "indexer"} { // the checker went whole (design 47 H §764) if Owners(s.Owners).owns("mesh-delivery modules/mesh-delivery-"+m) == "" { t.Errorf("mesh-delivery-%s is not an owner", m) } diff --git a/modules/mesh-issues/files/settings.json b/modules/mesh-issues/files/settings.json index b833058f6..8c2f04378 100644 --- a/modules/mesh-issues/files/settings.json +++ b/modules/mesh-issues/files/settings.json @@ -147,7 +147,6 @@ "mesh-catalog modules/zsh-syntax-highlighting", "mesh-delivery", "mesh-delivery modules/mesh-delivery-builder", - "mesh-delivery modules/mesh-delivery-checker", "mesh-delivery modules/mesh-delivery-forge-bridge", "mesh-delivery modules/mesh-delivery-indexer", "mesh-delivery modules/mesh-delivery-teller", diff --git a/modules/mesh-issues/module.json b/modules/mesh-issues/module.json index ebf31730c..7e1f48975 100644 --- a/modules/mesh-issues/module.json +++ b/modules/mesh-issues/module.json @@ -259,7 +259,6 @@ "mesh-catalog modules/zsh-syntax-highlighting", "mesh-delivery", "mesh-delivery modules/mesh-delivery-builder", - "mesh-delivery modules/mesh-delivery-checker", "mesh-delivery modules/mesh-delivery-forge-bridge", "mesh-delivery modules/mesh-delivery-indexer", "mesh-delivery modules/mesh-delivery-teller",