Phase 5 part 5: check the live site after a merge

Merged Sites pages are checked on the live site until they answer with
their own words and title; removed ones until they're gone. The SEO loop,
the page, the signal's page and Sites → Publishing check (or Check now);
two hours without the page points at the deploy hook. Pages going live or
away go to IndexNow. Sites → Publishing lists what's waiting, open pull
requests and recent merges. Schema 24.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-22 14:28:42 -07:00
co-authored by Claude Opus 5.5
parent 062fcf2e59
commit e2a72d5ef9
18 changed files with 746 additions and 63 deletions
+3 -2
View File
@@ -64,6 +64,7 @@
<a href="/sites" {{if eq $nav "sites/site"}}aria-current="page"{{end}}>Sections and pages</a>
<a href="/sites/pages" {{if hasPrefix $nav "sites/pages"}}aria-current="page"{{end}}>New pages</a>
<a href="/sites/previews" {{if eq $nav "sites/previews"}}aria-current="page"{{end}}>Previews</a>
<a href="/sites/publishing" {{if eq $nav "sites/publishing"}}aria-current="page"{{end}}>Publishing</a>
</div>
{{end}}
{{if eq .ID "prospects"}}
@@ -192,10 +193,10 @@
{{- else if eq .Status "working"}}<span class="badge scheduled">pushing…</span>
{{- else if eq .Status "pushed"}}<span class="badge scheduled">on its branch</span>
{{- else if eq .Status "pr"}}<span class="badge scheduled">pull request open</span>
{{- else if eq .Status "merged"}}<span class="badge published">merged</span>
{{- else if eq .Status "merged"}}{{if .LiveAt.IsZero}}<span class="badge scheduled" title="Merged; waiting to see it on the live site">merged, not live yet</span>{{else}}<span class="badge published" title="Merged and seen on the live site">live</span>{{end}}
{{- else if eq .Status "closed"}}<span class="badge">closed</span>
{{- else if eq .Status "failed"}}<span class="badge failed">failed</span>
{{- else if eq .Status "removing"}}<span class="badge scheduled">removal pull request open</span>
{{- else if eq .Status "removed"}}<span class="badge">removed</span>
{{- else if eq .Status "removed"}}{{if .GoneAt.IsZero}}<span class="badge scheduled">removal merged, still on the site</span>{{else}}<span class="badge">removed</span>{{end}}
{{- end}}{{if and .Error (ne .Status "failed")}} <span class="badge failed">to fix</span>{{end}}
{{end}}
+9 -1
View File
@@ -3,11 +3,19 @@
<p class="lede">{{.Kind}} for {{$p.Site}}{{with .From}}, from {{join . "; "}}{{end}}.
{{template "page-status" $p}}</p>
{{if or $p.PRURL .Preview}}
{{if or $p.PRURL .Preview $p.LiveNote}}
<section class="card">
{{with .Preview}}<p><a class="button" href="{{.}}" target="_blank" rel="noopener">Open the preview ↗</a> <span class="small muted">built {{ago $d.PreviewAt}} from the branch {{$p.Branch}}</span></p>{{end}}
{{with $p.PRURL}}<p>The pull request: <a href="{{.}}" target="_blank" rel="noopener noreferrer">{{.}} ↗</a>{{if eq $p.Status "merged"}}, merged {{ago $p.MergedAt}}{{end}}</p>{{end}}
{{with $p.Note}}<p class="small">{{.}}</p>{{end}}
{{if or (eq $p.Status "merged") (eq $p.Status "removing") (eq $p.Status "removed")}}
<div class="status-line">
{{if not $p.LiveAt.IsZero}}{{if ne $p.Status "removed"}}<p class="ok">On the live site since {{ago $p.LiveAt}}: <a href="{{$p.Address}}" target="_blank" rel="noopener noreferrer">{{$p.Address}} ↗</a></p>{{end}}{{end}}
{{if eq $p.Status "removed"}}{{if not $p.GoneAt.IsZero}}<p class="ok">Off the live site since {{ago $p.GoneAt}}.</p>{{end}}{{end}}
{{with $p.LiveNote}}<p class="small">{{if $d.Late}}<span class="warn-text">{{.}} It's been over two hours since the merge: check that the site's deploy (the Gitea hook) ran.</span>{{else}}{{.}}{{end}} {{if not $p.CheckedAt.IsZero}}<span class="muted">Checked {{ago $p.CheckedAt}}.</span>{{end}}</p>{{end}}
{{if $p.Waiting}}<form method="post" action="/sites/pages/{{$p.ID}}/check"><button type="submit" class="secondary small" data-busy="Checking…">Check the live site now</button></form>{{end}}
</div>
{{end}}
</section>
{{end}}
@@ -0,0 +1,48 @@
{{define "content"}}{{with .Data}}{{$d := .}}
<div class="heading"><h1>Publishing</h1></div>
<p class="lede">Merging a pull request on Gitea publishes it: your Gitea hook deploys the site. Supermarket follows its pull requests, and after a merge checks the live site until the page is there, with its title and its own words, or, for a removal, gone. It checks every 30 minutes, and whenever you open the page.</p>
{{if not .Sites}}
<section class="card empty"><p>Add your website and its Hugo repository under <a href="/settings/profile">Settings → Profile</a> first.</p></section>
{{else}}
{{if gt (len .Sites) 1}}<nav class="tabs">{{range .Sites}}<a href="/sites/publishing?site={{.Index}}" {{if and $d.Current (eq .Index $d.Current.Index)}}aria-current="page"{{end}}>{{.URL}}</a>{{end}}</nav>{{end}}
{{with .Current}}
{{if .Err}}<section class="card"><p class="warn-text">{{.URL}}: {{.Err}}.</p></section>{{else}}
<h2>Waiting for the live site</h2>
{{with $d.Waiting}}
<div class="table-wrap"><table>
<thead><tr><th>Page</th><th>Merged</th><th>Last check</th></tr></thead>
<tbody>{{range .}}<tr>
<td><a href="/sites/pages/{{.ID}}">{{or .Title .Path}}</a><br><span class="small muted">{{.Address}}</span></td>
<td class="small">{{if eq .Status "removed"}}removal {{end}}{{if not .MergedAt.IsZero}}{{ago .MergedAt}}{{end}}</td>
<td class="small">{{if .Late $d.Now}}<span class="warn-text">{{.LiveNote}} Over two hours since the merge: check that the deploy ran.</span>{{else}}{{or .LiveNote "Not checked yet."}}{{end}}</td>
</tr>{{end}}</tbody>
</table></div>
{{else}}<p class="help">Nothing waiting: every merged page is on the live site.</p>{{end}}
{{with $d.Open}}
<h2>Pull requests waiting for you</h2>
<ul class="items">{{range .}}<li class="item"><a href="/sites/pages/{{.ID}}">{{or .Title .Path}}</a> {{template "page-status" .}}
{{if eq .Status "removing"}}<a class="small" href="{{.RemovalPRURL}}" target="_blank" rel="noopener noreferrer">the pull request ↗</a>{{else}}<a class="small" href="{{.PRURL}}" target="_blank" rel="noopener noreferrer">the pull request ↗</a>{{end}}</li>{{end}}</ul>
{{end}}
<h2>Recent merges</h2>
{{with $d.PullsErr}}<p class="warn-text">Couldn't read the pull requests from Gitea: {{.}}</p>{{end}}
{{if not $d.Gitea}}<p class="help">Save a Gitea token under <a href="/settings/search">Settings → Search engines</a> to see them.</p>
{{else}}{{with $d.Merges}}
<div class="table-wrap"><table>
<thead><tr><th>Merged</th><th>Pull request</th><th>From</th><th>On the live site</th></tr></thead>
<tbody>{{range .}}<tr>
<td class="small">{{with .MergedAt}}{{ago .}}{{end}}</td>
<td><a href="{{.HTMLURL}}" target="_blank" rel="noopener noreferrer">{{.Title}}</a><br><span class="small muted">{{.Head.Ref}}</span></td>
<td class="small">{{if .Ours}}Supermarket{{else}}{{.User.Login}}{{end}}</td>
<td class="small">{{with .Page}}<a href="/sites/pages/{{.ID}}">{{template "page-status" .}}</a>{{else}}<span class="muted">—</span>{{end}}</td>
</tr>{{end}}</tbody>
</table></div>
<p class="small muted">SEO changes and briefs follow their own pages to the live site, under SEO → Changes and Briefs and pages.</p>
{{else}}<p class="help">No merged pull requests yet. Changes pushed straight to the published branch aren't pull requests: they're under <a href="/sites?site={{$d.Current.Index}}">Sections and pages</a>, in the latest commits.</p>{{end}}{{end}}
{{end}}
{{end}}
{{end}}
{{end}}{{end}}