Publish feedback: forge CI status polling with honest no-token fallback #11
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/deckle#11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What to build
What the editor sees after Publish (docs/DECISIONS.md D15, D16): with a forge API token configured (out-of-repo), poll the CI status of the pushed commit on Forgejo/Gitea and GitHub and show real state in the UI — Publishing… → Live ✓, or Build failed with a copyable log link. Without a token, show honestly that the change was handed to deployment and should be live in a few minutes. GitLab is out of scope.
Acceptance criteria
Blocked by
Agent Brief
Category: enhancement
Summary: After a publish push, show the editor what actually happened to their change: with a forge API token configured (out-of-repo), poll the pushed commit's CI status on Forgejo/Gitea or GitHub and render Publishing… → Live ✓ / Build failed (with a link to the run); without a token — or when the forge API misbehaves — show an honest static "handed to deployment" message instead of fake certainty.
Dependency note: this issue is hard-blocked by #10 (git save and per-page publish), which provides the publish flow itself — the commit to main and the push whose CI outcome this issue reports, including the pushed commit SHA. The scheduler handles ordering; do not start until #10 is merged. The issue body's
docs/DECISIONS.mdreferences (D15, D16) point at a file that is not committed — this brief is self-contained.Current behavior:
After #10, Publish commits a page's bundle to main and pushes it. From the editor's perspective the story ends at "push succeeded": whether the site's CI pipeline then built and deployed the change — or failed and left the live site stale — is invisible. The editor has no way to distinguish "live in production" from "push accepted, deployment pending or broken" without leaving the tool and reading the forge UI. The SPA already has an established pattern of polling a harness status endpoint and rendering state from it (the Hugo supervisor status), but nothing tracks post-push deployment state.
Desired behavior:
Token-backed CI polling. When a forge API token is configured, the harness — not the browser — polls the forge's commit-status API for the commit each publish pushed, normalizes the result, and exposes it to the SPA. The token comes from the environment or a secrets file outside the site repository; it is never read from the repo, never committed, never sent to the browser, and never logged. Two forge families are supported:
Which forge to talk to, and its API base URL, is derived from the site repository's push remote URL, with an explicit configuration override for ambiguous cases (e.g. a self-hosted Forgejo on a custom domain that URL sniffing cannot classify).
UI states. After a publish, the publish surface in the SPA shows:
State transitions render live as polling progresses — the editor watches Publishing… become Live ✓ without reloading.
Honest no-token fallback. With no token configured, no polling happens at all. The UI shows a static, honest message: the change was handed to deployment and should be live within a few minutes. No fake success state, no spinner that never resolves, no error noise.
Degradation on API errors. Any forge API failure while polling — bad credentials, 404, network error, rate limiting, unparseable response — degrades that publish's feedback to the same honest no-token message. Errors never block or fail the publish itself (which already succeeded), and never spam the editor; at most a log line on the server.
Polling discipline. Polling starts when a publish's push completes, backs off over time (increasing intervals rather than a fixed tight loop), and stops permanently for a commit once a terminal state is reached (success, failure, or degradation). A commit whose checks never report anything (e.g. the repo has no CI configured) must not be polled forever: after a bounded window, degrade to the honest message and stop. Multiple publishes in one session are each tracked; the UI reflects the state of the most recent publish of a page.
Key interfaces:
Acceptance criteria:
Out of scope:
Closing as superseded: the maintainer has decided on a clean-slate reset of the project (issue #29, PR #30). The v1 implementation this issue builds on is being removed and the plan will be re-drawn from scratch; this spec is retired rather than actioned.