style(postgres,gateway): adopt task fmt rewrites from the lane merge
This commit is contained in:
1 parent
f3a1ef6de1
commit
4ce4b46977
2 files changed
+36
-35
No files matched your search
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"slices"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -645,8 +646,8 @@ func (s *postgresSessionStore) RecentTurns(ctx context.Context, sessionID string
|
||||
}
|
||||
// RecentTurns orders newest-first; the contract returns oldest-first.
|
||||
out := make([]TurnRecord, 0, len(rows))
|
||||
for i := len(rows) - 1; i >= 0; i-- {
|
||||
record, err := turnFromRow(rows[i])
|
||||
for _, row := range slices.Backward(rows) {
|
||||
record, err := turnFromRow(row)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -49,39 +49,39 @@ const syntheticIssueNumberBase = 1_000_000_000_000_000
|
||||
// webui consume.
|
||||
func taskFromRow(t postgresdb.Task) *workflow.Task {
|
||||
return &workflow.Task{
|
||||
ID: t.ID,
|
||||
Owner: t.Owner,
|
||||
Repo: t.Repo,
|
||||
IssueNumber: int(t.IssueNumber),
|
||||
Title: t.Title,
|
||||
Body: t.Body,
|
||||
Labels: t.Labels,
|
||||
Status: t.Status,
|
||||
Workflow: t.Workflow,
|
||||
WorkflowDefinitionVersion: t.WorkflowDefinitionVersion,
|
||||
WorkflowDefinitionDigest: t.WorkflowDefinitionDigest,
|
||||
WorkflowDefinitionYAML: t.WorkflowDefinitionYaml,
|
||||
Stage: t.Stage,
|
||||
Branch: t.Branch,
|
||||
Plan: t.Plan,
|
||||
Notes: t.Notes,
|
||||
PRNumber: int(t.PrNumber),
|
||||
TokensUsed: int(t.TokensUsed),
|
||||
Iterations: int(t.Iterations),
|
||||
Attempt: int(t.Attempt),
|
||||
ParkReason: t.ParkReason,
|
||||
RetryCount: int(t.RetryCount),
|
||||
WatchCommentID: t.WatchCommentID,
|
||||
ReviewCursor: t.ReviewCursor,
|
||||
Source: t.Source,
|
||||
Identity: t.Identity,
|
||||
BindingID: t.BindingID,
|
||||
BindingVersion: int(t.BindingVersion),
|
||||
ReviewPayload: t.ReviewPayload,
|
||||
ParkClass: t.ParkClass,
|
||||
RemediationRounds: int(t.RemediationRounds),
|
||||
CreatedAt: t.CreatedAt,
|
||||
UpdatedAt: t.UpdatedAt,
|
||||
ID: t.ID,
|
||||
Owner: t.Owner,
|
||||
Repo: t.Repo,
|
||||
IssueNumber: int(t.IssueNumber),
|
||||
Title: t.Title,
|
||||
Body: t.Body,
|
||||
Labels: t.Labels,
|
||||
Status: t.Status,
|
||||
Workflow: t.Workflow,
|
||||
WorkflowDefinitionVersion: t.WorkflowDefinitionVersion,
|
||||
WorkflowDefinitionDigest: t.WorkflowDefinitionDigest,
|
||||
WorkflowDefinitionYAML: t.WorkflowDefinitionYaml,
|
||||
Stage: t.Stage,
|
||||
Branch: t.Branch,
|
||||
Plan: t.Plan,
|
||||
Notes: t.Notes,
|
||||
PRNumber: int(t.PrNumber),
|
||||
TokensUsed: int(t.TokensUsed),
|
||||
Iterations: int(t.Iterations),
|
||||
Attempt: int(t.Attempt),
|
||||
ParkReason: t.ParkReason,
|
||||
RetryCount: int(t.RetryCount),
|
||||
WatchCommentID: t.WatchCommentID,
|
||||
ReviewCursor: t.ReviewCursor,
|
||||
Source: t.Source,
|
||||
Identity: t.Identity,
|
||||
BindingID: t.BindingID,
|
||||
BindingVersion: int(t.BindingVersion),
|
||||
ReviewPayload: t.ReviewPayload,
|
||||
ParkClass: t.ParkClass,
|
||||
RemediationRounds: int(t.RemediationRounds),
|
||||
CreatedAt: t.CreatedAt,
|
||||
UpdatedAt: t.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user