Skip to content

Bump utopia-php/http to 2.0.0-rc23 - #251

Merged
loks0n merged 3 commits into
mainfrom
chore/bump-utopia-http-rc23
Aug 24, 2026
Merged

Bump utopia-php/http to 2.0.0-rc23#251
loks0n merged 3 commits into
mainfrom
chore/bump-utopia-http-rc23

Conversation

@loks0n

@loks0n loks0n commented Aug 24, 2026

Copy link
Copy Markdown
Member

What

Moves utopia-php/http from an exact 2.0.0-rc18 pin to 2.0.0-rc23, and keeps the executor's map-shaped params accepting an empty JSON object.

Why

The exact rc18 pin here is the ceiling for every consumer of the executor. Downstream that pin holds utopia-php/validators at 0.3, which holds utopia-php/database at 7.1.1, which holds utopia-php/cache at 4.x — and cache 4.x will not take utopia-php/circuit-breaker 0.4. A circuit breaker bump in Appwrite Edge is unreachable until this moves.

What moves

http rc18 → rc23, and with it validators 0.3.2 → 0.5.0, storage 4.0.2 → 4.0.4, servers 0.4.7 → 0.4.8.

rc18 → rc23 adds no API. Three behavioural changes:

  • JSON request bodies decode an empty object to stdClass instead of collapsing it to [], so {} stays distinguishable from [].
  • The Swoole telemetry gauges register only on worker 0, rather than registering everywhere and returning null from the callback — Prometheus 3.13 and later rejects a whole OTLP request over one instrument with no data points.
  • Error-handler failures name their exception class in the message.

validators 0.3 → 0.5 is additive: new Identifier and Phone validators, and an opt-in requireNonBlank on Text.

The one real break, and the fix

The first of those is a contract change for this API. Assoc::isValid takes arrays only, so a body carrying "variables": {} validated on rc18 and 400s on rc23. It reaches three params:

  • POST /v1/runtimesvariables (Assoc)
  • POST /v1/runtimes/:runtimeId/executionsvariables and headers (AnyOf[Text, Assoc])

No param here wants the {} vs [] distinction — the object-shaped ones are string maps, and an empty map is an empty map however it was written. The request hook in app/http.php flattens an empty object back to [] before validation runs. Only the payload is rewritten, and only when it actually held one: a query string cannot contain such an object, and writing one back as the payload would move it.

Verified against the vendored rc23 that every shape accepted on rc18 — {}, {"A":"b"}, [], a string — is accepted again.

Testing

composer analyze, format:check, refactor:check and test:unit (35/35) all pass.

The e2e suite has not been run — no Docker on the machine this was prepared on, so CI is the first real run. testExecute gains one execution with variables and headers as empty objects, which is the case that regresses without the hook.

🤖 Generated with Claude Code

loks0n and others added 2 commits August 24, 2026 13:28
The exact rc18 pin here is the ceiling for every consumer of the
executor. Downstream, that pin holds utopia-php/validators at 0.3, which
holds utopia-php/database at 7.1.1, which holds utopia-php/cache at 4.x —
and cache 4.x will not take utopia-php/circuit-breaker 0.4. A patch
release of the circuit breaker is unreachable from here until this moves.

rc18 to rc23 adds no API: JSON bodies decode empty objects as stdClass
rather than collapsing them to [], the Swoole telemetry gauges register
on worker 0 instead of returning null from the callback (Prometheus 3.13
rejects an OTLP request carrying an instrument with no data points), and
error-handler failures name their exception class. validators 0.3 to 0.5
is additive: a new Identifier and Phone validator, and an opt-in
requireNonBlank on Text.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
rc23 decodes an empty JSON object to stdClass rather than collapsing it
to [], so `{}` stays distinguishable from `[]` in a request body. The
Assoc validator takes arrays only, so on rc18 `"variables": {}` was a
valid empty map and on rc23 it is a 400 — on POST /v1/runtimes
(variables) and on POST /v1/runtimes/:runtimeId/executions (variables
and headers, both AnyOf[Text, Assoc]).

No param here wants the distinction: the object-shaped ones are string
maps, and an empty map is an empty map however it was written. The
request hook flattens such an object back to [] before validation runs.
Only the payload is rewritten, and only when it held one, because a
query string cannot and writing one back as the payload would move it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown

Greptile Summary

The PR upgrades utopia-php/http to rc23 and normalizes top-level empty JSON objects so map-shaped request parameters remain backward compatible.

  • Converts empty top-level stdClass payload values to arrays before route validation.
  • Updates the Composer dependency graph for the new HTTP release.
  • Covers empty-object maps on both runtime creation and execution requests.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
app/http.php Adds request-payload normalization for empty JSON objects before parameter validation.
composer.json Updates the exact utopia-php/http release-candidate dependency from rc18 to rc23.
composer.lock Locks the updated HTTP package and its resolved validator, storage, server, protobuf, and Symfony dependencies.
tests/e2e/ExecutorTest.php Exercises empty-object map parameters on runtime creation and execution, resolving the previous coverage finding.

Reviews (2): Last reviewed commit: "test: cover the empty-object map on runt..." | Re-trigger Greptile

Comment thread tests/e2e/ExecutorTest.php
POST /v1/runtimes validates variables with Assoc, same as the execution
route, so it regresses the same way and had no case. The runtime this
test already creates carries the empty object, so the coverage is free.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@loks0n
loks0n merged commit b0269eb into main Aug 24, 2026
27 of 31 checks passed
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