Skip to content

Conversation

@ChiragAgg5k
Copy link
Member

@ChiragAgg5k ChiragAgg5k commented Sep 25, 2025

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 25, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Bumps runtime to PHP 8.1 across Dockerfile, workflows, and composer. Pins Composer Docker image to 2.6 in workflows. Adds telemetry and compression to App/Response, expands HTTP status codes, and refactors routing/path handling. Extends validators (AnyOf, Domain restrictions, Host change). Updates tests and e2e server for new behaviors.

Changes

Cohort / File(s) Summary
CI workflows
.github/workflows/bench.yml, .github/workflows/codeql-analysis.yml
Pin Composer Docker image to composer:2.6.
Test workflow updates
.github/workflows/test.yml
Use PHP 8.1; switch to docker compose syntax.
Runtime base image
Dockerfile
Base image updated php:8.0-cli-alpinephp:8.1-cli-alpine; PHP env version adjusted.
Project requirements
composer.json, README.md
PHP requirement >=8.1; add utopia-php/compression, utopia-php/telemetry; Composer config tweaks; README requirement updated.
Core app instrumentation & compression
src/App.php, src/Response.php
Add telemetry (metrics, matchedRoute), compression config and flow; extend HTTP status codes; header/cookie APIs adjusted; nullable parameters in some methods; expanded send/stream logic.
Routing/path handling
src/Router.php, src/Route.php
Public Router::preparePath returns alias and params; track matched path; path param APIs accept path context; matching sets matched path.
Request API tweak
src/Request.php
getServer default parameter type made nullable.
Hooks metadata
src/Hook.php
param gains $deprecated and $example; stored in params.
Validators – new and enhanced
src/Validator/AnyOf.php, src/Validator/Domain.php, src/Validator/Host.php, src/Validator/ArrayList.php
New AnyOf validator; Domain adds restrictions and stricter validation; Host delegates to Hostname validator; minor formatting in ArrayList.
Unit tests
tests/AppTest.php, tests/ResponseTest.php, tests/Validator/*
Add tests for default callables, matching edge cases, error handling, Domain restrictions, wildcard host, AnyOf; minor formatting updates.
E2E client and server
tests/e2e/Client.php, tests/e2e/ResponseTest.php, tests/e2e/server.php
Client handles cookies, headers, request body, path; Response tests for early response, cookies, routing; server adds endpoints and enables compression.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Client
  participant App as App
  participant Rt as Router/Route
  participant H as Handlers
  participant R as Response

  Note over App,R: New telemetry + compression flow
  C->>App: HTTP Request
  App->>App: Start telemetry (activeRequests++, timers)
  App->>Rt: preparePath(path), match()
  Rt-->>App: Route (with matchedPath, params)
  App->>H: Execute action(s)
  H-->>App: Write to Response
  App->>R: Configure compression (accept-encoding, thresholds)
  alt Compressible and allowed
    R->>R: Compress body, set headers
  else No compression
    R->>R: Send as-is
  end
  App->>App: Record metrics (duration, sizes)
  R-->>C: Headers + Body
Loading
sequenceDiagram
  autonumber
  participant Dev as Developer
  participant Rt as Router
  participant Ro as Route

  Note over Rt,Ro: Path preparation and param mapping
  Dev->>Rt: addRoute("/databases/:db/collections/:col")
  Rt->>Rt: preparePath() -> [alias, params]
  Rt->>Ro: setPathParam(key, index, path)
  Dev->>Rt: addRouteAlias("/db/:db/c/:col", "/databases/:db/collections/:col")
  Rt->>Rt: preparePath(alias) -> [alias, params]
  Rt->>Ro: setPathParam(key, index, alias)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~70 minutes

Possibly related PRs

Suggested reviewers

  • Meldiron
  • christyjacob4
  • TorstenDittmann

Poem

I thump my paw at version’s gate,
PHP hops to 8.1—how great!
Telemetry twinkles, routes align,
Cookies crumble, responses shine.
Compress the breeze, let headers play—
A rabbit ships on CI day.
Hop hop, release away! 🐇✨

Pre-merge checks and finishing touches and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 58.02% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title refers to adding stack traces to error handlers, which is one aspect of the changeset, but it does not reflect the broader enhancements across telemetry instrumentation, compression support, expanded HTTP status codes, and workflow updates.

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 and usage tips.

@ChiragAgg5k ChiragAgg5k changed the base branch from master to 0.33.x September 25, 2025 08:25
@ChiragAgg5k ChiragAgg5k requested a review from Copilot September 25, 2025 08:27
Copy link

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 error handling to include stack traces in error messages when error handlers fail. The change improves debugging capabilities by providing more detailed error information.

  • Added stack trace information to error messages when error handlers encounter exceptions
  • Updated tests to accommodate the new error message format with stack traces

Reviewed Changes

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

File Description
src/App.php Modified error message format to include stack trace information in all error handler catch blocks
tests/AppTest.php Updated test assertions to verify the new error message format includes stack trace information

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ChiragAgg5k ChiragAgg5k merged commit 5aaa94d into 0.33.x Sep 25, 2025
5 checks passed
@ChiragAgg5k ChiragAgg5k deleted the update-error-handler-add-stack-trace branch September 25, 2025 10:44
@coderabbitai coderabbitai bot mentioned this pull request Oct 12, 2025
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.

3 participants