Skip to content

Let the application register the status monitor route - #5

Merged
JustSteveKing merged 1 commit into
mainfrom
feature/app-owned-monitor-route
Oct 29, 2026
Merged

JustSteveKing merged 1 commit into
mainfrom
feature/app-owned-monitor-route

Conversation

@JustSteveKing

Copy link
Copy Markdown
Owner

The status monitor route is registered by the package, pointing at its own ShowOperation. An application that documents its API with controller attributes, as Kit does with Scribe, has nothing to put them on, and Kit's contract test then finds an undocumented v1/ route.

Pingback worked around it by registering its own route at the same URI and under the same name, relying on registration order to win.

Features::asyncOperations(['route' => false]) now leaves the route to the application. It registers its own, named Operations::ROUTE, which every 202's Location is built from, with a controller that returns ShowOperation's answer:

Route::get('/v1/operations/{operation}', ShowOperationController::class)
    ->middleware(['auth:sanctum'])
    ->name(Operations::ROUTE);
  • The default stays true, so nothing changes for anyone who doesn't set it.
  • README (a "Registering the monitor yourself" section and the options table), the Features::asyncOperations() option shape, and the Boost skill's writes reference all cover it.
  • New tests/AppMonitorRoute suite, with the option off: the package registers no route, and a 202 points at the application's route, which answers as the package's would. Both fail without the option.
  • Full suite passes, PHPStan and Pint are clean.

The monitor route is registered by the package, so an application that
documents its API with controller attributes, as Kit does with Scribe,
had no controller to put them on. Pingback registered its own route
over the package's, same URI and name, and relied on registration
order. Features::asyncOperations(['route' => false]) now leaves the
route to the application, which names it Operations::ROUTE so every
202's Location still points at it.
@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 224f11ca-7f33-4cd6-8cc2-ee070e79ebde
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@JustSteveKing JustSteveKing self-assigned this Oct 29, 2026
@JustSteveKing
JustSteveKing merged commit a947855 into main Oct 29, 2026
7 checks passed
@JustSteveKing
JustSteveKing deleted the feature/app-owned-monitor-route branch October 29, 2026 13:22
JustSteveKing added a commit that referenced this pull request Oct 30, 2026
The limiter counts whole seconds, so a run whose requests straddled a
second boundary got Retry-After: 59 and t=59 where the tests asserted
60. It failed CI once on PHP 8.4, on the merge of #5. With time frozen
in beforeEach, every request in a test lands in one second, and the
test that travels 20 seconds still does.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant