fix(master): review fixes for drift restore and accept (#10)

This commit is contained in:
2026-10-13 10:36:01 +02:00
parent b7d105e841
commit df8f621683
11 changed files with 77 additions and 46 deletions
@@ -1,7 +1,7 @@
-- true from a successful job until the next inventory write for the row: the
-- True from a successful job until the next inventory write for the row. The
-- agent's upsert arrives a debounce interval after job.result, and until then
-- desired_ref is newer than actual_ref without the service having drifted.
ALTER TABLE services ADD COLUMN awaiting_inventory boolean NOT NULL DEFAULT false;
-- move suggestions look up Compose rows by project + service across agents
-- Move suggestions look up Compose rows by project and service across agents.
CREATE INDEX services_by_compose_name ON services (compose_project, compose_service) WHERE kind = 'compose';
+2 -2
View File
@@ -259,8 +259,8 @@ func (s *Store) SetPollError(ctx context.Context, ids []int64, msg string) error
}
// SetLastTagDigest sets last_tag_digest; see model.Service.LastTagDigest. The
// poller calls it, and FinishJob sets the same column after a tag job.
// Inventory writes never change it.
// poller and jobs.RestoreDesired call it, and FinishJob sets the same column
// after a tag job. Inventory writes never change it.
func (s *Store) SetLastTagDigest(ctx context.Context, id int64, digest string) error {
if _, err := s.pool.Exec(ctx,
`UPDATE services SET last_tag_digest = $2 WHERE id = $1`, id, digest); err != nil {