Feature 57 (config and provisioning): modules declare config and provisions, their files rendered from templates; synced with main (issues of feature 57, 874)

This commit is contained in:
2026-10-16 07:37:43 +00:00
parent 1a2c917abf
commit 9652b2d5ce
771 changed files with 52063 additions and 1774 deletions
+3 -2
View File
@@ -4,10 +4,11 @@ package main
// formatting", "too much text, no formatting, no summary"). The router's words are shown as given —
// `exact-render` — and formatted, never reworded:
//
// - the title in bold: the headline, or how an answered ask ended;
// - the title in bold: the headline, an answered ask's too (issue 714);
// - the body as it is, a line that is a key with its value (as a settings proposal lists them, "+ key: value")
// in monospace;
// - the note — who asked, what each answer does, the expiry, the asker's details — apart, after a blank line,
// - the note — who asked, what each answer does, the expiry, the asker's details; once answered, how it ended
// and who acts on it — apart, after a blank line,
// in a blockquote Telegram shows collapsed to its first lines, expanded on a tap.
//
// Every character Telegram's HTML would read as markup is escaped first, so a message carrying '<' neither
@@ -84,3 +84,20 @@ func TestTheNoteIsEscaped(t *testing.T) {
t.Errorf("%q", got)
}
}
// novox/hq issue 714: an answered ask keeps its question whole, with how it ended below it. Over Telegram's bound,
// the end of the body (the asker's Details) is cut; the headline and the answer are never.
func TestAnAnsweredAskOverTheBoundKeepsItsHeadlineAndItsAnswer(t *testing.T) {
answer := "You chose Approve at 20:03 on Telegram.\nTold to mesh-knowledge, which acts on it itself."
m := asks.Message{Handle: "h-714", To: "42", Title: "Fixes reach every machine at once, unchecked",
Body: "A fix goes to every machine in one step.\n• No machine goes first\n" + strings.Repeat("Details line. ", 400),
Note: answer}
s := partsOf(m)
if n := len([]rune(s.plain())); n > MaxLength {
t.Fatalf("the answered ask is %d characters, over %d", n, MaxLength)
}
if s.title != m.Title || s.note != answer || !strings.HasPrefix(s.body, "A fix goes to every machine in one step.\n• No machine goes first") ||
!strings.HasSuffix(s.body, cutNote) {
t.Errorf("the headline, the summary or the answer was cut:\n%s", s.plain())
}
}