▍ humdrum codex / custard v0.3.0
license AGPL-3.0

fix(forge): deploy badge only for repos that deploy via custard

9727dd6a85cf06137de3f73ff8f8bc302fe9d6bc
humdrum <me@humdrum.me> · 2026-06-18 09:02

parent ead4d5eb

fix(forge): deploy badge only for repos that deploy via custard

Gate the deploy badge on .custard.yaml having a deploy.preview command, not on
merely having a status entry. CLIs, the forge itself, and any non-web-deployed
repo no longer show spurious ⚠ unverified markers.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

1 files changed

internal/server/server.go +13 −7
@@ -14,6 +14,7 @@ 	"custard/internal/backlog"
 	"custard/internal/config"
 	"custard/internal/gitread"
 	"custard/internal/license"
+	"custard/internal/release"
 	"custard/internal/render"
 	"custard/internal/status"
 	"custard/web"
@@ -329,17 +330,22 @@ 	return m
 }
 
 // deployBadge returns the deploy state of the commit at ref (default branch when
-// ref is empty), only for repos that use custard deploy. "" state = no badge.
+// ref is empty). Only repos that actually deploy through custard — i.e. their
+// .custard.yaml declares deploy.preview — get a badge; CLIs, the forge itself,
+// and anything not web-deployed get none. "" state = no badge.
 func (s *Server) deployBadge(name, ref string) (state, url string) {
-	if name == "" || !s.status.Has(name) {
+	if name == "" {
+		return "", ""
+	}
+	branch, err := s.store.DefaultBranch(name)
+	if err != nil {
 		return "", ""
 	}
+	if cfg, ok := release.ReadRepoConfig(s.store, name, branch); !ok || cfg.Deploy.Preview == "" {
+		return "", "" // repo doesn't deploy via custard → no badge
+	}
 	if ref == "" {
-		b, err := s.store.DefaultBranch(name)
-		if err != nil {
-			return "", ""
-		}
-		ref = b
+		ref = branch
 	}
 	commits, err := s.store.Log(name, ref, 1)
 	if err != nil || len(commits) == 0 {