carlos / platform Public

Console: Releases is one page; /deployments redirects to it

What's next, Live now (the page's only Roll back), Versions paged by
?page= (newest 20 a page, one listing and at most 20 manifest reads on
every page), then closed folds for Channels and the promotion ladder,
Canaries and Tags. GET /deployments answers 303 to /releases through
appRedirect, after accountApp's gates. release.VersionCandidatesPage and
console.VersionsPage page the ranked listing; VersionCandidates and
Versions are their first-page wrappers. NAV-C21 to C39 and C45 built.
The perf walk expects 303 on /deployments and walks /releases?page=2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 666e0d57dda35916ad251e8f490db7e7426ff884 parent 8607e6d
22 files changed, +576 −216
  • internal/console/appredirect.go +21 −0
  • internal/console/approved_nav_copy_test.go +5 −0
  • internal/console/claim_invariant_fixtures_test.go +1 −1
  • internal/console/claim_invariant_probes_read_test.go +1 −1
  • internal/console/deployments.go +48 −10
  • internal/console/deployments_test.go +238 −17
  • internal/console/navsnapshot_test.go +6 −0
  • internal/console/perfwalk_test.go +10 −3
  • internal/console/pipelinepage_test.go +4 −1
  • internal/console/server.go +36 −17
  • internal/console/server_test.go +1 −1
  • internal/console/statuscopy_test.go +3 −1
  • internal/console/templates/app_deployments.html +0 −31
  • internal/console/templates/app_overview.html +4 −4
  • internal/console/templates/app_releases.html +61 −72
  • internal/console/templates/app_settings.html +1 −1
  • internal/console/templates/layout.html +1 −0
  • internal/console/testdata/perf-budgets.txt +1 −2
  • internal/console/view.go +30 −42
  • internal/console/view_test.go +19 −0
  • internal/release/candidates.go +23 −4
  • internal/release/versions_test.go +62 −8
diff --git a/internal/console/appredirect.go b/internal/console/appredirect.go
new file mode 100644
index 000000000..ddc49f0b4
--- /dev/null
+++ b/internal/console/appredirect.go
@@ -0,0 +1,21 @@
+package console
+
+import (
+ "net/http"
+ "net/url"
+)
+
+// appRedirect answers a retired app page with a 303 to sub under the same
+// app (sub starts with "/"). It runs accountApp first, so the session and
+// membership gates answer exactly as on the page itself: a non-member gets
+// the same 404 an unknown account gets, never a redirect that would confirm
+// the app exists. No flash; the query string is dropped.
+func (s *Server) appRedirect(sub string) http.HandlerFunc {
+ return func(w http.ResponseWriter, r *http.Request) {
+ _, _, acct, _, app, ok := s.accountApp(w, r)
+ if !ok {
+ return
+ }
+ http.Redirect(w, r, "/a/"+url.PathEscape(acct.Sqid)+"/apps/"+url.PathEscape(app)+sub, http.StatusSeeOther)
+ }
+}
diff --git a/internal/console/approved_nav_copy_test.go b/internal/console/approved_nav_copy_test.go
index bb150c771..f968fe07e 100644
--- a/internal/console/approved_nav_copy_test.go
+++ b/internal/console/approved_nav_copy_test.go
@@ -24,6 +24,11 @@ const navCopyDeckPath = "../../docs/superpowers/plans/2026-10-25-console-ux-nav-
// and any other row's named test must exist.
var navCopyBuilt = map[string]bool{
"NAV-C01": true, "NAV-C02": true, "NAV-C03": true, "NAV-C04": true,
+ "NAV-C21": true, "NAV-C22": true, "NAV-C23": true, "NAV-C24": true,
+ "NAV-C25": true, "NAV-C26": true, "NAV-C27": true, "NAV-C28": true,
+ "NAV-C29": true, "NAV-C30": true, "NAV-C31": true, "NAV-C32": true,
+ "NAV-C33": true, "NAV-C34": true, "NAV-C35": true, "NAV-C36": true,
+ "NAV-C37": true, "NAV-C38": true, "NAV-C39": true, "NAV-C45": true,
}
type navCopyRow struct{ ID, Where, Old, New, CheckedBy, Status string }
diff --git a/internal/console/claim_invariant_fixtures_test.go b/internal/console/claim_invariant_fixtures_test.go
index 9c4f7c347..ac44f0d3e 100644
--- a/internal/console/claim_invariant_fixtures_test.go
+++ b/internal/console/claim_invariant_fixtures_test.go
@@ -790,7 +790,7 @@ var claimFixtures = map[string]claimFixture{
"route GET /a/{sqid}/apps/{app}/activity": claimRead("renders the app's audit trail"),
"route GET /a/{sqid}/apps/{app}/analytics": claimRead("renders analytics read from the bucket"),
"route GET /a/{sqid}/apps/{app}/availability": claimRead("renders edge availability counts"),
- "route GET /a/{sqid}/apps/{app}/deployments": claimRead("renders deployments (the releases page)"),
+ "route GET /a/{sqid}/apps/{app}/deployments": claimRead("redirects to the releases page"),
"route GET /a/{sqid}/apps/{app}/errors": claimRead("renders grouped app errors"),
"route GET /a/{sqid}/apps/{app}/instances": claimRead("renders the app's instance records"),
"route GET /a/{sqid}/apps/{app}/instances/{host}": claimRead("renders one instance and polls its report over HTTP"),
diff --git a/internal/console/claim_invariant_probes_read_test.go b/internal/console/claim_invariant_probes_read_test.go
index 5fe4d042e..2f2ff20a1 100644
--- a/internal/console/claim_invariant_probes_read_test.go
+++ b/internal/console/claim_invariant_probes_read_test.go
@@ -133,7 +133,7 @@ var claimReadProbes = map[string]claimProbe{
"route GET /a/{sqid}/apps/{app}/activity": claimPageRead(nil, "/a/bab/apps/kass/activity", "kass"),
"route GET /a/{sqid}/apps/{app}/analytics": claimPageRead(nil, "/a/bab/apps/titogo/analytics", "titogo"),
"route GET /a/{sqid}/apps/{app}/availability": claimPageRead(nil, "/a/bab/apps/titogo/availability", "titogo"),
- "route GET /a/{sqid}/apps/{app}/deployments": claimPageRead(nil, "/a/bab/apps/kass/deployments", "v1"),
+ "route GET /a/{sqid}/apps/{app}/deployments": claimRedirectRead("/a/bab/apps/kass/deployments", http.StatusSeeOther, "/a/bab/apps/kass/releases"),
"route GET /a/{sqid}/apps/{app}/errors": claimPageRead(nil, "/a/bab/apps/titogo/errors", "titogo"),
"route GET /a/{sqid}/apps/{app}/instances": claimPageRead(nil, "/a/bab/apps/kass/instances", "kass.carlosapp.dev"),
"route GET /a/{sqid}/apps/{app}/instances/{host}": claimPageRead(nil, "/a/bab/apps/kass/instances/kass.carlosapp.dev", "kass.carlosapp.dev"),
diff --git a/internal/console/deployments.go b/internal/console/deployments.go
index 6621d2472..19f089ce7 100644
--- a/internal/console/deployments.go
+++ b/internal/console/deployments.go
@@ -3,6 +3,7 @@ package console
import (
"net/http"
"sort"
+ "strconv"
)
type deploymentTarget struct {
@@ -18,16 +19,14 @@ type deploymentObservedVersion struct {
Version string
Count int
}
-type deploymentsCopyStrings struct{ Title, History, NoTarget, Instances, Target, Observed, NoChannels string }
+type deploymentsCopyStrings struct{ Title, NoTarget, Target, Observed, NoChannels string }
var deploymentsCopy = deploymentsCopyStrings{
Title: "Releases",
- History: "Release history",
- NoTarget: "No target published",
- Instances: "View instances",
- Target: "Target version",
- Observed: "Observed versions",
- NoChannels: "Open Release history for the commands to publish your first version.",
+ NoTarget: "Nothing published yet",
+ Target: "Should run",
+ Observed: "Running",
+ NoChannels: "Nothing is live yet. Ship your first version with the commands under Versions.",
}
func (p page) DeploymentsCopy() deploymentsCopyStrings { return deploymentsCopy }
@@ -81,12 +80,51 @@ func assembleDeploymentTargets(view *AppView, account string) []deploymentTarget
return out
}
+// liveNowTargets is the Releases page's Live now rows. A one-channel app
+// shows only the channel its pipeline declares: canary/* has its own fold,
+// and the page names no other channel.
+func liveNowTargets(view *AppView, targets []deploymentTarget) []deploymentTarget {
+ if !view.OneChannelPipeline() {
+ return targets
+ }
+ declared := make(map[string]bool, len(view.Pipeline.Channels))
+ for _, c := range view.Pipeline.Channels {
+ declared[c.Name] = true
+ }
+ var out []deploymentTarget
+ for _, t := range targets {
+ if declared[t.Channel] {
+ out = append(out, t)
+ }
+ }
+ return out
+}
+
+// maxVersionsPage bounds ?page= on the Releases tab.
+const maxVersionsPage = 1000
+
+// versionsPageParam is the Releases tab's ?page=: an integer in [1,
+// maxVersionsPage], and 1 for anything else.
+func versionsPageParam(r *http.Request) int {
+ n, err := strconv.Atoi(r.URL.Query().Get("page"))
+ if err != nil || n < 1 || n > maxVersionsPage {
+ return 1
+ }
+ return n
+}
+
+// VersionsNewerPage and VersionsOlderPage are the Versions pager's targets
+// on either side of the page shown.
+func (p page) VersionsNewerPage() int { return p.VersionsPageNum - 1 }
+func (p page) VersionsOlderPage() int { return p.VersionsPageNum + 1 }
+
+// releaseBackTab is where a release mutation's redirect lands: the Releases
+// tab, or "" for the Overview. "deployments" is the retired tab's value, kept
+// so a form rendered before the redirect landed still comes back here.
func releaseBackTab(r *http.Request) string {
switch r.FormValue("back") {
- case "releases":
+ case "releases", "deployments":
return "releases"
- case "deployments":
- return "deployments"
}
return ""
}
diff --git a/internal/console/deployments_test.go b/internal/console/deployments_test.go
index 1a9d60143..121098d73 100644
--- a/internal/console/deployments_test.go
+++ b/internal/console/deployments_test.go
@@ -1,11 +1,18 @@
package console
import (
+ "context"
+ "fmt"
+ "net/http"
"net/http/httptest"
"net/url"
"reflect"
+ "regexp"
"strings"
"testing"
+ "time"
+
+ "github.com/carlosframework/platform/internal/release"
)
func TestDeploymentTargetsKeepObservationSeparate(t *testing.T) {
@@ -38,20 +45,15 @@ func TestDeploymentTargetsKeepObservationSeparate(t *testing.T) {
func TestDeploymentRoutesAndHistory(t *testing.T) {
fx := newConsoleFixture(t)
c := signInPaul(t, fx)
- status, _, body := get(t, c, fx.u("/apps/kass/deployments"))
+ status, _, body := get(t, c, fx.u("/apps/kass/releases"))
if status != 200 {
- t.Fatalf("deployments status = %d", status)
+ t.Fatalf("releases status = %d", status)
}
- for _, want := range []string{`/apps/kass/releases#version-v1`, `/apps/kass/instances?channel=stable`} {
+ for _, want := range []string{`/apps/kass/releases#version-v1`, `/apps/kass/instances?channel=stable`, `id="version-v1"`} {
if !strings.Contains(body, want) {
- t.Errorf("deployments missing %q", want)
+ t.Errorf("releases missing %q", want)
}
}
- _, _, history := get(t, c, fx.u("/apps/kass/releases"))
- if !strings.Contains(history, `id="version-v1"`) {
- t.Error("history has no target version anchor")
- }
- assertNonMember404(t, fx, "/apps/kass/deployments")
}
func TestReleaseBackTabOnlyAcceptsLocalDestinations(t *testing.T) {
@@ -60,7 +62,7 @@ func TestReleaseBackTabOnlyAcceptsLocalDestinations(t *testing.T) {
r.Header.Set("Content-Type", "application/x-www-form-urlencoded")
want := ""
if value == "releases" || value == "deployments" {
- want = value
+ want = "releases"
}
if got := releaseBackTab(r); got != want {
t.Errorf("back %q = %q, want %q", value, got, want)
@@ -68,16 +70,235 @@ func TestReleaseBackTabOnlyAcceptsLocalDestinations(t *testing.T) {
}
}
-func TestDeploymentsDoNotDependOnReleaseListing(t *testing.T) {
+// navPath is a path as the page's links write it: under the account's
+// name (Nav), where fx.path writes the sqid (Base).
+func navPath(p string) string { return "/a/ops" + p }
+
+// releasesPageFixture is the Releases page's full shape: beta ahead of
+// stable (so What's next has a candidate), stable with a history (so Live
+// now has its one Roll back), the fixture's canary, and a tag.
+func releasesPageFixture(t *testing.T) *consoleFixture {
+ t.Helper()
+ fx := newConsoleFixture(t)
+ ctx := context.Background()
+ shipVersion(t, fx, "kass", "v3")
+ seedChannel(t, fx, "kass", "beta", "v3")
+ seedChannel(t, fx, "kass", "stable", "v2")
+ if err := release.Ship(ctx, fx.rel, release.OpsAccount, release.Manifest{
+ Schema: 1, App: "kass", Version: "0.5.0-1", Kind: "binary", BuiltAt: "2026-08-08T10:00:00Z",
+ Artifacts: map[string]release.Artifact{"linux-amd64": {File: "kass"}},
+ }, map[string][]byte{"linux-amd64": []byte("bin")}); err != nil {
+ t.Fatal(err)
+ }
+ if _, _, err := release.EnsureTag(ctx, fx.rel, release.OpsAccount, "kass", "0.5.0-1", "paul@keymail.dev", time.Now()); err != nil {
+ t.Fatal(err)
+ }
+ return fx
+}
+
+// section cuts the page from the from marker to the to marker.
+func section(t *testing.T, body, from, to string) string {
+ t.Helper()
+ _, rest, ok := strings.Cut(body, from)
+ if !ok {
+ t.Fatalf("page has no %q", from)
+ }
+ out, _, ok := strings.Cut(rest, to)
+ if !ok {
+ t.Fatalf("page has no %q after %q", to, from)
+ }
+ return out
+}
+
+func TestReleasesPageOrder(t *testing.T) {
+ fx := releasesPageFixture(t)
+ c := signInPaul(t, fx)
+ status, _, body := get(t, c, fx.u("/apps/kass/releases"))
+ if status != http.StatusOK {
+ t.Fatalf("releases = %d", status)
+ }
+ last := -1
+ for _, id := range []string{`id="whats-next"`, `id="live-now"`, `id="versions"`, `id="channels-ladder"`, `id="canaries"`, `id="tags"`} {
+ i := strings.Index(body, id)
+ if i < 0 {
+ t.Fatalf("page has no %s", id)
+ }
+ if i <= last {
+ t.Errorf("%s is out of order", id)
+ }
+ last = i
+ }
+ for _, fold := range []string{`<details class="reveal" id="channels-ladder">`, `<details class="reveal" id="canaries">`, `<details class="reveal" id="tags">`} {
+ if !strings.Contains(body, fold) {
+ t.Errorf("page has no closed fold %s", fold)
+ }
+ }
+ live := section(t, body, `id="live-now"`, `id="versions"`)
+ for _, want := range []string{
+ "<th scope=\"col\">Should run</th>", "<th scope=\"col\">Running</th>",
+ `href="` + navPath("/apps/kass/instances?channel=stable") + `"`,
+ } {
+ if !strings.Contains(live, want) {
+ t.Errorf("Live now missing %q:\n%s", want, live)
+ }
+ }
+ if strings.Contains(live, "View instances") {
+ t.Error("Live now still says View instances")
+ }
+}
+
+func TestReleasesPageHasOneRollBack(t *testing.T) {
+ fx := releasesPageFixture(t)
+ c := signInPaul(t, fx)
+ _, _, body := get(t, c, fx.u("/apps/kass/releases"))
+ _, main, _ := strings.Cut(body, "<main>")
+ if n := strings.Count(main, ">Roll back</button>"); n != 1 {
+ t.Fatalf("%d Roll back buttons, want 1", n)
+ }
+ at := strings.Index(main, ">Roll back</button>")
+ if live, versions := strings.Index(main, `id="live-now"`), strings.Index(main, `id="versions"`); at < live || at > versions {
+ t.Errorf("the Roll back sits at %d, outside Live now (%d to %d)", at, live, versions)
+ }
+ if n := strings.Count(main, `/rollback"`); n != 1 {
+ t.Fatalf("%d rollback forms, want 1", n)
+ }
+ form := section(t, main, `/rollback"`, "</form>")
+ if !strings.Contains(form, `name="back" value="releases"`) {
+ t.Errorf("the rollback form does not come back to releases:\n%s", form)
+ }
+}
+
+func TestDeploymentsRedirectsToReleases(t *testing.T) {
+ fx := newConsoleFixture(t)
+ c := signInPaul(t, fx)
+ status, loc, _ := get(t, c, fx.u("/apps/kass/deployments?x=1"))
+ if status != http.StatusSeeOther || loc != fx.path("/apps/kass/releases") {
+ t.Fatalf("deployments = %d %q, want 303 to %q", status, loc, fx.path("/apps/kass/releases"))
+ }
+ assertNonMember404(t, fx, "/apps/kass/deployments")
+}
+
+// TestReleasesLiveNowSurvivesListingFailure: Live now reads only the app
+// view, so a failed version listing costs the Versions part and nothing
+// else.
+func TestReleasesLiveNowSurvivesListingFailure(t *testing.T) {
fx := newConsoleFixture(t)
c := signInPaul(t, fx)
fx.srv.cfg.Releases = listFailStore{fx.rel}
- status, _, body := get(t, c, fx.u("/apps/kass/deployments"))
- if status != 200 || strings.Contains(body, "Could not list this app") {
- t.Fatalf("deployments depended on release listing: status %d, body %s", status, body)
+ status, _, body := get(t, c, fx.u("/apps/kass/releases"))
+ if status != http.StatusOK {
+ t.Fatalf("releases = %d", status)
+ }
+ for _, want := range []string{"Could not list this app", `id="live-now"`, `/apps/kass/instances?channel=stable`} {
+ if !strings.Contains(body, want) {
+ t.Errorf("releases missing %q", want)
+ }
+ }
+}
+
+var versionRowRE = regexp.MustCompile(`<tr id="version-([^"]+)"`)
+
+func versionRows(body string) []string {
+ var out []string
+ for _, m := range versionRowRE.FindAllStringSubmatch(body, -1) {
+ out = append(out, m[1])
+ }
+ return out
+}
+
+func TestReleasesOlderVersionsAreReachable(t *testing.T) {
+ fx := newConsoleFixture(t)
+ c := signInPaul(t, fx)
+ _, _, body := get(t, c, fx.u("/apps/kass/releases"))
+ if strings.Contains(body, `rel="next"`) {
+ t.Fatal("two versions, yet page 1 links an older page")
+ }
+
+ shipped := map[string]bool{"v1": true, "v2": true}
+ for i := 10; i <= 30; i++ {
+ v := fmt.Sprintf("v%d", i)
+ shipVersion(t, fx, "kass", v)
+ shipped[v] = true
+ }
+ _, _, page1 := get(t, c, fx.u("/apps/kass/releases"))
+ rows1 := versionRows(page1)
+ if len(rows1) != 20 {
+ t.Fatalf("page 1 has %d version rows, want 20", len(rows1))
+ }
+ next := regexp.MustCompile(`<a href="([^"]*)" rel="next">Older versions</a>`).FindStringSubmatch(page1)
+ if next == nil || !strings.HasSuffix(next[1], "/releases?page=2#versions") {
+ t.Fatalf("page 1 has no Older versions link to page 2: %v", next)
+ }
+
+ status, _, page2 := get(t, c, fx.u("/apps/kass/releases?page=2"))
+ if status != http.StatusOK {
+ t.Fatalf("page 2 = %d", status)
+ }
+ rows2 := versionRows(page2)
+ if len(rows2) != 3 {
+ t.Fatalf("page 2 has %d version rows, want 3", len(rows2))
+ }
+ if !regexp.MustCompile(`<a href="[^"]*/releases#versions" rel="prev">Newer versions</a>`).MatchString(page2) {
+ t.Error("page 2 has no Newer versions link back to page 1")
+ }
+ if strings.Contains(page2, `rel="next"`) {
+ t.Error("page 2 is the last, yet links an older page")
+ }
+ seen := map[string]bool{}
+ for _, v := range append(rows1, rows2...) {
+ if seen[v] {
+ t.Errorf("%s is on both pages", v)
+ }
+ seen[v] = true
+ }
+ if !reflect.DeepEqual(seen, shipped) {
+ t.Errorf("pages 1 and 2 show %v, want every shipped version %v", seen, shipped)
+ }
+
+ status, _, page3 := get(t, c, fx.u("/apps/kass/releases?page=3"))
+ if status != http.StatusOK || len(versionRows(page3)) != 0 || !strings.Contains(page3, "No versions on this page.") {
+ t.Errorf("page 3 = %d with %d rows; want 200, none and the empty-page note", status, len(versionRows(page3)))
+ }
+ if !strings.Contains(page3, `rel="prev">Newer versions</a>`) {
+ t.Error("page 3 has no Newer versions link")
+ }
+
+ for _, q := range []string{"0", "-1", "x", "1001"} {
+ _, _, b := get(t, c, fx.u("/apps/kass/releases?page="+q))
+ if got := versionRows(b); !reflect.DeepEqual(got, rows1) {
+ t.Errorf("?page=%s shows %v, want page 1's %v", q, got, rows1)
+ }
+ }
+}
+
+// TestNoLinkPointsAtDeployments: no tab links the retired /deployments
+// path, and the Overview tile names the Releases tab.
+func TestNoLinkPointsAtDeployments(t *testing.T) {
+ fx := newConsoleFixture(t)
+ c := signInPaul(t, fx)
+ for _, tab := range []string{"", "/instances", "/releases", "/logs", "/errors", "/availability", "/analytics", "/activity", "/settings"} {
+ status, _, body := get(t, c, fx.u("/apps/kass"+tab))
+ if status != http.StatusOK {
+ t.Errorf("GET %s = %d", tab, status)
+ }
+ if strings.Contains(body, `/deployments"`) {
+ t.Errorf("/apps/kass%s links /deployments", tab)
+ }
+ }
+ _, _, overview := get(t, c, fx.u("/apps/kass"))
+ tile := section(t, overview, `<a class="tile" href="`+navPath("/apps/kass/releases")+`">`, "</a>")
+ if !strings.Contains(tile, "<h2>Releases</h2>") {
+ t.Errorf("the Releases tile is not headed Releases:\n%s", tile)
+ }
+}
+
+func TestLiveNowTargetsHidesUndeclaredChannelsOnOneChannelApps(t *testing.T) {
+ targets := []deploymentTarget{{Channel: "canary/rc1"}, {Channel: "edge"}}
+ one := &AppView{Pipeline: &release.Pipeline{Channels: []release.PipelineChannel{{Name: "edge"}}}}
+ if got := liveNowTargets(one, targets); !reflect.DeepEqual(got, []deploymentTarget{{Channel: "edge"}}) {
+ t.Errorf("one-channel app keeps %v, want edge only", got)
}
- _, _, history := get(t, c, fx.u("/apps/kass/releases"))
- if !strings.Contains(history, "Could not list this app") {
- t.Fatal("fixture did not fail the release listing")
+ if got := liveNowTargets(&AppView{}, targets); !reflect.DeepEqual(got, targets) {
+ t.Errorf("no pipeline keeps %v, want both", got)
}
}
diff --git a/internal/console/navsnapshot_test.go b/internal/console/navsnapshot_test.go
index 90a5e6b09..bd81234c2 100644
--- a/internal/console/navsnapshot_test.go
+++ b/internal/console/navsnapshot_test.go
@@ -31,4 +31,10 @@ func TestNavSnapshots(t *testing.T) {
t.Fatal(err)
}
}
+ // The Releases page in full: a candidate, a Roll back and a tag.
+ full := releasesPageFixture(t)
+ _, _, body := get(t, signInPaul(t, full), full.u("/apps/kass/releases"))
+ if err := os.WriteFile(filepath.Join(dir, "releases-full.html"), []byte(body), 0o644); err != nil {
+ t.Fatal(err)
+ }
}
diff --git a/internal/console/perfwalk_test.go b/internal/console/perfwalk_test.go
index c3ddb16bb..bb9477fad 100644
--- a/internal/console/perfwalk_test.go
+++ b/internal/console/perfwalk_test.go
@@ -416,10 +416,17 @@ func perfTargets(fx *consoleFixture) map[string][]perfTarget {
"GET /a/{sqid}/apps/{app}": ok(app),
"GET /a/{sqid}/apps/{app}/instances/{host}": ok(app + "/instances/kass.carlosapp.dev"),
}
- for _, tab := range []string{"account-review", "activity", "analytics", "availability", "deployments", "errors",
- "instances", "logs", "logs/data", "pipeline", "releases", "settings"} {
+ for _, tab := range []string{"account-review", "activity", "analytics", "availability", "errors",
+ "instances", "logs", "logs/data", "pipeline", "settings"} {
m["GET /a/{sqid}/apps/{app}/"+tab] = ok(app + "/" + tab)
}
+ // /deployments is a 303 to Releases; the fixture's page 2 of Versions is
+ // the empty-page state, which still runs the listing.
+ m["GET /a/{sqid}/apps/{app}/deployments"] = []perfTarget{{Path: app + "/deployments", Expect: http.StatusSeeOther}}
+ m["GET /a/{sqid}/apps/{app}/releases"] = []perfTarget{
+ {Path: app + "/releases", Expect: http.StatusOK},
+ {Path: app + "/releases?page=2", Expect: http.StatusOK},
+ }
var sections []string
for s := range appSettingsSections {
sections = append(sections, s)
@@ -833,7 +840,7 @@ func TestPerfSessionS3Requests(t *testing.T) {
return resp.StatusCode, string(body)
})
}
- for _, tab := range []string{"", "/instances", "/deployments", "/releases", "/logs", "/errors", "/availability", "/analytics", "/activity"} {
+ for _, tab := range []string{"", "/instances", "/releases", "/logs", "/errors", "/availability", "/analytics", "/activity"} {
for range 2 {
page := view(app + tab)
if tab == "/logs" {
diff --git a/internal/console/pipelinepage_test.go b/internal/console/pipelinepage_test.go
index f6d27c264..d1e693a2b 100644
--- a/internal/console/pipelinepage_test.go
+++ b/internal/console/pipelinepage_test.go
@@ -39,7 +39,7 @@ func TestOneChannelAppHidesChannelVocabulary(t *testing.T) {
if !strings.Contains(body, "Nothing shipped yet") {
t.Errorf("one-channel app page does not show the releases list:\n%s", body)
}
- if !strings.Contains(body, `aria-label="Release status"`) {
+ if !strings.Contains(body, `id="live-now"`) {
t.Errorf("one-channel app page does not show the deployment summary:\n%s", body)
}
@@ -167,6 +167,9 @@ func TestOneChannelAppKeepsCanariesAndRollback(t *testing.T) {
if !strings.Contains(main, "Roll back") {
t.Errorf("one-channel app page has no rollback button:\n%s", main)
}
+ if n := strings.Count(main, ">Roll back</button>"); n != 1 {
+ t.Errorf("one-channel app page has %d Roll back buttons, want 1:\n%s", n, main)
+ }
// And still none of the vocabulary the one-channel rule hides: no ladder
// rungs, no promote form, no channel column. Checked on what the page
// SHOWS (visibleText), the same projection assertNoChannelVocabulary
diff --git a/internal/console/server.go b/internal/console/server.go
index 02a97ab6b..6cc35ed9b 100644
--- a/internal/console/server.go
+++ b/internal/console/server.go
@@ -1582,7 +1582,9 @@ func NewServer(cfg Config, st *Store) (*Server, error) {
s.registerRoute("POST /a/{sqid}/apps/new/region", s.handleNewAppRegion)
s.registerRoute("GET /a/{sqid}/apps/{app}", s.handleApp)
s.registerRoute("GET /a/{sqid}/apps/{app}/releases", s.handleAppReleases)
- s.registerRoute("GET /a/{sqid}/apps/{app}/deployments", s.handleAppReleases)
+ // The retired Deployments tab: Live now on the Releases page took its
+ // table. accountApp's gates run before the 303.
+ s.registerRoute("GET /a/{sqid}/apps/{app}/deployments", s.appRedirect("/releases"))
s.registerRoute("GET /a/{sqid}/apps/{app}/account-review", s.handleAppAccountReview)
s.registerRoute("GET /a/{sqid}/apps/{app}/instances", s.handleAppInstances)
s.registerRoute("GET /a/{sqid}/apps/{app}/instances/{host}", s.handleAppInstance)
@@ -1989,6 +1991,10 @@ type page struct {
Versions []VersionView // app page: shipped releases, newest first
Tags []release.Tag // releases tab: every tag this app has cut, changelog and all
RetentionKeep int // releases tab: >0 when an ambient retention policy is set (spec 2026-08-10-releases-retention-design.md §7)
+ // VersionsPageNum is the Releases tab's page of Versions (1-based), and
+ // VersionsMore reports an older page after it.
+ VersionsPageNum int
+ VersionsMore bool
// ReleaseSummary is the Releases tab's lede strip: what is live and
// what is next, folded from Detail.Channels once the tab has them.
ReleaseSummary ReleaseSummary
@@ -3754,33 +3760,46 @@ func (s *Server) handleApp(w http.ResponseWriter, r *http.Request) {
// Activity tab has the room this strip never will.
const overviewActivityCap = 5
-// handleAppReleases is the deploy surface: every shipped release, the
-// channels they promote onto, and the canaries riding ahead.
+// handleAppReleases is the deploy surface, one page: What's next (the
+// candidate), Live now (one row per channel, with the page's only Roll
+// back), Versions (paged by ?page=), then folds for the channels and the
+// ladder, canaries and tags.
+//
+// Its data, in one place for perf plan 2's cache. From appPage's p.Detail:
+// Channels (Live now targets, What's next, the Channels fold, promote
+// options), Routes (Live now's running versions and instance counts),
+// Pipeline and OneChannelPipeline (Live now's columns and rows, the folds),
+// Canaries (the Canaries fold) and Production (the ladder). Read here, per
+// request: PendingChangesForContext and pendingPipeline (the pending card),
+// VersionsPage (Versions), release.ListTags (tag pills and the Tags fold),
+// release.GetRetention (the retention line) and attachHint (the canary
+// form's copy). Live now reads only p.Detail, so a failed version listing
+// costs the Versions part and nothing else; Versions reads only VersionsPage
+// and ListTags. Every page costs one release listing and at most
+// versionsCap manifest reads.
func (s *Server) handleAppReleases(w http.ResponseWriter, r *http.Request) {
p, acct, ok := s.appPage(w, r, "releases")
if !ok {
return
}
- if strings.HasSuffix(r.URL.Path, "/deployments") {
- p.DeploymentTargets = assembleDeploymentTargets(p.Detail, acct.Sqid)
- end := perf.Span(r, "db")
- pcs, err := s.store.PendingChangesForContext(r.Context(), acct.ID, p.AppName, time.Now())
- end()
- if err != nil {
- log.Printf("console: pending changes %s/%s: %v", acct.Sqid, p.AppName, err)
- } else if len(pcs) > 0 {
- p.Pending = s.pendingChangeViews(pcs, s.pendingPipeline(r.Context(), acct, p.AppName))
- }
- s.render(w, http.StatusOK, "app_deployments", p)
- return
+ p.DeploymentTargets = liveNowTargets(p.Detail, assembleDeploymentTargets(p.Detail, acct.Sqid))
+ end := perf.Span(r, "db")
+ pcs, err := s.store.PendingChangesForContext(r.Context(), acct.ID, p.AppName, time.Now())
+ end()
+ if err != nil {
+ log.Printf("console: pending changes %s/%s: %v", acct.Sqid, p.AppName, err)
+ } else if len(pcs) > 0 {
+ p.Pending = s.pendingChangeViews(pcs, s.pendingPipeline(r.Context(), acct, p.AppName))
}
p.ReleaseSummary = assembleReleaseSummary(p.Detail.Channels, p.Detail.Routes, acct.Sqid)
p.PromoteChannels = promoteChannelOptions(p.Detail.Channels, p.Detail.Pipeline)
- versions, err := Versions(r.Context(), s.cfg.Releases, acct.Sqid, p.AppName)
+ p.VersionsPageNum = versionsPageParam(r)
+ versions, more, err := VersionsPage(r.Context(), s.cfg.Releases, acct.Sqid, p.AppName, p.VersionsPageNum)
if err != nil {
log.Printf("console: versions %s: %v", p.AppName, err)
p.FlashErr = "Could not list this app's releases."
}
+ p.VersionsMore = more
// Versions itself never reads ListTags (view.go), and neither does
// assembleChannels any more — a full tag sweep thrown away by every
// OTHER app-page tab and the account home page's whole app list would
@@ -4140,7 +4159,7 @@ func (s *Server) handleAppActivity(w http.ResponseWriter, r *http.Request) {
events[i].TargetURL = p.Nav + "/apps/" + url.PathEscape(p.AppName) + "/releases#version-" + url.QueryEscape(events[i].Target)
}
if events[i].TargetType == "channel" && events[i].Target != "" {
- events[i].TargetURL = p.Nav + "/apps/" + url.PathEscape(p.AppName) + "/deployments"
+ events[i].TargetURL = p.Nav + "/apps/" + url.PathEscape(p.AppName) + "/releases"
}
if events[i].TargetType == "instance" && instances[events[i].Target] {
events[i].TargetURL = p.Nav + "/apps/" + url.PathEscape(p.AppName) +
diff --git a/internal/console/server_test.go b/internal/console/server_test.go
index 02d987a3e..3da825bf6 100644
--- a/internal/console/server_test.go
+++ b/internal/console/server_test.go
@@ -603,7 +603,7 @@ func TestReleasesTab(t *testing.T) {
}
for _, want := range []string{
`/apps/kass/releases" aria-current="page">`,
- "<h2>Channels</h2>", "<h2>Canaries</h2>", "All versions (",
+ "<h2>Channels</h2>", "<h2>Canaries</h2>", "<h2>Versions</h2>",
} {
if !strings.Contains(body, want) {
t.Fatalf("releases tab missing %q", want)
diff --git a/internal/console/statuscopy_test.go b/internal/console/statuscopy_test.go
index eaa0321ee..8142042d0 100644
--- a/internal/console/statuscopy_test.go
+++ b/internal/console/statuscopy_test.go
@@ -63,7 +63,9 @@ func TestStaticOnlyPagesDoNotClaimAMissingVersionReport(t *testing.T) {
t.Fatal(err)
}
body := out.String()
- if !strings.Contains(body, "<p>—</p>") || strings.Contains(body, approvedStatusCopy.NoInstances) || strings.Contains(body, approvedStatusCopy.NoVersion) {
+ // Releases dropped its observed-deployment summary (Live now shows
+ // the same per channel), so it only must not claim a missing report.
+ if (name == "app_overview" && !strings.Contains(body, "<p>—</p>")) || strings.Contains(body, approvedStatusCopy.NoInstances) || strings.Contains(body, approvedStatusCopy.NoVersion) {
t.Errorf("%s rendered the wrong non-reportable state", name)
}
}
diff --git a/internal/console/templates/app_deployments.html b/internal/console/templates/app_deployments.html
deleted file mode 100644
index 4890c6709..000000000
--- a/internal/console/templates/app_deployments.html
+++ /dev/null
@@ -1,31 +0,0 @@
-{{define "app_deployments"}}{{template "top" .}}
-{{if .Flash}}<p class="banner">{{.Flash}}</p>{{end}}
-{{if .FlashErr}}<p class="banner error">{{.FlashErr}}</p>{{end}}
-{{template "appnav" .}}
-{{template "accountreviewbanner" .}}
-<h2>{{.DeploymentsCopy.Title}}</h2>
-{{if .DeploymentTargets}}
-<div class="tablewrap">
-<table>
- <thead><tr><th scope="col">Channel</th><th scope="col">{{.DeploymentsCopy.Target}}</th><th scope="col">{{.DeploymentsCopy.Observed}}</th><th scope="col">Instances</th><th scope="col"></th></tr></thead>
- <tbody>
- {{range .DeploymentTargets}}
- <tr>
- <td><code>{{.Channel}}</code></td>
- <td>{{if .TargetErr}}Can't tell right now{{else if .Target}}<a href="{{$.Nav}}/apps/{{$.AppName}}/releases#version-{{.Target}}"><code>{{.Target}}</code></a>{{else}}{{$.DeploymentsCopy.NoTarget}}{{end}}</td>
- <td>{{range .Versions}}<div>{{.Count}} × <a href="{{$.Nav}}/apps/{{$.AppName}}/releases#version-{{.Version}}"><code>{{.Version}}</code></a></div>{{end}}{{if .Unknown}}<div>{{.Unknown}} × —</div>{{end}}{{if eq .Total 0}}—{{end}}</td>
- <td>{{.Total}} <a href="{{$.Nav}}/apps/{{$.AppName}}/instances?channel={{.Channel}}">{{$.DeploymentsCopy.Instances}}</a></td>
- <td>{{if and $.CanPromote .HasHistory (not .TargetErr) (or $.Detail.Pipeline $.IsOwner (ne .Channel "stable"))}}
- <form method="post" action="{{$.Base}}/apps/{{$.AppName}}/rollback">
- <input type="hidden" name="csrf" value="{{$.CSRF}}"><input type="hidden" name="channel" value="{{.Channel}}"><input type="hidden" name="back" value="deployments">
- <button type="submit" class="btn-sm btn-danger">Roll back</button>
- </form>
- {{end}}</td>
- </tr>
- {{end}}
- </tbody>
-</table>
-</div>
-{{else}}<p class="small">{{.DeploymentsCopy.NoChannels}}</p>{{end}}
-{{template "pending" .}}
-{{template "bottom" .}}{{end}}
diff --git a/internal/console/templates/app_overview.html b/internal/console/templates/app_overview.html
index f029121bb..9e54e588c 100644
--- a/internal/console/templates/app_overview.html
+++ b/internal/console/templates/app_overview.html
@@ -52,7 +52,7 @@
<p class="tile-detail">{{if eq .DomainTotal 0}}one appears after your first deploy{{else if .DomainAttention}}<span class="error">{{.DomainAttention}} need{{if eq .DomainAttention 1}}s{{end}} attention</span>{{else}}DNS &amp; certs OK{{end}}</p>
</a>
<a class="tile" href="{{$.Nav}}/apps/{{$.AppName}}/releases">
- <h2>{{$.DeploymentsCopy.History}}</h2>
+ <h2>{{$.DeploymentsCopy.Title}}</h2>
<p class="tile-value">{{.ReleaseCount}}{{if .ReleasesCapped}}+{{end}}</p>
<p class="tile-detail">{{if .LatestVersion}}latest <code>{{.LatestVersion}}</code>{{else}}nothing shipped yet{{end}}</p>
</a>
@@ -66,13 +66,13 @@
{{if not .Detail.Pipeline}}
{{with .Detail.Production}}
{{if .Err}}
-<p class="small error">Safety delay: this app's setting can't be read right now, so the delay stays on. Repair it on the <a href="{{$.Nav}}/apps/{{$.AppName}}/releases">{{$.DeploymentsCopy.History}}</a> tab.</p>
+<p class="small error">Safety delay: this app's setting can't be read right now, so the delay stays on. Repair it on the <a href="{{$.Nav}}/apps/{{$.AppName}}/releases">{{$.DeploymentsCopy.Title}}</a> tab.</p>
{{else if .On}}
-<p class="small">Safety delay: <strong>on</strong> — new versions wait before going live. Managed on <a href="{{$.Nav}}/apps/{{$.AppName}}/releases">{{$.DeploymentsCopy.History}}</a>.</p>
+<p class="small">Safety delay: <strong>on</strong>. New versions wait before going live. Managed on <a href="{{$.Nav}}/apps/{{$.AppName}}/releases">{{$.DeploymentsCopy.Title}}</a>.</p>
{{else if .TurningOff}}
<p class="small">Safety delay: <strong>turning off</strong> — in effect until ~{{fmtTime .EffectiveAt}}.</p>
{{else}}
-<p class="small">Safety delay: off — new versions go live as soon as they're promoted.{{if .Nudge}} {{icon "triangle-alert"}} This app looks like it's serving real users — consider turning it on, on <a href="{{$.Nav}}/apps/{{$.AppName}}/releases">{{$.DeploymentsCopy.History}}</a>.{{end}}</p>
+<p class="small">Safety delay: off. New versions go live when you make them live, without a delay.{{if .Nudge}} {{icon "triangle-alert"}} This app looks like it's serving real users. Consider turning it on from <a href="{{$.Nav}}/apps/{{$.AppName}}/releases">{{$.DeploymentsCopy.Title}}</a>.{{end}}</p>
{{end}}
{{end}}
{{end}}
diff --git a/internal/console/templates/app_releases.html b/internal/console/templates/app_releases.html
index 8feb655a2..d6b5daec1 100644
--- a/internal/console/templates/app_releases.html
+++ b/internal/console/templates/app_releases.html
@@ -2,24 +2,10 @@
{{if .Flash}}<p class="banner">{{.Flash}}</p>{{end}}
{{if .FlashErr}}<p class="banner error">{{.FlashErr}}</p>{{end}}
{{template "appnav" .}}
-<h2>{{.DeploymentsCopy.History}}</h2>
{{template "accountreviewbanner" .}}
-{{with .ReleaseSummary}}
-<section class="pagehead" aria-label="Release status">
- <h2>{{$.StatusCopy.ObservedLabel}}</h2>
- {{if not .Deployment.HasRoutes}}
- <p>{{$.StatusCopy.NoInstances}}</p>
- {{else if not .Deployment.HasReportable}}
- <p>—</p>
- {{else if not .Deployment.HasReportedVersion}}
- <p>{{$.StatusCopy.NoVersion}}</p>
- {{else}}
- <p>{{.Deployment.ReportingText}}</p>
- <ul>{{range .Deployment.Versions}}<li><code>{{.Version}}</code></li>{{end}}</ul>
- {{if .Deployment.UnknownCount}}<p>{{$.StatusCopy.Partial}}</p>{{end}}
- {{end}}
- {{if .NextVersion}}
+{{with .ReleaseSummary}}{{if .NextVersion}}<section class="banner" id="whats-next">
+ <h2>What's next</h2>
<p>{{.CandidateText}}</p>
{{if and $.CanPromote $.IsOwner}}
<form method="post" action="{{$.Base}}/apps/{{$.Detail.App}}/promote">
@@ -32,17 +18,50 @@
{{else if $.CanPromote}}
<p class="small">Only an account owner can make it live.</p>
{{end}}
- {{end}}
+</section>{{end}}{{end}}
+
+{{template "pending" .}}
+
+{{/* Live now: one row per channel, and the page's only Roll back. A
+ one-channel app gets no Channel column (liveNowTargets keeps its one
+ declared channel); the rollback form still names it in a hidden field,
+ the door's parameter rather than a word on the page. */}}
+<section id="live-now">
+<h2>Live now</h2>
+{{if .DeploymentTargets}}
+<div class="tablewrap">
+<table>
+ <thead><tr>{{if not .Detail.OneChannelPipeline}}<th scope="col">Channel</th>{{end}}<th scope="col">{{.DeploymentsCopy.Target}}</th><th scope="col">{{.DeploymentsCopy.Observed}}</th><th scope="col">Instances</th><th scope="col"></th></tr></thead>
+ <tbody>
+ {{range .DeploymentTargets}}
+ <tr>
+ {{if not $.Detail.OneChannelPipeline}}<td><code>{{.Channel}}</code></td>{{end}}
+ <td>{{if .TargetErr}}Can't tell right now{{else if .Target}}<a href="{{$.Nav}}/apps/{{$.AppName}}/releases#version-{{.Target}}"><code>{{.Target}}</code></a>{{else}}{{$.DeploymentsCopy.NoTarget}}{{end}}</td>
+ <td>{{range .Versions}}<div>{{.Count}} × <a href="{{$.Nav}}/apps/{{$.AppName}}/releases#version-{{.Version}}"><code>{{.Version}}</code></a></div>{{end}}{{if .Unknown}}<div>{{.Unknown}} × —</div>{{end}}{{if eq .Total 0}}—{{end}}</td>
+ <td><a href="{{$.Nav}}/apps/{{$.AppName}}/instances?channel={{.Channel}}">{{.Total}}</a></td>
+ <td>{{if and $.CanPromote .HasHistory (not .TargetErr) (or $.Detail.Pipeline $.IsOwner (ne .Channel "stable"))}}
+ <form method="post" action="{{$.Base}}/apps/{{$.AppName}}/rollback">
+ <input type="hidden" name="csrf" value="{{$.CSRF}}"><input type="hidden" name="channel" value="{{.Channel}}"><input type="hidden" name="back" value="releases">
+ <button type="submit" class="btn-sm btn-danger">Roll back</button>
+ </form>
+ {{end}}</td>
+ </tr>
+ {{end}}
+ </tbody>
+</table>
+</div>
+{{if .CanPromote}}<p class="small">Roll back puts the previous build back straight away and skips the safety delay. You confirm first and see which build it lands on.</p>{{end}}
+{{else}}<p class="small">{{.DeploymentsCopy.NoChannels}}</p>{{end}}
</section>
-{{end}}
+{{/* Versions: versionsCap rows a page, newest first; ?page= walks older
+ ones. What's next, Live now and the folds render the same on every page. */}}
+<section id="versions">
+<h2>Versions</h2>
{{if .RetentionKeep}}
<p class="small">Retention: the newest {{.RetentionKeep}} releases are kept; older releases not promoted, tagged, or recently shipped are pruned automatically.</p>
{{end}}
-
{{if .Versions}}
-<details class="reveal" open>
-<summary>All versions ({{len .Versions}})</summary>
<div class="tablewrap">
<table>
<tr><th>Version</th><th>Label</th><th>Kind</th><th>Built</th>{{if and .CanPromote (not .Detail.OneChannelPipeline)}}<th>Promote</th>{{end}}</tr>
@@ -73,31 +92,30 @@
{{end}}
</table>
</div>
-</details>
+{{else if gt .VersionsPageNum 1}}
+<p>No versions on this page.</p>
{{else}}
<p>Nothing shipped yet. Ship your first release from your repo:</p>
<pre><code>carlos ship --app {{.Detail.App}} --version $(git rev-parse --short HEAD) --target linux-arm64 &lt;binary&gt;
carlos ship --app {{.Detail.App}} --kind static --version v1 &lt;site-dir&gt;</code></pre>
<p class="small">Releases appear here once shipped, and get promoted to channels from this page.</p>
{{end}}
+{{if or .VersionsMore (gt .VersionsPageNum 1)}}<p class="small">
+{{if gt .VersionsPageNum 1}}<a href="{{.Nav}}/apps/{{.AppName}}/releases{{if gt .VersionsNewerPage 1}}?page={{.VersionsNewerPage}}{{end}}#versions" rel="prev">Newer versions</a>{{end}}
+{{if .VersionsMore}}<a href="{{.Nav}}/apps/{{.AppName}}/releases?page={{.VersionsOlderPage}}#versions" rel="next">Older versions</a>{{end}}
+</p>{{end}}
+</section>
-{{if .Detail.OneChannelPipeline}}
-<details class="reveal">
-<summary>Test versions and rolling back</summary>
-{{template "solorollback" .}}
-{{template "canaries" .}}
-{{template "apptags" .}}
-</details>
-{{else}}
-<details class="reveal">
-<summary>Release pipeline — channels, test versions, and the promotion ladder</summary>
+{{if not .Detail.OneChannelPipeline}}
+<details class="reveal" id="channels-ladder">
+<summary><h2>Channels and the promotion ladder</h2></summary>
{{template "ladder" .}}
<h2>Channels</h2>
{{if .Detail.Channels}}
<div class="tablewrap">
<table>
- <tr><th>Channel</th><th>Version</th><th>Promoted</th><th>Goes live</th><th></th></tr>
+ <tr><th>Channel</th><th>Version</th><th>Promoted</th><th>Goes live</th></tr>
{{range .Detail.Channels}}
<tr>
<td>{{.Name}}</td>
@@ -108,39 +126,29 @@ carlos ship --app {{.Detail.App}} --kind static --version v1 &lt;site-dir&gt;</c
<td><span title="{{fmtTime .PromotedAt}}">{{ago .PromotedAt}}</span></td>
<td>{{if .BakedUntil.IsZero}}live now{{else}}in {{until .BakedUntil}}{{end}}{{if .FastTrack}} · delay skipped{{end}}</td>
{{end}}
- <td>{{if and $.CanPromote .HasHistory (not .Err) (or $.Detail.Pipeline $.IsOwner (ne .Name "stable"))}}
- <form method="post" action="{{$.Base}}/apps/{{$.Detail.App}}/rollback">
- <input type="hidden" name="csrf" value="{{$.CSRF}}">
- <input type="hidden" name="channel" value="{{.Name}}">
- <input type="hidden" name="back" value="releases">
- <button type="submit" class="btn-sm btn-danger">Roll back</button>
- </form>
- {{end}}</td>
</tr>
{{end}}
</table>
</div>
<p class="small">Go-live times are estimates — each copy keeps its own clock. Rollbacks skip the delay.</p>
{{else}}<p class="small">No channels yet — ship a release, then promote it below to create the first one.</p>{{end}}
-
-{{template "canaries" .}}
-{{template "apptags" .}}
</details>
{{end}}
+{{template "canaries" .}}
+{{template "apptags" .}}
{{if .Detail.OneChannelPipeline}}
<p class="small">This app has one channel — <code>carlos deploy</code> ships straight to it, with no
-promotion step in between. <a href="{{.Nav}}/apps/{{.Detail.App}}/pipeline">Set up a pipeline</a> to
+promotion step in between. <a href="{{.Nav}}/apps/{{.Detail.App}}/settings/pipeline">Set up a pipeline</a> to
add more.</p>
{{end}}
{{if not .CanPromote}}<p class="small">Deploys are unavailable on this console — it has no signing key.</p>{{end}}
{{template "bottom" .}}{{end}}
{{/* The canary section and the tag list are NOT channel vocabulary, so both
- app shapes get them: canary/* lives outside the pipeline entirely and is
- always allowed (release pipelines v2 §2), and a tag names a release, not
- a rung. Shared through one definition so the two shapes cannot drift into
- different canary controls. */}}
-{{define "canaries"}}<h2>Canaries</h2>
+ app shapes get them, each in its own closed fold: canary/* lives outside
+ the pipeline entirely and is always allowed (release pipelines v2 §2),
+ and a tag names a release, not a rung. */}}
+{{define "canaries"}}<details class="reveal" id="canaries"><summary><h2>Canaries</h2></summary>
{{if .Detail.Canaries}}
<div class="tablewrap">
<table>
@@ -186,34 +194,15 @@ add more.</p>
{{else}}<pre><code>{{.AttachCmd}}</code></pre>
<p class="small">The address comes live within a couple of minutes.</p>
{{end}}
-{{end}}{{end}}
+{{end}}</details>{{end}}
{{define "apptags"}}{{if .Tags}}
-<h2>Tags</h2>
+<details class="reveal" id="tags"><summary><h2>Tags</h2></summary>
{{range .Tags}}
<details>
<summary><code>{{.Version}}</code> — <code>{{.Release}}</code>{{if .Actor}} · {{.Actor}}{{end}}</summary>
<pre class="changelog">{{.Changelog}}</pre>
</details>
{{end}}
+</details>
{{end}}{{end}}
-
-{{/* The one-channel app's rollback control. A rollback is not channel
- vocabulary — it is the pointer write that puts the previous build back,
- and a one-channel app is exactly the app with no promotion step to fall
- back on when a bad build lands. It names no channel on screen (the name
- rides in the hidden field the door needs), draws no table and offers no
- promote; the ladder stays hidden. RollbackChannels is empty until the
- channel actually has somewhere to go back to. */}}
-{{define "solorollback"}}{{if .CanPromote}}{{with .Detail.RollbackChannels}}
-<h2>Rolling back</h2>
-<p class="small">Puts the previous build back in front of everyone straight away — rollbacks skip the safety delay. You'll be asked to confirm, and told which build it lands on.</p>
-{{range .}}
-<form method="post" action="{{$.Base}}/apps/{{$.Detail.App}}/rollback">
- <input type="hidden" name="csrf" value="{{$.CSRF}}">
- <input type="hidden" name="channel" value="{{.Name}}">
- <input type="hidden" name="back" value="releases">
- <button type="submit" class="btn-sm btn-danger">Roll back</button>
-</form>
-{{end}}
-{{end}}{{end}}{{end}}
diff --git a/internal/console/templates/app_settings.html b/internal/console/templates/app_settings.html
index e2f3a8321..97a22592c 100644
--- a/internal/console/templates/app_settings.html
+++ b/internal/console/templates/app_settings.html
@@ -560,7 +560,7 @@ this same card.</p>
<strong class="restore-days">{{if .ExpiresAt.IsZero}}{{trashCooloffDays}}{{else}}{{temporaryCooloffDays}}{{end}} days</strong>
before the platform destroys its releases for good.{{if not .ExpiresAt.IsZero}} It is a temporary app, so its
window is shorter than usual.{{end}}{{if .Detail.Production.On}} It is marked as production right now, which
-blocks deletion — turn the safety delay off on the <a href="{{.Nav}}/apps/{{.AppName}}/releases">{{.DeploymentsCopy.History}}</a> tab first.{{end}}</p>
+blocks deletion. Turn the safety delay off on the <a href="{{.Nav}}/apps/{{.AppName}}/releases">{{.DeploymentsCopy.Title}}</a> tab first.{{end}}</p>
<form method="post" action="{{.Base}}/apps/{{.Detail.App}}/delete" class="settings-row">
<input type="hidden" name="csrf" value="{{.CSRF}}">
<label class="visually-hidden" for="delete-confirm">Type the app's name to confirm</label>
diff --git a/internal/console/templates/layout.html b/internal/console/templates/layout.html
index b9fecac85..04f12d4a9 100644
--- a/internal/console/templates/layout.html
+++ b/internal/console/templates/layout.html
@@ -531,6 +531,7 @@
/* Progressive-reveal sections: a page leads with the summary strip, and
the deeper tables/ladder sit behind an opt-in disclosure. */
.reveal > summary { font-size: 1.1rem; font-weight: 600; cursor: pointer; }
+ .reveal > summary h2 { display: inline; font-size: inherit; margin: 0; }
/* App tab bar (Heroku-style), and the account nav's active marker.
aria-current carries the state; the accent underline draws it. */
.tabs {
diff --git a/internal/console/testdata/perf-budgets.txt b/internal/console/testdata/perf-budgets.txt
index d547bf97b..0104ad93f 100644
--- a/internal/console/testdata/perf-budgets.txt
+++ b/internal/console/testdata/perf-budgets.txt
@@ -42,13 +42,12 @@ GET /a/{sqid}/apps/{app}/account-review over: the app-tab frame (7 S3 calls warm
GET /a/{sqid}/apps/{app}/activity over: the app-tab frame (7 S3 calls warm)
GET /a/{sqid}/apps/{app}/analytics over: the app-tab frame plus both telemetry settings and the analytics day listing and reads (11 S3 calls warm)
GET /a/{sqid}/apps/{app}/availability over: the app-tab frame plus both telemetry settings and three listings and a read each for the log and error chunks (17 S3 calls warm)
-GET /a/{sqid}/apps/{app}/deployments over: the app-tab frame plus a second pipeline read (8 S3 calls warm)
GET /a/{sqid}/apps/{app}/errors over: the app-tab frame plus both telemetry settings and three listings and a read each for the log and error chunks (17 S3 calls warm)
GET /a/{sqid}/apps/{app}/instances over: the app-tab frame plus instances.json, and every edges file and box report listed and read twice (24 S3 calls warm)
GET /a/{sqid}/apps/{app}/instances/{host} over: the app-tab frame plus the instance record, and the box reports and the fleet box reports listed and read three times (31 S3 calls warm)
GET /a/{sqid}/apps/{app}/logs over: the app-tab frame plus a listing and a read of every instance record and three listings for the log chunks (15 S3 calls warm)
GET /a/{sqid}/apps/{app}/pipeline over: the app-tab frame plus a second pipeline read (8 S3 calls warm)
-GET /a/{sqid}/apps/{app}/releases over: the app-tab frame plus the release and tag listings, every manifest, retention and instances.json (13 S3 calls warm, up to 21)
+GET /a/{sqid}/apps/{app}/releases over: the app-tab frame plus a second pipeline read for the pending card, the release and tag listings, at most 20 manifests, retention and instances.json (14 S3 calls warm; 12 on the fixture's empty page 2)
GET /a/{sqid}/apps/{app}/settings over: populateAppSettings builds every section: each environment and its store read twice, every instance record, the domain claims, cert-warm records, every box report and a listing of every key under the app (34 S3 calls warm)
GET /a/{sqid}/apps/{app}/settings/{section} over: every section is built whichever one is shown, as on the general section (34 S3 calls warm; the pipeline section 8)
GET /a/{sqid}/fleet over: reads status/fleet.json and lists and reads each customer fleet's box reports (3 S3 calls warm)
diff --git a/internal/console/view.go b/internal/console/view.go
index 029945dd5..dfdf89bfa 100644
--- a/internal/console/view.go
+++ b/internal/console/view.go
@@ -78,35 +78,6 @@ func (v AppView) OneChannelPipeline() bool {
return v.Pipeline != nil && len(v.Pipeline.Channels) == 1
}
-// RollbackChannels is the app's OWN declared channels that have somewhere to
-// roll back to — for the one-channel page, which hides the channel table the
-// rollback control normally rides in but must not hide the control itself: a
-// rollback is a pointer write, not channel vocabulary, and a one-channel app
-// is precisely the app with no promotion step to fall back on when a bad
-// build lands (spec §5 hides the VOCABULARY, not the actions).
-//
-// Declared channels only: canary/* is retired, never rolled back (its control
-// is the canary table's Retire button), and a channel the pipeline does not
-// name is not this app's to offer here. A row that failed to read, or has no
-// history, is left out — there is nothing to go back to.
-func (v AppView) RollbackChannels() []ChannelView {
- if v.Pipeline == nil {
- return nil
- }
- declared := make(map[string]bool, len(v.Pipeline.Channels))
- for _, c := range v.Pipeline.Channels {
- declared[c.Name] = true
- }
- var out []ChannelView
- for _, ch := range v.Channels {
- if ch.Err != "" || !ch.HasHistory || !declared[ch.Name] {
- continue
- }
- out = append(out, ch)
- }
- return out
-}
-
// MismatchedRoute is a viewer-safe account-review candidate assembled by the
// server after authorization. Assemble itself exposes owned routes only.
type MismatchedRoute struct{ Host, Account string }
@@ -936,18 +907,31 @@ const tagsCap = 20
// Versions lists an app's shipped releases — the distinct version dirs under
// apps/<app>/releases/ with each manifest's kind and build stamp — newest
// first by built_at (best effort: RFC3339 parses win, then version string),
-// capped at versionsCap. Unreadable manifests degrade to a row error.
-//
-// Manifests are read only for the versionsCap versions that will render:
-// release.VersionCandidates ranks the listing by manifest mod time when the
-// store carries stamps (both real stores do), and this fetches just the
-// survivors — fetch-then-sort made this page O(every version ever shipped)
-// in sequential bucket GETs, ~8s at tito's 318. A plain Store (test fakes
-// only) still yields every version, fetched and sorted exactly as before.
+// capped at versionsCap. Unreadable manifests degrade to a row error. It is
+// VersionsPage's first page, so Overview and the API show exactly what the
+// Releases tab's first page shows.
func Versions(ctx context.Context, s release.Store, acct, app string) ([]VersionView, error) {
- cands, _, err := release.VersionCandidates(ctx, s, acct, app, versionsCap)
+ views, _, err := VersionsPage(ctx, s, acct, app, 1)
+ return views, err
+}
+
+// VersionsPage is one page of Versions: page is 1-based, versionsCap rows a
+// page, and more reports an older page.
+//
+// Manifests are read only for the page's at most versionsCap versions:
+// release.VersionCandidatesPage ranks the listing by manifest mod time when
+// the store carries stamps (both real stores do), and this fetches just that
+// window, then sorts it by built_at — fetch-then-sort made this page O(every
+// version ever shipped) in sequential bucket GETs, ~8s at 318 versions. Every
+// page costs one listing plus at most versionsCap manifest GETs. A plain
+// Store (test fakes only) still yields every version, fetched and sorted
+// exactly as before, and the page is sliced from that.
+func VersionsPage(ctx context.Context, s release.Store, acct, app string, page int) (views []VersionView, more bool, err error) {
+ page = max(page, 1)
+ offset := (page - 1) * versionsCap
+ cands, more, ranked, err := release.VersionCandidatesPage(ctx, s, acct, app, offset, versionsCap)
if err != nil {
- return nil, err
+ return nil, false, err
}
var out []VersionView
for _, v := range cands {
@@ -969,8 +953,12 @@ func Versions(ctx context.Context, s release.Store, acct, app string) ([]Version
}
return out[i].Version > out[j].Version
})
- if len(out) > versionsCap {
- out = out[:versionsCap]
+ if !ranked {
+ // The unranked answer is every version: page the sorted whole.
+ out = out[min(offset, len(out)):]
+ if more = len(out) > versionsCap; more {
+ out = out[:versionsCap]
+ }
}
- return out, nil
+ return out, more, nil
}
diff --git a/internal/console/view_test.go b/internal/console/view_test.go
index 6fd15ede7..300c96234 100644
--- a/internal/console/view_test.go
+++ b/internal/console/view_test.go
@@ -6,6 +6,7 @@ import (
"fmt"
"os"
"path/filepath"
+ "reflect"
"strings"
"testing"
"time"
@@ -613,6 +614,24 @@ func TestVersionsEmptyApp(t *testing.T) {
}
}
+// TestVersionsPageMatchesVersionsOnPageOne: Versions is VersionsPage's
+// first page, so Overview and the API keep their exact output.
+func TestVersionsPageMatchesVersionsOnPageOne(t *testing.T) {
+ fx := newConsoleFixture(t)
+ ctx := context.Background()
+ want, err := Versions(ctx, fx.rel, fx.sqid, "kass")
+ if err != nil {
+ t.Fatal(err)
+ }
+ got, more, err := VersionsPage(ctx, fx.rel, fx.sqid, "kass", 1)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(want) == 0 || more || !reflect.DeepEqual(got, want) {
+ t.Fatalf("VersionsPage(1) = %+v more=%v, want Versions' %+v and no more", got, more, want)
+ }
+}
+
// TestHostRowsCarryName: the display name rides along on the host row, the
// unnamed (old-shape) report keeps an empty one, and the rows still sort by
// label, never by name, so a name clash can't reorder or merge them.
diff --git a/internal/release/candidates.go b/internal/release/candidates.go
index 1528f2491..4ce6a77ab 100644
--- a/internal/release/candidates.go
+++ b/internal/release/candidates.go
@@ -38,22 +38,41 @@ import (
// CLI both hand over a bare *S3Store or *DirStore), the answer is every
// version, unranked and uncapped, in listing order: the caller keeps its
// fetch-everything path, byte-identical to the pre-ModLister behavior.
+//
+// VersionCandidates is VersionCandidatesPage's first page, without more.
func VersionCandidates(ctx context.Context, s Store, acct, app string, max int) (versions []string, ranked bool, err error) {
+ versions, _, ranked, err = VersionCandidatesPage(ctx, s, acct, app, 0, max)
+ return versions, ranked, err
+}
+
+// VersionCandidatesPage is VersionCandidates over a window of the ranked
+// listing: the max versions after the newest offset, and more when anything
+// ranks below them. It makes the same single listing whatever the offset, so
+// a later page costs what the first does. An unranked answer (a plain Store)
+// is every version with more false: the caller pages after sorting.
+func VersionCandidatesPage(ctx context.Context, s Store, acct, app string, offset, max int) (versions []string, more, ranked bool, err error) {
prefix := ReleasesPrefix(acct, app)
var cands []versionStamp
ml, ranked := s.(ModLister)
if ranked {
cands, err = rankedVersionStamps(ctx, ml, prefix)
if err != nil {
- return nil, false, err
+ return nil, false, false, err
+ }
+ offset = min(offset, len(cands))
+ if offset > 0 {
+ cands = cands[offset:]
+ }
+ if max < 0 {
+ max = 0
}
if len(cands) > max {
- cands = cands[:max]
+ cands, more = cands[:max], true
}
} else {
keys, err := s.List(ctx, prefix)
if err != nil {
- return nil, false, err
+ return nil, false, false, err
}
index := map[string]int{}
for _, k := range keys {
@@ -64,7 +83,7 @@ func VersionCandidates(ctx context.Context, s Store, acct, app string, max int)
for i, c := range cands {
versions[i] = c.version
}
- return versions, ranked, nil
+ return versions, more, ranked, nil
}
// versionStamp is one distinct version under a releases prefix with the
diff --git a/internal/release/versions_test.go b/internal/release/versions_test.go
index 267b6e41a..f1bda2c84 100644
--- a/internal/release/versions_test.go
+++ b/internal/release/versions_test.go
@@ -358,13 +358,10 @@ func modStamp(t *testing.T, s *DirStore, dir, key string, mod time.Time) {
}
}
-// TestVersionCandidatesRanked: with a mod-aware store the candidates are the
-// newest max versions by each manifest object's own stamp — the mod order
-// here deliberately DISAGREES with version-name order, so a selection that
-// quietly ranked by name would fail — and a version whose ship never wrote a
-// manifest ranks by its newest artifact, so an aborted ship surfaces (as the
-// caller's error row) rather than vanishing.
-func TestVersionCandidatesRanked(t *testing.T) {
+// seedRankedCandidates is TestVersionCandidatesRanked's store: five
+// versions whose ranking, newest first, is dead1, aa, zz, cc, bb.
+func seedRankedCandidates(t *testing.T) *DirStore {
+ t.Helper()
dir := t.TempDir()
s := NewDirStore(dir)
base := time.Date(2026, 8, 1, 10, 0, 0, 0, time.UTC)
@@ -382,14 +379,24 @@ func TestVersionCandidatesRanked(t *testing.T) {
// bb's ARTIFACT ends up newer than cc's MANIFEST: a ranking that took
// the max over all of a version's objects instead of letting the
// manifest's own stamp win would rank bb (100m) over cc (60m) and evict
- // cc from the want below — this line is what pins the rule.
+ // cc from TestVersionCandidatesRanked's want — this line is what pins the rule.
bbArtifact := filepath.Join(dir, filepath.FromSlash(ArtifactKey("bab", "kass", "bb", "linux-arm64")))
if err := os.Chtimes(bbArtifact, base.Add(100*time.Minute), base.Add(100*time.Minute)); err != nil {
t.Fatal(err)
}
// A ship that died before manifest.json: artifact only, newest of all.
modStamp(t, s, dir, ArtifactKey("bab", "kass", "dead1", "linux-arm64"), base.Add(4*time.Hour))
+ return s
+}
+// TestVersionCandidatesRanked: with a mod-aware store the candidates are the
+// newest max versions by each manifest object's own stamp — the mod order
+// here deliberately DISAGREES with version-name order, so a selection that
+// quietly ranked by name would fail — and a version whose ship never wrote a
+// manifest ranks by its newest artifact, so an aborted ship surfaces (as the
+// caller's error row) rather than vanishing.
+func TestVersionCandidatesRanked(t *testing.T) {
+ s := seedRankedCandidates(t)
got, ranked, err := VersionCandidates(context.Background(), s, "bab", "kass", 4)
if err != nil {
t.Fatal(err)
@@ -439,3 +446,50 @@ func TestVersionCandidatesFallback(t *testing.T) {
}
}
}
+
+// TestVersionCandidatesPage: the ranked listing is paged by offset and max,
+// with more reporting whether anything ranks below the page; a bare Store
+// still answers every version, unranked, with more false (its caller pages
+// after sorting).
+func TestVersionCandidatesPage(t *testing.T) {
+ s := seedRankedCandidates(t)
+ ctx := context.Background()
+ for _, tc := range []struct {
+ offset int
+ want []string
+ more bool
+ }{
+ {0, []string{"dead1", "aa"}, true},
+ {2, []string{"zz", "cc"}, true},
+ {4, []string{"bb"}, false},
+ {10, nil, false},
+ } {
+ got, more, ranked, err := VersionCandidatesPage(ctx, s, "bab", "kass", tc.offset, 2)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if !ranked {
+ t.Fatalf("offset %d: DirStore answer not ranked", tc.offset)
+ }
+ if strings.Join(got, ",") != strings.Join(tc.want, ",") || more != tc.more {
+ t.Errorf("offset %d: got %v more=%v, want %v more=%v", tc.offset, got, more, tc.want, tc.more)
+ }
+ }
+
+ got, more, ranked, err := VersionCandidatesPage(ctx, plainStore{s}, "bab", "kass", 0, 2)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if ranked || more || len(got) != 5 {
+ t.Errorf("plain store: got %v more=%v ranked=%v, want all five, more false, unranked", got, more, ranked)
+ }
+
+ // The wrapper still answers TestVersionCandidatesRanked's want.
+ cands, _, err := VersionCandidates(ctx, s, "bab", "kass", 4)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if want := "dead1,aa,zz,cc"; strings.Join(cands, ",") != want {
+ t.Errorf("VersionCandidates = %v, want %s", cands, want)
+ }
+}