feat(executors): add continuous SSH host reachability probing (#3747)

Co-authored-by: nova28 <17953305+nova28@users.noreply.github.com>
Co-authored-by: Carlos Florencio <carlosmflorencio@gmail.com>
This commit is contained in:
Henry
2026-09-22 17:31:00 +08:00
committed by GitHub
parent 7b2a4c0712
commit c7cc92382b
121 changed files with 11067 additions and 170 deletions
@@ -423,6 +423,24 @@ func (r *Repository) runMigrations(ctx context.Context) error {
// allocated.
_ = r.migrate.Apply("workflow_step_entries.marker_positions", `ALTER TABLE workflow_step_entries ADD COLUMN marker_positions TEXT NOT NULL DEFAULT ''`)
// One row per SSH executor holding observed reachability — deliberately
// not columns on executors, which holds user-authored config and a
// user-controlled status switch. No foreign key: deletion is explicit
// (DeleteExecutor deletes the row in the same transaction as the soft
// delete), not a cascade.
_ = r.migrate.Apply("executor_reachability.table", `
CREATE TABLE IF NOT EXISTS executor_reachability (
executor_id TEXT PRIMARY KEY,
state TEXT NOT NULL DEFAULT 'unknown',
reason TEXT NOT NULL DEFAULT '',
message TEXT NOT NULL DEFAULT '',
consecutive_failures INTEGER NOT NULL DEFAULT 0,
host TEXT NOT NULL DEFAULT '',
checked_at TIMESTAMP,
last_success_at TIMESTAMP,
updated_at TIMESTAMP NOT NULL
)`)
// Checked last so a failure on any required migration above --
// including this file's own marker_positions column -- fails startup
// instead of leaving a schema that allocateStepEntryIfPending can't write to.