feat(strategy): add poke strategy - #1015
Conversation
I'm not sure we should do that. It should be up to the consumer to understand what the poke api does. We should not "lie" to the consumer telling them this is ready.
We should return the actual status of the session. Then, the poke usage in the proxy could allow: |
Good point. So i will make Sablier return actual status, plugin side will bypasses of strategy is poke |
4d7185b to
fa559f2
Compare
|
Can you add the openapi description in comments like it was done in the other routes ? Thanks, and then don't forget to run the generate command so that the documentation gets build automatically for you |
Starts instances and immediately returns ready without waiting for health checks. The reverse proxy passes the request through without blocking or showing a waiting page.
fa559f2 to
49247bb
Compare
done |
There was a problem hiding this comment.
Pull request overview
Adds a new “poke” loading strategy to Sablier’s HTTP API and documentation. The strategy triggers instance startup and returns immediately (without blocking/waiting-page behavior), letting reverse-proxy plugins decide how to proceed based on the returned session status.
Changes:
- Registers a new
GET /api/strategies/pokeroute and handler. - Adds API tests covering validation and success/error paths for the poke endpoint.
- Updates OpenAPI and strategy documentation to describe the new strategy.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/server/routes.go | Registers the new poke strategy route under /api. |
| internal/api/start_poke.go | Implements the poke strategy endpoint and Swagger annotations. |
| internal/api/start_poke_test.go | Adds unit tests for poke request validation and responses. |
| docs/static/openapi.json | Documents the new endpoint in the published OpenAPI spec. |
| docs/content/concepts/strategies.md | Adds conceptual documentation for the poke strategy and updates strategy selection guidance. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Ngoc Do <ngochust56@gmail.com>
fe0452d to
0429979
Compare
What
Adds the poke strategy — a new
GET /api/strategies/pokeendpoint that starts instances and returns the session status immediately without waiting for readiness. The plugin always passes the request through regardless ofX-Sablier-Session-Status.Useful when you want instances started but don't need them healthy before serving traffic — background workers, sidecar caches, companion processes the caller doesn't depend on.
Usage
GET /api/strategies/poke?group=myapp&session_duration=30m
Plugin config examples (separate PRs in each plugin repo):
Related