Skip to content

Update trail watch review event endpoint#1245

Merged
dipree merged 1 commit into
mainfrom
trail-watch-review-events-endpoint
May 21, 2026
Merged

Update trail watch review event endpoint#1245
dipree merged 1 commit into
mainfrom
trail-watch-review-events-endpoint

Conversation

@dipree
Copy link
Copy Markdown
Contributor

@dipree dipree commented May 21, 2026

Summary

  • point entire trail watch at GET /api/v1/trails/:trail_id/reviews/events
  • keep Accept: text/event-stream SSE negotiation through the existing stream client
  • use the stable trail.id field from trail list responses before constructing the stream URL
  • update endpoint/id coverage

Tests

  • mise exec -- go test ./cmd/entire/cli ./cmd/entire/cli/api
  • mise exec -- golangci-lint run ./cmd/entire/cli ./cmd/entire/cli/api

@dipree dipree requested a review from a team as a code owner May 21, 2026 14:55
Copilot AI review requested due to automatic review settings May 21, 2026 14:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the entire trail watch command to consume code-review SSE events from the new trail-scoped endpoint while preserving existing Accept: text/event-stream negotiation via the stream client.

Changes:

  • Updated the streamed endpoint from query-based /api/v1/review-events?... to /api/v1/trails/:trail_id/review/events.
  • Updated reviewEventsPath to build the new path using url.PathEscape for the trail ID segment.
  • Adjusted unit test expectations to match the new endpoint path and escaping behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
cmd/entire/cli/trail_watch_cmd.go Updates help text and switches reviewEventsPath to the new trail-scoped review events SSE endpoint.
cmd/entire/cli/trail_watch_cmd_test.go Updates TestReviewEventsPath to validate the new endpoint path and path-segment escaping.

@dipree dipree force-pushed the trail-watch-review-events-endpoint branch 2 times, most recently from dee3523 to 24d48ab Compare May 21, 2026 15:45
Entire-Checkpoint: 2422cd59643f
@dipree dipree force-pushed the trail-watch-review-events-endpoint branch from 24d48ab to acd3d01 Compare May 21, 2026 15:48
@dipree dipree enabled auto-merge May 21, 2026 15:52
@dipree dipree merged commit 6d616b1 into main May 21, 2026
9 checks passed
@dipree dipree deleted the trail-watch-review-events-endpoint branch May 21, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants