feat(releaseupdate): judge the installed release, window from install (#1725)
The canary window now counts from when a release is installed on the host (installed.json / installed_at in the update snapshot), not from the statement's issued_at, and 'release canary check' judges the release the canary actually runs via its exact-pin tag instead of the moving next tag. A newer release on next queues behind the one being judged instead of restarting the clock, so stable moves once per release. New subcommands: canary status (read-only state, signals, verdict), canary promote (promote now when hard checks pass), canary unpin (back to next), and start -force. A held/pinned canary is verified installable every check and a stranded pin fails the run red instead of looking green. Rollback pre-flight checks stable's zip and agent image digests before pinning. Relative signals are judged whenever both windows carry minimum data, so a breach rolls back mid-window; promote still needs the full window unless the operator promotes early (new promote.yml workflow_dispatch). The window is configurable via -window / CANARY_WINDOW. Also: dashboard canary status card (ui), and task canary:rehearse, a local end-to-end rehearsal of publish -> canary start -> status -> check -> promote against a throwaway registry and host. task check passes; rehearsal run green (REHEARSE_EXIT=0).
This commit is contained in:
18 files changed
+1487
-180
No files matched your search
@@ -6,6 +6,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
@@ -15,6 +16,7 @@ import (
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/domain/lifecycle"
|
||||
"github.com/samcharles93/archie-core/internal/domain/messaging"
|
||||
"github.com/samcharles93/archie-core/internal/infrastructure/configuration"
|
||||
"github.com/samcharles93/archie-core/internal/releaseupdate"
|
||||
)
|
||||
|
||||
@@ -513,6 +515,11 @@ func (s *Server) handleChatUpdate(w http.ResponseWriter, r *http.Request) {
|
||||
writeUpdateCheckError(w, err)
|
||||
return
|
||||
}
|
||||
// The snapshot carries when the installed release was committed on this
|
||||
// host, so a canary can count its window from the actual install.
|
||||
if _, at, ok := releaseupdate.LastInstall(updateStateDir()); ok {
|
||||
snapshot.InstalledAt = at
|
||||
}
|
||||
writeJSON(w, map[string]any{
|
||||
"snapshot": snapshot,
|
||||
"available": snapshot.Available(),
|
||||
@@ -520,6 +527,16 @@ func (s *Server) handleChatUpdate(w http.ResponseWriter, r *http.Request) {
|
||||
})
|
||||
}
|
||||
|
||||
// updateStateDir resolves the host's update state directory the same way the
|
||||
// daemon does, so the dashboard reads the installed.json its transactions
|
||||
// write.
|
||||
func updateStateDir() string {
|
||||
if dir := os.Getenv("ARCHIE_UPDATE_STATE_DIR"); dir != "" {
|
||||
return dir
|
||||
}
|
||||
return configuration.DefaultUpdateStateDir()
|
||||
}
|
||||
|
||||
func (s *Server) handleChatUpdateDefer(w http.ResponseWriter, r *http.Request) {
|
||||
chat, ok := s.chatReady(w)
|
||||
if !ok {
|
||||
|
||||
Reference in new issue
Block a user