From dbd2a1c9f630779646bc26bf781ec26353946344 Mon Sep 17 00:00:00 2001 From: liangxu Date: Sat, 30 May 2026 20:10:40 +0800 Subject: [PATCH] chore(repository): regenerate sqlc for publish_submit_started_at column Run sqlc generate to sync the generated tenant repository with the desktop_tasks.publish_submit_started_at column added in migration 20260530101000. The migration was committed without regenerating, so the "Verify generated code is committed" check was failing. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../repository/generated/desktop_task.sql.go | 30 ++++++--- .../tenant/repository/generated/models.go | 67 ++++++++++--------- 2 files changed, 54 insertions(+), 43 deletions(-) diff --git a/server/internal/tenant/repository/generated/desktop_task.sql.go b/server/internal/tenant/repository/generated/desktop_task.sql.go index 8f5ea65..66fb113 100644 --- a/server/internal/tenant/repository/generated/desktop_task.sql.go +++ b/server/internal/tenant/repository/generated/desktop_task.sql.go @@ -22,7 +22,7 @@ SET status = 'aborted', WHERE desktop_id = $2 AND target_client_id = $3 AND status = 'queued' -RETURNING id, desktop_id, job_id, tenant_id, workspace_id, target_account_id, target_client_id, platform_id, kind, payload, status, dedup_key, active_attempt_id, lease_token_hash, lease_expires_at, attempts, result, error, created_at, updated_at, priority, lane, lane_weight, source, scheduler_group_key, monitor_task_id, supersedes_task_id, control_flags, interrupt_generation, started_at, interrupted_at, interrupt_reason, enqueued_at +RETURNING id, desktop_id, job_id, tenant_id, workspace_id, target_account_id, target_client_id, platform_id, kind, payload, status, dedup_key, active_attempt_id, lease_token_hash, lease_expires_at, attempts, result, error, created_at, updated_at, priority, lane, lane_weight, source, scheduler_group_key, monitor_task_id, supersedes_task_id, control_flags, interrupt_generation, started_at, interrupted_at, interrupt_reason, enqueued_at, publish_submit_started_at ` type CancelDesktopTaskByClientParams struct { @@ -68,6 +68,7 @@ func (q *Queries) CancelDesktopTaskByClient(ctx context.Context, arg CancelDeskt &i.InterruptedAt, &i.InterruptReason, &i.EnqueuedAt, + &i.PublishSubmitStartedAt, ) return i, err } @@ -83,7 +84,7 @@ SET status = 'aborted', WHERE desktop_id = $2 AND lease_token_hash = $3 AND status = 'in_progress' -RETURNING id, desktop_id, job_id, tenant_id, workspace_id, target_account_id, target_client_id, platform_id, kind, payload, status, dedup_key, active_attempt_id, lease_token_hash, lease_expires_at, attempts, result, error, created_at, updated_at, priority, lane, lane_weight, source, scheduler_group_key, monitor_task_id, supersedes_task_id, control_flags, interrupt_generation, started_at, interrupted_at, interrupt_reason, enqueued_at +RETURNING id, desktop_id, job_id, tenant_id, workspace_id, target_account_id, target_client_id, platform_id, kind, payload, status, dedup_key, active_attempt_id, lease_token_hash, lease_expires_at, attempts, result, error, created_at, updated_at, priority, lane, lane_weight, source, scheduler_group_key, monitor_task_id, supersedes_task_id, control_flags, interrupt_generation, started_at, interrupted_at, interrupt_reason, enqueued_at, publish_submit_started_at ` type CancelDesktopTaskByLeaseParams struct { @@ -129,6 +130,7 @@ func (q *Queries) CancelDesktopTaskByLease(ctx context.Context, arg CancelDeskto &i.InterruptedAt, &i.InterruptReason, &i.EnqueuedAt, + &i.PublishSubmitStartedAt, ) return i, err } @@ -145,7 +147,7 @@ SET status = $1, WHERE desktop_id = $4 AND lease_token_hash = $5 AND status = 'in_progress' -RETURNING id, desktop_id, job_id, tenant_id, workspace_id, target_account_id, target_client_id, platform_id, kind, payload, status, dedup_key, active_attempt_id, lease_token_hash, lease_expires_at, attempts, result, error, created_at, updated_at, priority, lane, lane_weight, source, scheduler_group_key, monitor_task_id, supersedes_task_id, control_flags, interrupt_generation, started_at, interrupted_at, interrupt_reason, enqueued_at +RETURNING id, desktop_id, job_id, tenant_id, workspace_id, target_account_id, target_client_id, platform_id, kind, payload, status, dedup_key, active_attempt_id, lease_token_hash, lease_expires_at, attempts, result, error, created_at, updated_at, priority, lane, lane_weight, source, scheduler_group_key, monitor_task_id, supersedes_task_id, control_flags, interrupt_generation, started_at, interrupted_at, interrupt_reason, enqueued_at, publish_submit_started_at ` type CompleteDesktopTaskParams struct { @@ -199,6 +201,7 @@ func (q *Queries) CompleteDesktopTask(ctx context.Context, arg CompleteDesktopTa &i.InterruptedAt, &i.InterruptReason, &i.EnqueuedAt, + &i.PublishSubmitStartedAt, ) return i, err } @@ -302,7 +305,7 @@ VALUES ( $10, $11 ) -RETURNING id, desktop_id, job_id, tenant_id, workspace_id, target_account_id, target_client_id, platform_id, kind, payload, status, dedup_key, active_attempt_id, lease_token_hash, lease_expires_at, attempts, result, error, created_at, updated_at, priority, lane, lane_weight, source, scheduler_group_key, monitor_task_id, supersedes_task_id, control_flags, interrupt_generation, started_at, interrupted_at, interrupt_reason, enqueued_at +RETURNING id, desktop_id, job_id, tenant_id, workspace_id, target_account_id, target_client_id, platform_id, kind, payload, status, dedup_key, active_attempt_id, lease_token_hash, lease_expires_at, attempts, result, error, created_at, updated_at, priority, lane, lane_weight, source, scheduler_group_key, monitor_task_id, supersedes_task_id, control_flags, interrupt_generation, started_at, interrupted_at, interrupt_reason, enqueued_at, publish_submit_started_at ` type CreateDesktopTaskParams struct { @@ -368,6 +371,7 @@ func (q *Queries) CreateDesktopTask(ctx context.Context, arg CreateDesktopTaskPa &i.InterruptedAt, &i.InterruptReason, &i.EnqueuedAt, + &i.PublishSubmitStartedAt, ) return i, err } @@ -425,7 +429,7 @@ SET lease_expires_at = now() + CASE WHEN kind = 'publish' THEN interval '3 minut WHERE desktop_id = $1 AND lease_token_hash = $2 AND status = 'in_progress' -RETURNING id, desktop_id, job_id, tenant_id, workspace_id, target_account_id, target_client_id, platform_id, kind, payload, status, dedup_key, active_attempt_id, lease_token_hash, lease_expires_at, attempts, result, error, created_at, updated_at, priority, lane, lane_weight, source, scheduler_group_key, monitor_task_id, supersedes_task_id, control_flags, interrupt_generation, started_at, interrupted_at, interrupt_reason, enqueued_at +RETURNING id, desktop_id, job_id, tenant_id, workspace_id, target_account_id, target_client_id, platform_id, kind, payload, status, dedup_key, active_attempt_id, lease_token_hash, lease_expires_at, attempts, result, error, created_at, updated_at, priority, lane, lane_weight, source, scheduler_group_key, monitor_task_id, supersedes_task_id, control_flags, interrupt_generation, started_at, interrupted_at, interrupt_reason, enqueued_at, publish_submit_started_at ` type ExtendDesktopTaskLeaseParams struct { @@ -470,6 +474,7 @@ func (q *Queries) ExtendDesktopTaskLease(ctx context.Context, arg ExtendDesktopT &i.InterruptedAt, &i.InterruptReason, &i.EnqueuedAt, + &i.PublishSubmitStartedAt, ) return i, err } @@ -501,7 +506,7 @@ func (q *Queries) FinishDesktopTaskAttempt(ctx context.Context, arg FinishDeskto } const getDesktopTaskByDesktopID = `-- name: GetDesktopTaskByDesktopID :one -SELECT id, desktop_id, job_id, tenant_id, workspace_id, target_account_id, target_client_id, platform_id, kind, payload, status, dedup_key, active_attempt_id, lease_token_hash, lease_expires_at, attempts, result, error, created_at, updated_at, priority, lane, lane_weight, source, scheduler_group_key, monitor_task_id, supersedes_task_id, control_flags, interrupt_generation, started_at, interrupted_at, interrupt_reason, enqueued_at +SELECT id, desktop_id, job_id, tenant_id, workspace_id, target_account_id, target_client_id, platform_id, kind, payload, status, dedup_key, active_attempt_id, lease_token_hash, lease_expires_at, attempts, result, error, created_at, updated_at, priority, lane, lane_weight, source, scheduler_group_key, monitor_task_id, supersedes_task_id, control_flags, interrupt_generation, started_at, interrupted_at, interrupt_reason, enqueued_at, publish_submit_started_at FROM desktop_tasks WHERE desktop_id = $1 AND workspace_id = $2 @@ -550,6 +555,7 @@ func (q *Queries) GetDesktopTaskByDesktopID(ctx context.Context, arg GetDesktopT &i.InterruptedAt, &i.InterruptReason, &i.EnqueuedAt, + &i.PublishSubmitStartedAt, ) return i, err } @@ -595,7 +601,7 @@ SET active_attempt_id = $1, updated_at = now() FROM candidate WHERE t.desktop_id = candidate.desktop_id -RETURNING t.id, t.desktop_id, t.job_id, t.tenant_id, t.workspace_id, t.target_account_id, t.target_client_id, t.platform_id, t.kind, t.payload, t.status, t.dedup_key, t.active_attempt_id, t.lease_token_hash, t.lease_expires_at, t.attempts, t.result, t.error, t.created_at, t.updated_at, t.priority, t.lane, t.lane_weight, t.source, t.scheduler_group_key, t.monitor_task_id, t.supersedes_task_id, t.control_flags, t.interrupt_generation, t.started_at, t.interrupted_at, t.interrupt_reason, t.enqueued_at +RETURNING t.id, t.desktop_id, t.job_id, t.tenant_id, t.workspace_id, t.target_account_id, t.target_client_id, t.platform_id, t.kind, t.payload, t.status, t.dedup_key, t.active_attempt_id, t.lease_token_hash, t.lease_expires_at, t.attempts, t.result, t.error, t.created_at, t.updated_at, t.priority, t.lane, t.lane_weight, t.source, t.scheduler_group_key, t.monitor_task_id, t.supersedes_task_id, t.control_flags, t.interrupt_generation, t.started_at, t.interrupted_at, t.interrupt_reason, t.enqueued_at, t.publish_submit_started_at ` type LeaseNextQueuedDesktopTaskParams struct { @@ -647,6 +653,7 @@ func (q *Queries) LeaseNextQueuedDesktopTask(ctx context.Context, arg LeaseNextQ &i.InterruptedAt, &i.InterruptReason, &i.EnqueuedAt, + &i.PublishSubmitStartedAt, ) return i, err } @@ -667,7 +674,7 @@ WHERE desktop_id = $3 kind <> 'publish' OR attempts < 3 ) -RETURNING id, desktop_id, job_id, tenant_id, workspace_id, target_account_id, target_client_id, platform_id, kind, payload, status, dedup_key, active_attempt_id, lease_token_hash, lease_expires_at, attempts, result, error, created_at, updated_at, priority, lane, lane_weight, source, scheduler_group_key, monitor_task_id, supersedes_task_id, control_flags, interrupt_generation, started_at, interrupted_at, interrupt_reason, enqueued_at +RETURNING id, desktop_id, job_id, tenant_id, workspace_id, target_account_id, target_client_id, platform_id, kind, payload, status, dedup_key, active_attempt_id, lease_token_hash, lease_expires_at, attempts, result, error, created_at, updated_at, priority, lane, lane_weight, source, scheduler_group_key, monitor_task_id, supersedes_task_id, control_flags, interrupt_generation, started_at, interrupted_at, interrupt_reason, enqueued_at, publish_submit_started_at ` type LeaseQueuedDesktopTaskByDesktopIDParams struct { @@ -719,6 +726,7 @@ func (q *Queries) LeaseQueuedDesktopTaskByDesktopID(ctx context.Context, arg Lea &i.InterruptedAt, &i.InterruptReason, &i.EnqueuedAt, + &i.PublishSubmitStartedAt, ) return i, err } @@ -769,7 +777,7 @@ SET status = CASE WHERE desktop_id = $4 AND workspace_id = $5 AND status = 'unknown' -RETURNING id, desktop_id, job_id, tenant_id, workspace_id, target_account_id, target_client_id, platform_id, kind, payload, status, dedup_key, active_attempt_id, lease_token_hash, lease_expires_at, attempts, result, error, created_at, updated_at, priority, lane, lane_weight, source, scheduler_group_key, monitor_task_id, supersedes_task_id, control_flags, interrupt_generation, started_at, interrupted_at, interrupt_reason, enqueued_at +RETURNING id, desktop_id, job_id, tenant_id, workspace_id, target_account_id, target_client_id, platform_id, kind, payload, status, dedup_key, active_attempt_id, lease_token_hash, lease_expires_at, attempts, result, error, created_at, updated_at, priority, lane, lane_weight, source, scheduler_group_key, monitor_task_id, supersedes_task_id, control_flags, interrupt_generation, started_at, interrupted_at, interrupt_reason, enqueued_at, publish_submit_started_at ` type ReconcileDesktopTaskParams struct { @@ -823,6 +831,7 @@ func (q *Queries) ReconcileDesktopTask(ctx context.Context, arg ReconcileDesktop &i.InterruptedAt, &i.InterruptReason, &i.EnqueuedAt, + &i.PublishSubmitStartedAt, ) return i, err } @@ -838,7 +847,7 @@ SET status = 'aborted', WHERE desktop_id = $2 AND workspace_id = $3 AND status = 'queued' -RETURNING id, desktop_id, job_id, tenant_id, workspace_id, target_account_id, target_client_id, platform_id, kind, payload, status, dedup_key, active_attempt_id, lease_token_hash, lease_expires_at, attempts, result, error, created_at, updated_at, priority, lane, lane_weight, source, scheduler_group_key, monitor_task_id, supersedes_task_id, control_flags, interrupt_generation, started_at, interrupted_at, interrupt_reason, enqueued_at +RETURNING id, desktop_id, job_id, tenant_id, workspace_id, target_account_id, target_client_id, platform_id, kind, payload, status, dedup_key, active_attempt_id, lease_token_hash, lease_expires_at, attempts, result, error, created_at, updated_at, priority, lane, lane_weight, source, scheduler_group_key, monitor_task_id, supersedes_task_id, control_flags, interrupt_generation, started_at, interrupted_at, interrupt_reason, enqueued_at, publish_submit_started_at ` type TenantCancelDesktopTaskParams struct { @@ -884,6 +893,7 @@ func (q *Queries) TenantCancelDesktopTask(ctx context.Context, arg TenantCancelD &i.InterruptedAt, &i.InterruptReason, &i.EnqueuedAt, + &i.PublishSubmitStartedAt, ) return i, err } diff --git a/server/internal/tenant/repository/generated/models.go b/server/internal/tenant/repository/generated/models.go index bd6eefb..7ae1dd5 100644 --- a/server/internal/tenant/repository/generated/models.go +++ b/server/internal/tenant/repository/generated/models.go @@ -311,39 +311,40 @@ type DesktopPublishJob struct { } type DesktopTask struct { - ID int64 `json:"id"` - DesktopID pgtype.UUID `json:"desktop_id"` - JobID pgtype.UUID `json:"job_id"` - TenantID int64 `json:"tenant_id"` - WorkspaceID int64 `json:"workspace_id"` - TargetAccountID pgtype.UUID `json:"target_account_id"` - TargetClientID pgtype.UUID `json:"target_client_id"` - PlatformID string `json:"platform_id"` - Kind string `json:"kind"` - Payload []byte `json:"payload"` - Status string `json:"status"` - DedupKey pgtype.Text `json:"dedup_key"` - ActiveAttemptID pgtype.UUID `json:"active_attempt_id"` - LeaseTokenHash []byte `json:"lease_token_hash"` - LeaseExpiresAt pgtype.Timestamptz `json:"lease_expires_at"` - Attempts int32 `json:"attempts"` - Result []byte `json:"result"` - Error []byte `json:"error"` - CreatedAt pgtype.Timestamptz `json:"created_at"` - UpdatedAt pgtype.Timestamptz `json:"updated_at"` - Priority int32 `json:"priority"` - Lane string `json:"lane"` - LaneWeight int32 `json:"lane_weight"` - Source string `json:"source"` - SchedulerGroupKey pgtype.Text `json:"scheduler_group_key"` - MonitorTaskID pgtype.Int8 `json:"monitor_task_id"` - SupersedesTaskID pgtype.UUID `json:"supersedes_task_id"` - ControlFlags []byte `json:"control_flags"` - InterruptGeneration int32 `json:"interrupt_generation"` - StartedAt pgtype.Timestamptz `json:"started_at"` - InterruptedAt pgtype.Timestamptz `json:"interrupted_at"` - InterruptReason pgtype.Text `json:"interrupt_reason"` - EnqueuedAt pgtype.Timestamptz `json:"enqueued_at"` + ID int64 `json:"id"` + DesktopID pgtype.UUID `json:"desktop_id"` + JobID pgtype.UUID `json:"job_id"` + TenantID int64 `json:"tenant_id"` + WorkspaceID int64 `json:"workspace_id"` + TargetAccountID pgtype.UUID `json:"target_account_id"` + TargetClientID pgtype.UUID `json:"target_client_id"` + PlatformID string `json:"platform_id"` + Kind string `json:"kind"` + Payload []byte `json:"payload"` + Status string `json:"status"` + DedupKey pgtype.Text `json:"dedup_key"` + ActiveAttemptID pgtype.UUID `json:"active_attempt_id"` + LeaseTokenHash []byte `json:"lease_token_hash"` + LeaseExpiresAt pgtype.Timestamptz `json:"lease_expires_at"` + Attempts int32 `json:"attempts"` + Result []byte `json:"result"` + Error []byte `json:"error"` + CreatedAt pgtype.Timestamptz `json:"created_at"` + UpdatedAt pgtype.Timestamptz `json:"updated_at"` + Priority int32 `json:"priority"` + Lane string `json:"lane"` + LaneWeight int32 `json:"lane_weight"` + Source string `json:"source"` + SchedulerGroupKey pgtype.Text `json:"scheduler_group_key"` + MonitorTaskID pgtype.Int8 `json:"monitor_task_id"` + SupersedesTaskID pgtype.UUID `json:"supersedes_task_id"` + ControlFlags []byte `json:"control_flags"` + InterruptGeneration int32 `json:"interrupt_generation"` + StartedAt pgtype.Timestamptz `json:"started_at"` + InterruptedAt pgtype.Timestamptz `json:"interrupted_at"` + InterruptReason pgtype.Text `json:"interrupt_reason"` + EnqueuedAt pgtype.Timestamptz `json:"enqueued_at"` + PublishSubmitStartedAt pgtype.Timestamptz `json:"publish_submit_started_at"` } type DesktopTaskAttempt struct {