e66d4669d6
gates / gates (push) Failing after 47s
An app was six pages — details, install/settings, logs, export, the per-app backup panel and a
details card for moving data — and every "Vissza" on them went to the app LIST, so there was no way
back to the app you were looking at. It is now ONE page with four tab URLs under /apps/{slug}/,
one shared header and one set of banners.
settings Mukodes (Start/Restart/Stop, Stop confirms) + the cards that want something from the
household + the install-time and optional settings. The default for an installed app,
RENDERED at the bare URL and never redirected to.
data the data folders, move to another drive, the nightly copy, the 2nd-copy setting, export
guide tagline, screenshots, use cases, first steps, the catalog's guide, the FAQ, the docs
link — and the WHOLE page for an app that is not installed
logs the log, and the only tab whose poller runs
The tabs are links, not panels: a link in an alert has to land ON a tab, and the log poller must not
run on the other three. Start/Restart/Stop left the page header, where they read as menu buttons.
The old /stacks/{name}/{deploy,logs,export,backup} GETs answer 302 — never 301, which a browser
caches beyond anyone's reach — to the tab that now holds them, query string carried through, with
name->slug resolved through the stack list rather than assumed equal. Every POST on those paths is
untouched: the backup form, the app-email toggle and the reveal endpoints keep their URLs.
A value asked AFTER the app starts is now generic (D2). The catalog marks a field `after_start: true`
and supplies its label; the ACTION is Go, in a registry keyed by slug + env var. The catalog can
never declare what runs — a declared field with no registered action renders nothing, POSTs 404 and
logs one WARN with the env var KEY, never the value. A red-proof found the second half of that guard
unpinned: deleting the "the catalog must have DECLARED this field" check left the suite green, and a
POST for an undeclared field then reached Plex and opened the setup gate.
TestAfterStart_RegistryAloneIsNotAnInvitation pins it.
New catalog block app_info.guide (sections + faq + checked_version), parsed, localised field by
field and rendered with the household's own address filled in. It renders only when checked_version
names the image tag its author clicked through. No template carries one yet.
The Pi and "csak x86" badges are gone; PiCompatible and the catalog key stay this release, or a box
on 0.314.0 would read "csak x86" on every app (R-1067).
template_id_gate.py now follows {{template}} includes, with a scope decoy proving the walk did not
become vacuous.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117kRTSgs3rJWUFGxyoWN6Y
97 lines
4.0 KiB
Go
97 lines
4.0 KiB
Go
package web
|
|
|
|
import (
|
|
"html"
|
|
"io"
|
|
"log"
|
|
"strings"
|
|
"testing"
|
|
"time"
|
|
|
|
"gitea.dooplex.hu/admin/felhom-controller/internal/backup"
|
|
"gitea.dooplex.hu/admin/felhom-controller/internal/stacks"
|
|
"gitea.dooplex.hu/admin/felhom-controller/internal/util"
|
|
)
|
|
|
|
// R-606 (v0.264.0) — every sentence of the update path reaches the page in the READER's language, on
|
|
// BOTH pages that carry it (the app page and the apps list): the phase label, the update error and the
|
|
// hold sentence. Asserted both ways — the English present AND the Hungarian gone — because a page
|
|
// carrying both would pass a presence check (the composed-sentence class, R-573/R-590/R-596/R-598).
|
|
//
|
|
// COMPANION RED-PROOF (REPORT.md): make localeFuncs' updateErrorText return .UpdateError — the English
|
|
// page carries the Hungarian sentence and this test fails.
|
|
func TestR606_UpdateSentencesFollowTheReader(t *testing.T) {
|
|
s := i18nTestServer(t)
|
|
b := backup.NewManager(s.cfg, s.settings, log.New(io.Discard, "", 0))
|
|
s.backupMgr = b
|
|
at := time.Date(2026, 9, 23, 8, 0, 0, 0, time.UTC)
|
|
if err := b.HoldAfterFailedUpdateHolding("kimai", at, at.Add(-6*time.Hour), backup.UpdateTierLocal, b.UpdateCopyHolds("kimai", backup.UpdateTierLocal), ""); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
_, holdHU := b.RestoreHoldForLang("kimai", "hu")
|
|
|
|
errStack := i18nStack("gokapi", "Go Kapi", stacks.StateRunning, true)
|
|
errStack.UpdateErrorKey, errStack.UpdateErrorArgs = "update.error.pull_failed", nil
|
|
errStack.UpdateError = stacks.MsgUpdatePullFailed
|
|
upd := i18nStack("romm", "Rom Manager", stacks.StateRunning, true)
|
|
upd.Updating, upd.UpdatePhase, upd.UpdatePhaseLabel = true, stacks.UpdatePhaseCopying, stacks.UpdatePhaseLabel(stacks.UpdatePhaseCopying)
|
|
held := i18nStack("kimai", "Kimai Time", stacks.StateStopped, true)
|
|
held.HoldReason = holdHU
|
|
|
|
pages := []i18nCase{
|
|
{"r606_list", "stacks", func() map[string]interface{} {
|
|
d := i18nLayoutData("stacks", "Alkalmazások")
|
|
d["Stacks"] = []stacks.Stack{errStack, upd, held}
|
|
for _, k := range []string{"Subdomains", "MissingStorage", "NetworkStubs", "NetworkWarnings", "StorageLabels"} {
|
|
d[k] = map[string]string{}
|
|
}
|
|
return d
|
|
}},
|
|
{"r606_app_error", "app_settings", func() map[string]interface{} {
|
|
d := i18nLayoutData("stacks", "Go Kapi")
|
|
st := errStack
|
|
d["Stack"], d["Meta"], d["AppInfo"] = &st, st.Meta, st.Meta.AppInfo
|
|
return d
|
|
}},
|
|
{"r606_app_held", "app_settings", func() map[string]interface{} {
|
|
d := i18nLayoutData("stacks", "Kimai")
|
|
st := held
|
|
d["Stack"], d["Meta"], d["AppInfo"] = &st, st.Meta, st.Meta.AppInfo
|
|
return d
|
|
}},
|
|
{"r606_app_updating", "app_settings", func() map[string]interface{} {
|
|
d := i18nLayoutData("stacks", "RomM")
|
|
st := upd
|
|
d["Stack"], d["Meta"], d["AppInfo"] = &st, st.Meta, st.Meta.AppInfo
|
|
return d
|
|
}},
|
|
}
|
|
type want struct{ en, hu string }
|
|
sentences := map[string][]want{
|
|
"r606_list": {
|
|
{util.Text("en", "update.error.pull_failed"), stacks.MsgUpdatePullFailed},
|
|
{"Copying the data before the update…", "Az adatok másolása a frissítés előtt…"},
|
|
{"own drive", "saját meghajtó"},
|
|
{"holds the settings, the database and the data volumes", "a beállításokat, az adatbázist és az adatköteteket tartalmazza"},
|
|
},
|
|
"r606_app_error": {{util.Text("en", "update.error.pull_failed"), stacks.MsgUpdatePullFailed}},
|
|
"r606_app_held": {{"The update of kimai at 2026-09-23 10:00 did not succeed", "A(z) kimai frissítése 2026-09-23 10:00-kor nem sikerült"}},
|
|
"r606_app_updating": {{"Copying the data before the update…", "Az adatok másolása a frissítés előtt…"}},
|
|
}
|
|
for _, c := range pages {
|
|
en := html.UnescapeString(renderI18nCase(t, s, "en", c))
|
|
hu := html.UnescapeString(renderI18nCase(t, s, "hu", c))
|
|
for _, w := range sentences[c.name] {
|
|
if !strings.Contains(en, w.en) {
|
|
t.Errorf("%s: the English page lacks %q", c.name, w.en)
|
|
}
|
|
if strings.Contains(en, w.hu) {
|
|
t.Errorf("%s: the Hungarian %q must be GONE from the English page", c.name, w.hu)
|
|
}
|
|
if !strings.Contains(hu, w.hu) {
|
|
t.Errorf("%s: the Hungarian page lacks %q", c.name, w.hu)
|
|
}
|
|
}
|
|
}
|
|
}
|