feat: add PR comment for deployment status#5295
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (5)
📒 Files selected for processing (21)
📝 WalkthroughWalkthroughThis PR refactors GitHub deployment status reporting from an inline handler pattern to a dedicated Restate virtual object service. The old Changes
Sequence Diagram(s)sequenceDiagram
participant DW as Deploy Workflow
participant GS as GitHubStatusService
participant GC as GitHub Client
participant DB as Database
participant GA as GitHub API
DW->>GS: Init (repo, commit, branch, pr_number)
activate GS
GS->>DB: Load repo connection
GS->>GA: Create deployment (if no existing ID)
GA-->>GS: GitHub deployment ID
GS->>DB: Update deployment with GitHub ID
GS->>GC: Find PR by branch
GC->>GA: Query pull requests
GA-->>GC: PR number
GC-->>GS: PR number
GS->>GC: Find or create PR comment
GC->>GA: GET/POST comment
GA-->>GC: Comment ID
GC-->>GS: Comment ID
GS->>DB: Store GitHub IDs in Restate state
GS-->>DW: Init complete
deactivate GS
loop At each workflow boundary
DW->>GS: ReportStatus (state, description)
activate GS
GS->>DB: Read persisted config & IDs
alt GitHub deployment exists
GS->>GA: CreateDeploymentStatus (state, description)
GA-->>GS: Status updated (no-wait)
end
alt PR comment exists
GS->>GC: UpdateIssueComment (new row)
GC->>GA: PATCH comment
GA-->>GC: Comment updated (no-wait)
GC-->>GS: Done
end
GS-->>DW: ReportStatus complete
deactivate GS
end
sequenceDiagram
participant OldDW as Deploy Workflow (Old)
participant SR as StatusReporter (Old)
participant GH as GitHub API
participant DB as Database
OldDW->>SR: Create/Report status
activate SR
SR->>DB: Load repo connection
SR->>GH: CreateDeploymentStatus
GH-->>SR: Response
SR-->>OldDW: Done
deactivate SR
participant NewDW as Deploy Workflow (New)
participant NGS as GitHubStatusService (New)
participant NGC as GitHub Client (New)
NewDW->>NGS: ReportStatus (fire-and-forget)
activate NGS
NGS->>NGC: CreateDeploymentStatus & UpdateIssueComment
NGC->>GH: Parallel requests
GH-->>NGC: Responses (logged, not returned)
NGC-->>NGS: Done
NGS-->>NewDW: Returns immediately
deactivate NGS
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.11.3)Command failed Comment |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
1f59d61 to
a0f9eb8
Compare
7bcd633 to
3ded3ce
Compare
a0f9eb8 to
fdc18b3
Compare
3ded3ce to
b0fd3be
Compare
b0fd3be to
a0effc8
Compare
fdc18b3 to
5e195ef
Compare
a0effc8 to
2c18337
Compare
764db6e to
1ce4525
Compare
5c41b85 to
4df0fab
Compare
2c18337 to
468c209
Compare
468c209 to
dc1627b
Compare
4df0fab to
943b341
Compare
dc1627b to
3e055d9
Compare
01db7ed to
36a3aed
Compare
3e055d9 to
d8f659b
Compare
e3c9ee8 to
9684294
Compare
9684294 to
0e490c2
Compare
0e490c2 to
531b269
Compare
531b269 to
101b9b3
Compare
101b9b3 to
939c7dc
Compare
c933230 to
1425f22
Compare
1425f22 to
8ca4d20
Compare
939c7dc to
4557f1b
Compare
8b4f652 to
c909b42
Compare
4557f1b to
3134e2f
Compare

What does this PR do?
Refactors GitHub deployment status reporting by extracting it from the deploy service into a dedicated
GitHubStatusServicevirtual object. This new service manages both GitHub Deployments API status updates and PR comment creation/updates in a single, stateful component.The implementation includes:
GitHubStatusServicevirtual object keyed by deployment ID that persists GitHub deployment IDs and PR comment IDs in Restate stateInitmethod that creates GitHub deployments and PR comments with deployment status tablesReportStatusmethod that updates both GitHub deployment status and PR comment rowsUpdateGitHubDeploymentStatusRPC method and related status reporter classesType of change
How should this be tested?
Checklist
Required
pnpm buildpnpm fmtmake fmton/godirectoryconsole.logsgit pull origin mainAppreciated