Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/internal/cli/dto_drift_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (f *fakeSessionService) Send(context.Context, domain.SessionID, string) err
return nil
}

func (f *fakeSessionService) ListPRs(context.Context, domain.SessionID) ([]domain.PRFacts, error) {
func (f *fakeSessionService) ListPRSummaries(context.Context, domain.SessionID) ([]sessionsvc.PRSummary, error) {
return nil, nil
}

Expand Down
2 changes: 1 addition & 1 deletion backend/internal/domain/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ type SessionRecord struct {
// plus the derived display Status.
type Session struct {
SessionRecord
Status SessionStatus `json:"status"`
Status SessionStatus `json:"status" enum:"working,pr_open,draft,ci_failed,review_pending,changes_requested,approved,mergeable,merged,needs_input,idle,terminated,no_signal"`
TerminalHandleID string `json:"terminalHandleId,omitempty"`
}
210 changes: 209 additions & 1 deletion backend/internal/httpd/apispec/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,7 @@ components:
properties:
prs:
items:
$ref: '#/components/schemas/SessionPRFacts'
$ref: '#/components/schemas/SessionPRSummary'
type: array
sessionId:
type: string
Expand Down Expand Up @@ -1709,6 +1709,20 @@ components:
projectId:
type: string
status:
enum:
- working
- pr_open
- draft
- ci_failed
- review_pending
- changes_requested
- approved
- mergeable
- merged
- needs_input
- idle
- terminated
- no_signal
type: string
terminalHandleId:
type: string
Expand All @@ -1725,15 +1739,57 @@ components:
- updatedAt
- status
type: object
SessionPRCISummary:
properties:
failingChecks:
items:
$ref: '#/components/schemas/SessionPRFailingCheck'
type: array
state:
enum:
- unknown
- pending
- passing
- failing
type: string
required:
- state
- failingChecks
type: object
SessionPRConflictFile:
properties:
path:
type: string
url:
type: string
required:
- path
type: object
SessionPRFacts:
properties:
ci:
enum:
- unknown
- pending
- passing
- failing
type: string
mergeability:
enum:
- unknown
- mergeable
- conflicting
- blocked
- unstable
type: string
number:
type: integer
review:
enum:
- none
- approved
- changes_requested
- review_required
type: string
reviewComments:
type: boolean
Expand All @@ -1759,6 +1815,158 @@ components:
- reviewComments
- updatedAt
type: object
SessionPRFailingCheck:
properties:
conclusion:
type: string
name:
type: string
status:
enum:
- failed
- cancelled
type: string
url:
type: string
required:
- name
- status
- conclusion
type: object
SessionPRMergeabilitySummary:
properties:
conflictFiles:
items:
$ref: '#/components/schemas/SessionPRConflictFile'
type: array
prUrl:
type: string
reasons:
items:
type: string
type: array
state:
enum:
- unknown
- mergeable
- conflicting
- blocked
- unstable
type: string
required:
- state
- reasons
- prUrl
type: object
SessionPRReviewCommentLink:
properties:
file:
type: string
line:
type: integer
url:
type: string
type: object
SessionPRReviewSummary:
properties:
decision:
enum:
- none
- approved
- changes_requested
- review_required
type: string
hasUnresolvedHumanComments:
type: boolean
unresolvedBy:
items:
$ref: '#/components/schemas/SessionPRUnresolvedReviewer'
type: array
required:
- decision
- hasUnresolvedHumanComments
- unresolvedBy
type: object
SessionPRSummary:
properties:
author:
type: string
ci:
$ref: '#/components/schemas/SessionPRCISummary'
ciObservedAt:
format: date-time
type: string
headSha:
type: string
htmlUrl:
type: string
mergeability:
$ref: '#/components/schemas/SessionPRMergeabilitySummary'
number:
type: integer
observedAt:
format: date-time
type: string
provider:
enum:
- github
type: string
repo:
type: string
review:
$ref: '#/components/schemas/SessionPRReviewSummary'
reviewObservedAt:
format: date-time
type: string
sourceBranch:
type: string
state:
enum:
- draft
- open
- merged
- closed
type: string
targetBranch:
type: string
title:
type: string
updatedAt:
format: date-time
type: string
url:
type: string
required:
- url
- number
- title
- state
- provider
- repo
- author
- sourceBranch
- targetBranch
- headSha
- ci
- review
- mergeability
- updatedAt
type: object
SessionPRUnresolvedReviewer:
properties:
count:
type: integer
links:
items:
$ref: '#/components/schemas/SessionPRReviewCommentLink'
type: array
reviewerId:
type: string
required:
- reviewerId
- count
- links
type: object
SessionResponse:
properties:
session:
Expand Down
72 changes: 40 additions & 32 deletions backend/internal/httpd/apispec/specgen/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,38 +130,46 @@ var schemaNames = map[string]string{
"DomainAgentConfig": "AgentConfig",
"DomainRoleOverride": "RoleOverride",
// httpd/controllers (wire envelopes)
"ControllersListProjectsResponse": "ListProjectsResponse",
"ControllersProjectResponse": "ProjectResponse",
"ControllersGetProjectResponse": "ProjectGetResponse",
"ControllersProjectOrDegraded": "ProjectOrDegraded",
"ControllersListSessionsQuery": "ListSessionsQuery",
"ControllersCleanupSessionsQuery": "CleanupSessionsQuery",
"ControllersListSessionsResponse": "ListSessionsResponse",
"ControllersSpawnSessionRequest": "SpawnSessionRequest",
"ControllersSessionResponse": "SessionResponse",
"ControllersRenameSessionRequest": "RenameSessionRequest",
"ControllersRenameSessionResponse": "RenameSessionResponse",
"ControllersRestoreSessionResponse": "RestoreSessionResponse",
"ControllersCleanupSessionsResponse": "CleanupSessionsResponse",
"ControllersCleanupSkippedSession": "CleanupSkippedSession",
"ControllersKillSessionResponse": "KillSessionResponse",
"ControllersRollbackSessionResponse": "RollbackSessionResponse",
"ControllersSendSessionMessageRequest": "SendSessionMessageRequest",
"ControllersSendSessionMessageResponse": "SendSessionMessageResponse",
"ControllersClaimPRResponse": "ClaimPRResponse",
"ControllersClaimPRRequest": "ClaimPRRequest",
"ControllersSessionPRFacts": "SessionPRFacts",
"ControllersListSessionPRsResponse": "ListSessionPRsResponse",
"ControllersSetActivityRequest": "SetActivityRequest",
"ControllersSetActivityResponse": "SetActivityResponse",
"ControllersSpawnOrchestratorRequest": "SpawnOrchestratorRequest",
"ControllersSpawnOrchestratorResponse": "SpawnOrchestratorResponse",
"ControllersOrchestratorResponse": "OrchestratorResponse",
"ControllersListNotificationsQuery": "ListNotificationsQuery",
"ControllersNotificationStreamQuery": "NotificationStreamQuery",
"ControllersNotificationTarget": "NotificationTarget",
"ControllersNotificationResponse": "NotificationResponse",
"ControllersListNotificationsResponse": "ListNotificationsResponse",
"ControllersListProjectsResponse": "ListProjectsResponse",
"ControllersProjectResponse": "ProjectResponse",
"ControllersGetProjectResponse": "ProjectGetResponse",
"ControllersProjectOrDegraded": "ProjectOrDegraded",
"ControllersListSessionsQuery": "ListSessionsQuery",
"ControllersCleanupSessionsQuery": "CleanupSessionsQuery",
"ControllersListSessionsResponse": "ListSessionsResponse",
"ControllersSpawnSessionRequest": "SpawnSessionRequest",
"ControllersSessionResponse": "SessionResponse",
"ControllersRenameSessionRequest": "RenameSessionRequest",
"ControllersRenameSessionResponse": "RenameSessionResponse",
"ControllersRestoreSessionResponse": "RestoreSessionResponse",
"ControllersCleanupSessionsResponse": "CleanupSessionsResponse",
"ControllersCleanupSkippedSession": "CleanupSkippedSession",
"ControllersKillSessionResponse": "KillSessionResponse",
"ControllersRollbackSessionResponse": "RollbackSessionResponse",
"ControllersSendSessionMessageRequest": "SendSessionMessageRequest",
"ControllersSendSessionMessageResponse": "SendSessionMessageResponse",
"ControllersClaimPRResponse": "ClaimPRResponse",
"ControllersClaimPRRequest": "ClaimPRRequest",
"ControllersSessionPRFacts": "SessionPRFacts",
"ControllersSessionPRSummary": "SessionPRSummary",
"ControllersSessionPRCISummary": "SessionPRCISummary",
"ControllersSessionPRFailingCheck": "SessionPRFailingCheck",
"ControllersSessionPRReviewSummary": "SessionPRReviewSummary",
"ControllersSessionPRUnresolvedReviewer": "SessionPRUnresolvedReviewer",
"ControllersSessionPRReviewCommentLink": "SessionPRReviewCommentLink",
"ControllersSessionPRMergeabilitySummary": "SessionPRMergeabilitySummary",
"ControllersSessionPRConflictFile": "SessionPRConflictFile",
"ControllersListSessionPRsResponse": "ListSessionPRsResponse",
"ControllersSetActivityRequest": "SetActivityRequest",
"ControllersSetActivityResponse": "SetActivityResponse",
"ControllersSpawnOrchestratorRequest": "SpawnOrchestratorRequest",
"ControllersSpawnOrchestratorResponse": "SpawnOrchestratorResponse",
"ControllersOrchestratorResponse": "OrchestratorResponse",
"ControllersListNotificationsQuery": "ListNotificationsQuery",
"ControllersNotificationStreamQuery": "NotificationStreamQuery",
"ControllersNotificationTarget": "NotificationTarget",
"ControllersNotificationResponse": "NotificationResponse",
"ControllersListNotificationsResponse": "ListNotificationsResponse",
// httpd/controllers — PR wire envelopes
"ControllersMergePRResponse": "MergePRResponse",
"ControllersResolveCommentsRequest": "ResolveCommentsRequest",
Expand Down
Loading