carlos / platform Public

console: the mismatch warning follows the promote forms

The releases tab hosts the mutations; the banner that says they reach
nothing must render there too, not only on the overview.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Paul Campbell b3eb702290a4dbd691332b670075fb628659fb60 parent 6c6abf4
2 files changed, +24 −0
  • internal/console/server_account_test.go +11 −0
  • internal/console/templates/app_releases.html +13 −0
diff --git a/internal/console/server_account_test.go b/internal/console/server_account_test.go
index 0eaf9889e..1eae5aa5e 100644
--- a/internal/console/server_account_test.go
+++ b/internal/console/server_account_test.go
@@ -695,6 +695,17 @@ func TestAppPageWarnsWhenAccountsDisagree(t *testing.T) {
if !strings.Contains(body, "console migrate-app -app kass -to "+sqid) {
t.Errorf("the warning does not name the command that fixes it:\n%s", body)
}
+
+ // The promote/rollback/canary forms live on the releases tab, not the
+ // overview — a deep link there must not promote blind. Same warning,
+ // same fix, on the page that actually hosts the mutations.
+ _, _, body = get(t, c, fx.u("/apps/kass/releases"))
+ if !strings.Contains(body, "not deploying") {
+ t.Errorf("no warning on the releases tab of a half-migrated app:\n%s", body)
+ }
+ if !strings.Contains(body, "console migrate-app -app kass -to "+sqid) {
+ t.Errorf("the releases tab warning does not name the command that fixes it:\n%s", body)
+ }
}
// Creating an account from the console: minted id, bucket manifest, owner
diff --git a/internal/console/templates/app_releases.html b/internal/console/templates/app_releases.html
index b9eeb9e10..27dd4c509 100644
--- a/internal/console/templates/app_releases.html
+++ b/internal/console/templates/app_releases.html
@@ -2,6 +2,19 @@
{{if .Flash}}<p class="banner">{{.Flash}}</p>{{end}}
{{if .FlashErr}}<p class="banner error">{{.FlashErr}}</p>{{end}}
{{template "appnav" .}}
+{{if .Detail.AccountMismatch}}
+<p class="banner error">
+ <strong>This app is not deploying.</strong> Its hosts read releases from
+ account <code>{{.Detail.RouteAccount}}</code>, but this page writes them to
+ <code>{{.Account.Sqid}}</code> — so a promote here succeeds and reaches
+ nothing. Its bucket objects were moved without the console's own record
+ following. On the console's box, run:
+ <br><code>console migrate-app -app {{.Detail.App}} -to {{.Detail.RouteAccount}}</code>
+ <br><span class="small">If it is the routes that are in the wrong account,
+ move those back instead — whichever of the two is right, they have to
+ agree.</span>
+</p>
+{{end}}
<h2>Channels</h2>
{{if .Detail.Channels}}