Skip to content

feat(strategy): add poke strategy - #1015

Open
ngoc-minh-do wants to merge 5 commits into
sablierapp:mainfrom
ngoc-minh-do:feat/poke-strategy
Open

feat(strategy): add poke strategy#1015
ngoc-minh-do wants to merge 5 commits into
sablierapp:mainfrom
ngoc-minh-do:feat/poke-strategy

Conversation

@ngoc-minh-do

@ngoc-minh-do ngoc-minh-do commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

What

Adds the poke strategy — a new GET /api/strategies/poke endpoint that starts instances and returns the session status immediately without waiting for readiness. The plugin always passes the request through regardless of X-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):

# Traefik
plugin:
  sablier:
    group: myapp
    poke: {}
# Caddy
sablier {
    group mygroup
    poke
}
// Proxy-WASM
{ "group": "mygroup", "poke": {} }

Related

  • sablier.ready-on-start=true label (already merged) — same behavior at the per-container level
  • Companion PRs in plugin repos: sablier-traefik-plugin, sablier-caddy-plugin, sablier-proxywasm-plugin

@ngoc-minh-do
ngoc-minh-do requested a review from acouvreur as a code owner July 10, 2026 22:45
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jul 10, 2026
@acouvreur

acouvreur commented Jul 10, 2026

Copy link
Copy Markdown
Member

and immediately returns X-Sablier-Session-Status: ready, skipping the health check.

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.

I think we should even return X-Sablier-Session-Status: unknown

We should return the actual status of the session. Then, the poke usage in the proxy could allow: continue on error for example.

@ngoc-minh-do

Copy link
Copy Markdown
Contributor Author

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.

I think we should even return X-Sablier-Session-Status: unknown

We should return the actual status of the session. Then, the poke usage in the proxy could allow: continue on error for example.

Good point. So i will make Sablier return actual status, plugin side will bypasses of strategy is poke

@acouvreur

Copy link
Copy Markdown
Member

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.
@ngoc-minh-do

Copy link
Copy Markdown
Contributor Author

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

done

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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/poke route 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.

Comment thread internal/api/start_poke.go
Comment thread docs/static/openapi.json Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Ngoc Do <ngochust56@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Comment thread docs/content/concepts/strategies.md Outdated
Comment thread internal/api/start_poke.go Outdated
Comment thread internal/api/start_poke.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants