Compare commits

..
Author SHA1 Message Date
Eldad A. FuxandGitHub e5c34a0ed3 Merge branch '1.8.x' into fix-build-user-errors 2026-03-14 15:00:27 +01:00
eldadfux 062da7d635 Update to keep older logs 2026-03-10 14:04:26 +01:00
eldadfux fd9543b48f Fix for user errors on builds 2026-03-09 20:19:33 +01:00
29 changed files with 931 additions and 88855 deletions
+18 -73
View File
@@ -84,31 +84,6 @@ jobs:
sarif_file: 'trivy-fs-results.sarif'
category: 'trivy-source'
composer:
name: Checks / Composer
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: composer:v2
coverage: none
- name: Validate
run: composer validate
- name: Install dependencies
run: composer install --prefer-dist --no-progress --ignore-platform-reqs
- name: Audit
env:
COMPOSER_NO_AUDIT: 0
run: composer audit
format:
name: Checks / Format
runs-on: ubuntu-latest
@@ -121,18 +96,15 @@ jobs:
- run: git checkout HEAD^2
if: github.event_name == 'pull_request'
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: composer:v2
coverage: none
- name: Install dependencies
run: composer install --prefer-dist --no-progress --ignore-platform-reqs
- name: Validate composer.json and composer.lock
run: |
docker run --rm -v $PWD:/app composer:2.8 sh -c \
"composer validate"
- name: Run Linter
run: composer lint
run: |
docker run --rm -v $PWD:/app composer:2.8 sh -c \
"composer install --profile --ignore-platform-reqs && composer lint"
analyze:
name: Checks / Analyze
@@ -141,33 +113,15 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v6
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: composer:v2
coverage: none
- name: Install dependencies
run: composer install --prefer-dist --no-progress --ignore-platform-reqs
- name: Run PHPStan
run: composer analyze
locale:
name: Checks / Locale
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v6
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '24'
run: |
docker run --rm -v $PWD:/app composer:2.8 sh -c \
"composer install --profile --ignore-platform-reqs && composer check"
- name: Run Locale check
run: node .github/workflows/static-analysis/locale/index.js
run: |
docker run --rm -v $PWD:/app node:24-alpine sh -c \
"cd /app/.github/workflows/static-analysis/locale && node index.js"
matrix:
name: Tests / Matrix
@@ -194,22 +148,14 @@ jobs:
return;
}
const getContent = (ref) => github.rest.repos.getContent({
const files = await github.paginate(github.rest.pulls.listFiles, {
owner: context.repo.owner,
repo: context.repo.repo,
path: 'composer.lock',
ref,
pull_number: pr.number,
});
const getDbVersion = (lock) => lock.packages?.find(p => p.name === 'utopia-php/database')?.version;
const [{ data: base }, { data: head }] = await Promise.all([
getContent(pr.base.sha),
getContent(pr.head.sha),
]);
const decode = (content) => JSON.parse(Buffer.from(content, 'base64').toString());
const databaseChanged = getDbVersion(decode(base.content)) !== getDbVersion(decode(head.content));
const lockFile = files.find(f => f.filename === 'composer.lock');
const databaseChanged = lockFile?.patch?.includes('"name": "utopia-php/database"') ?? false;
core.setOutput('databases', JSON.stringify(databaseChanged ? allDatabases : defaultDatabases));
core.setOutput('modes', JSON.stringify(databaseChanged ? allModes : defaultModes));
@@ -378,7 +324,6 @@ jobs:
Avatars,
Console,
Databases,
TablesDB,
Functions,
FunctionsSchedule,
GraphQL,
@@ -467,7 +412,7 @@ jobs:
# Services that rely on sequential test method execution (shared static state)
FUNCTIONAL_FLAG="--functional"
case "${{ matrix.service }}" in
Databases|TablesDB|Functions|Realtime) FUNCTIONAL_FLAG="" ;;
Databases|Functions|Realtime) FUNCTIONAL_FLAG="" ;;
esac
docker compose exec -T \
+6 -4
View File
@@ -13,7 +13,8 @@
"test": "vendor/bin/phpunit",
"lint": "vendor/bin/pint --test --config pint.json",
"format": "vendor/bin/pint --config pint.json",
"analyze": "./vendor/bin/phpstan analyse -c phpstan.neon --memory-limit=1G"
"bench": "vendor/bin/phpbench run --report=benchmark",
"check": "./vendor/bin/phpstan analyse -c phpstan.neon"
},
"autoload": {
"psr-4": {
@@ -57,7 +58,7 @@
"utopia-php/compression": "0.1.*",
"utopia-php/config": "1.*",
"utopia-php/console": "0.1.*",
"utopia-php/database": "dev-chore/remove-databases as 5.3.12",
"utopia-php/database": "5.*",
"utopia-php/detector": "0.2.*",
"utopia-php/domains": "1.*",
"utopia-php/emails": "0.6.*",
@@ -98,10 +99,11 @@
"brianium/paratest": "7.*",
"phpunit/phpunit": "12.*",
"swoole/ide-helper": "6.*",
"phpstan/phpstan": "^2.0",
"phpstan/phpstan": "1.12.*",
"textalk/websocket": "1.5.*",
"czproject/git-php": "4.*",
"laravel/pint": "1.*"
"laravel/pint": "1.*",
"phpbench/phpbench": "1.*"
},
"provide": {
"ext-phpiredis": "*"
Generated
+691 -27
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "ef6c35e2f0de3e1b0311b987688ae023",
"content-hash": "b99693284208ff3d006260a089a4f7b9",
"packages": [
{
"name": "adhocore/jwt",
@@ -3850,16 +3850,16 @@
},
{
"name": "utopia-php/database",
"version": "dev-chore/remove-databases",
"version": "5.3.8",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/database.git",
"reference": "2242d29d815351bad23dfcbce9540280365af0a4"
"reference": "4920bb60afb98d4bd81f4d331765716ae1d40255"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/database/zipball/2242d29d815351bad23dfcbce9540280365af0a4",
"reference": "2242d29d815351bad23dfcbce9540280365af0a4",
"url": "https://api.github.com/repos/utopia-php/database/zipball/4920bb60afb98d4bd81f4d331765716ae1d40255",
"reference": "4920bb60afb98d4bd81f4d331765716ae1d40255",
"shasum": ""
},
"require": {
@@ -3868,10 +3868,9 @@
"ext-pdo": "*",
"php": ">=8.4",
"utopia-php/cache": "1.*",
"utopia-php/console": "0.1.*",
"utopia-php/framework": "0.33.*",
"utopia-php/mongo": "1.*",
"utopia-php/pools": "1.*",
"utopia-php/validators": "0.2.*"
"utopia-php/pools": "1.*"
},
"require-dev": {
"fakerphp/faker": "1.23.*",
@@ -3881,7 +3880,7 @@
"phpunit/phpunit": "9.*",
"rregeer/phpunit-coverage-check": "0.3.*",
"swoole/ide-helper": "5.1.3",
"utopia-php/cli": "0.22.*"
"utopia-php/cli": "0.14.*"
},
"type": "library",
"autoload": {
@@ -3903,9 +3902,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/database/issues",
"source": "https://github.com/utopia-php/database/tree/chore/remove-databases"
"source": "https://github.com/utopia-php/database/tree/5.3.8"
},
"time": "2026-03-15T15:05:11+00:00"
"time": "2026-03-11T01:03:34+00:00"
},
{
"name": "utopia-php/detector",
@@ -5645,6 +5644,160 @@
],
"time": "2025-11-10T07:24:07+00:00"
},
{
"name": "doctrine/annotations",
"version": "2.0.2",
"source": {
"type": "git",
"url": "https://github.com/doctrine/annotations.git",
"reference": "901c2ee5d26eb64ff43c47976e114bf00843acf7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/annotations/zipball/901c2ee5d26eb64ff43c47976e114bf00843acf7",
"reference": "901c2ee5d26eb64ff43c47976e114bf00843acf7",
"shasum": ""
},
"require": {
"doctrine/lexer": "^2 || ^3",
"ext-tokenizer": "*",
"php": "^7.2 || ^8.0",
"psr/cache": "^1 || ^2 || ^3"
},
"require-dev": {
"doctrine/cache": "^2.0",
"doctrine/coding-standard": "^10",
"phpstan/phpstan": "^1.10.28",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
"symfony/cache": "^5.4 || ^6.4 || ^7",
"vimeo/psalm": "^4.30 || ^5.14"
},
"suggest": {
"php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations"
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Docblock Annotations Parser",
"homepage": "https://www.doctrine-project.org/projects/annotations.html",
"keywords": [
"annotations",
"docblock",
"parser"
],
"support": {
"issues": "https://github.com/doctrine/annotations/issues",
"source": "https://github.com/doctrine/annotations/tree/2.0.2"
},
"abandoned": true,
"time": "2024-09-05T10:17:24+00:00"
},
{
"name": "doctrine/lexer",
"version": "3.0.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/lexer.git",
"reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/lexer/zipball/31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd",
"reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd",
"shasum": ""
},
"require": {
"php": "^8.1"
},
"require-dev": {
"doctrine/coding-standard": "^12",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.5",
"psalm/plugin-phpunit": "^0.18.3",
"vimeo/psalm": "^5.21"
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Common\\Lexer\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.",
"homepage": "https://www.doctrine-project.org/projects/lexer.html",
"keywords": [
"annotations",
"docblock",
"lexer",
"parser",
"php"
],
"support": {
"issues": "https://github.com/doctrine/lexer/issues",
"source": "https://github.com/doctrine/lexer/tree/3.0.1"
},
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer",
"type": "tidelift"
}
],
"time": "2024-02-05T11:56:58+00:00"
},
{
"name": "fidry/cpu-core-counter",
"version": "1.3.0",
@@ -6193,16 +6346,165 @@
"time": "2022-02-21T01:04:05+00:00"
},
{
"name": "phpstan/phpstan",
"version": "2.1.40",
"name": "phpbench/container",
"version": "2.2.3",
"source": {
"type": "git",
"url": "https://github.com/phpbench/container.git",
"reference": "0c7b2d36c1ea53fe27302fb8873ded7172047196"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/9b2c7aeb83a75d8680ea5e7c9b7fca88052b766b",
"reference": "9b2c7aeb83a75d8680ea5e7c9b7fca88052b766b",
"url": "https://api.github.com/repos/phpbench/container/zipball/0c7b2d36c1ea53fe27302fb8873ded7172047196",
"reference": "0c7b2d36c1ea53fe27302fb8873ded7172047196",
"shasum": ""
},
"require": {
"php": "^7.4|^8.0"
"psr/container": "^1.0|^2.0",
"symfony/options-resolver": "^4.2 || ^5.0 || ^6.0 || ^7.0 || ^8.0"
},
"require-dev": {
"php-cs-fixer/shim": "^3.89",
"phpstan/phpstan": "^0.12.52",
"phpunit/phpunit": "^8"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.x-dev"
}
},
"autoload": {
"psr-4": {
"PhpBench\\DependencyInjection\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Daniel Leech",
"email": "daniel@dantleech.com"
}
],
"description": "Simple, configurable, service container.",
"support": {
"issues": "https://github.com/phpbench/container/issues",
"source": "https://github.com/phpbench/container/tree/2.2.3"
},
"time": "2025-11-06T09:05:13+00:00"
},
{
"name": "phpbench/phpbench",
"version": "1.4.3",
"source": {
"type": "git",
"url": "https://github.com/phpbench/phpbench.git",
"reference": "b641dde59d969ea42eed70a39f9b51950bc96878"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpbench/phpbench/zipball/b641dde59d969ea42eed70a39f9b51950bc96878",
"reference": "b641dde59d969ea42eed70a39f9b51950bc96878",
"shasum": ""
},
"require": {
"doctrine/annotations": "^2.0",
"ext-dom": "*",
"ext-json": "*",
"ext-pcre": "*",
"ext-reflection": "*",
"ext-spl": "*",
"ext-tokenizer": "*",
"php": "^8.1",
"phpbench/container": "^2.2",
"psr/log": "^1.1 || ^2.0 || ^3.0",
"seld/jsonlint": "^1.1",
"symfony/console": "^6.1 || ^7.0 || ^8.0",
"symfony/filesystem": "^6.1 || ^7.0 || ^8.0",
"symfony/finder": "^6.1 || ^7.0 || ^8.0",
"symfony/options-resolver": "^6.1 || ^7.0 || ^8.0",
"symfony/process": "^6.1 || ^7.0 || ^8.0",
"webmozart/glob": "^4.6"
},
"require-dev": {
"dantleech/invoke": "^2.0",
"ergebnis/composer-normalize": "^2.39",
"jangregor/phpstan-prophecy": "^1.0",
"php-cs-fixer/shim": "^3.9",
"phpspec/prophecy": "^1.22",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^10.4 || ^11.0",
"rector/rector": "^1.2",
"symfony/error-handler": "^6.1 || ^7.0 || ^8.0",
"symfony/var-dumper": "^6.1 || ^7.0 || ^8.0"
},
"suggest": {
"ext-xdebug": "For Xdebug profiling extension."
},
"bin": [
"bin/phpbench"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.2-dev"
}
},
"autoload": {
"files": [
"lib/Report/Func/functions.php"
],
"psr-4": {
"PhpBench\\": "lib/",
"PhpBench\\Extensions\\XDebug\\": "extensions/xdebug/lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Daniel Leech",
"email": "daniel@dantleech.com"
}
],
"description": "PHP Benchmarking Framework",
"keywords": [
"benchmarking",
"optimization",
"performance",
"profiling",
"testing"
],
"support": {
"issues": "https://github.com/phpbench/phpbench/issues",
"source": "https://github.com/phpbench/phpbench/tree/1.4.3"
},
"funding": [
{
"url": "https://github.com/dantleech",
"type": "github"
}
],
"time": "2025-11-06T19:07:31+00:00"
},
{
"name": "phpstan/phpstan",
"version": "1.12.32",
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/2770dcdf5078d0b0d53f94317e06affe88419aa8",
"reference": "2770dcdf5078d0b0d53f94317e06affe88419aa8",
"shasum": ""
},
"require": {
"php": "^7.2|^8.0"
},
"conflict": {
"phpstan/phpstan-shim": "*"
@@ -6243,7 +6545,7 @@
"type": "github"
}
],
"time": "2026-02-23T15:04:35+00:00"
"time": "2025-09-30T10:16:31+00:00"
},
{
"name": "phpunit/php-code-coverage",
@@ -6697,6 +6999,55 @@
],
"time": "2026-02-18T12:38:40+00:00"
},
{
"name": "psr/cache",
"version": "3.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/cache.git",
"reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf",
"reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf",
"shasum": ""
},
"require": {
"php": ">=8.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Cache\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for caching libraries",
"keywords": [
"cache",
"psr",
"psr-6"
],
"support": {
"source": "https://github.com/php-fig/cache/tree/3.0.0"
},
"time": "2021-02-03T23:26:27+00:00"
},
{
"name": "sebastian/cli-parser",
"version": "4.2.0",
@@ -7594,6 +7945,70 @@
],
"time": "2025-02-07T05:00:38+00:00"
},
{
"name": "seld/jsonlint",
"version": "1.11.0",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/jsonlint.git",
"reference": "1748aaf847fc731cfad7725aec413ee46f0cc3a2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/1748aaf847fc731cfad7725aec413ee46f0cc3a2",
"reference": "1748aaf847fc731cfad7725aec413ee46f0cc3a2",
"shasum": ""
},
"require": {
"php": "^5.3 || ^7.0 || ^8.0"
},
"require-dev": {
"phpstan/phpstan": "^1.11",
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^8.5.13"
},
"bin": [
"bin/jsonlint"
],
"type": "library",
"autoload": {
"psr-4": {
"Seld\\JsonLint\\": "src/Seld/JsonLint/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jordi Boggiano",
"email": "j.boggiano@seld.be",
"homepage": "https://seld.be"
}
],
"description": "JSON Linter",
"keywords": [
"json",
"linter",
"parser",
"validator"
],
"support": {
"issues": "https://github.com/Seldaek/jsonlint/issues",
"source": "https://github.com/Seldaek/jsonlint/tree/1.11.0"
},
"funding": [
{
"url": "https://github.com/Seldaek",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/seld/jsonlint",
"type": "tidelift"
}
],
"time": "2024-07-11T14:55:45+00:00"
},
{
"name": "staabm/side-effects-detector",
"version": "1.0.5",
@@ -7768,6 +8183,215 @@
],
"time": "2026-01-13T13:06:50+00:00"
},
{
"name": "symfony/filesystem",
"version": "v8.0.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
"reference": "d937d400b980523dc9ee946bb69972b5e619058d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/d937d400b980523dc9ee946bb69972b5e619058d",
"reference": "d937d400b980523dc9ee946bb69972b5e619058d",
"shasum": ""
},
"require": {
"php": ">=8.4",
"symfony/polyfill-ctype": "~1.8",
"symfony/polyfill-mbstring": "~1.8"
},
"require-dev": {
"symfony/process": "^7.4|^8.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Symfony\\Component\\Filesystem\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Provides basic utilities for the filesystem",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/filesystem/tree/v8.0.1"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://github.com/nicolas-grekas",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2025-12-01T09:13:36+00:00"
},
{
"name": "symfony/finder",
"version": "v8.0.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
"reference": "8bd576e97c67d45941365bf824e18dc8538e6eb0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/8bd576e97c67d45941365bf824e18dc8538e6eb0",
"reference": "8bd576e97c67d45941365bf824e18dc8538e6eb0",
"shasum": ""
},
"require": {
"php": ">=8.4"
},
"require-dev": {
"symfony/filesystem": "^7.4|^8.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Symfony\\Component\\Finder\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Finds files and directories via an intuitive fluent interface",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/finder/tree/v8.0.5"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://github.com/nicolas-grekas",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2026-01-26T15:08:38+00:00"
},
{
"name": "symfony/options-resolver",
"version": "v8.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/options-resolver.git",
"reference": "d2b592535ffa6600c265a3893a7f7fd2bad82dd7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/d2b592535ffa6600c265a3893a7f7fd2bad82dd7",
"reference": "d2b592535ffa6600c265a3893a7f7fd2bad82dd7",
"shasum": ""
},
"require": {
"php": ">=8.4",
"symfony/deprecation-contracts": "^2.5|^3"
},
"type": "library",
"autoload": {
"psr-4": {
"Symfony\\Component\\OptionsResolver\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Provides an improved replacement for the array_replace PHP function",
"homepage": "https://symfony.com",
"keywords": [
"config",
"configuration",
"options"
],
"support": {
"source": "https://github.com/symfony/options-resolver/tree/v8.0.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://github.com/nicolas-grekas",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2025-11-12T15:55:31+00:00"
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.33.0",
@@ -8430,20 +9054,60 @@
}
],
"time": "2024-11-07T12:36:22+00:00"
}
],
"aliases": [
},
{
"package": "utopia-php/database",
"version": "dev-chore/remove-databases",
"alias": "5.3.12",
"alias_normalized": "5.3.12.0"
"name": "webmozart/glob",
"version": "4.7.0",
"source": {
"type": "git",
"url": "https://github.com/webmozarts/glob.git",
"reference": "8a2842112d6916e61e0e15e316465b611f3abc17"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webmozarts/glob/zipball/8a2842112d6916e61e0e15e316465b611f3abc17",
"reference": "8a2842112d6916e61e0e15e316465b611f3abc17",
"shasum": ""
},
"require": {
"php": "^7.3 || ^8.0.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"symfony/filesystem": "^5.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.1-dev"
}
},
"autoload": {
"psr-4": {
"Webmozart\\Glob\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Bernhard Schussek",
"email": "bschussek@gmail.com"
}
],
"description": "A PHP implementation of Ant's glob.",
"support": {
"issues": "https://github.com/webmozarts/glob/issues",
"source": "https://github.com/webmozarts/glob/tree/4.7.0"
},
"time": "2024-03-07T20:33:40+00:00"
}
],
"aliases": [],
"minimum-stability": "dev",
"stability-flags": {
"utopia-php/database": 20
},
"stability-flags": {},
"prefer-stable": true,
"prefer-lowest": false,
"platform": {
-10
View File
@@ -1,10 +0,0 @@
{
"name": "@appwrite.io/repo",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@appwrite.io/repo"
}
}
}
+6
View File
@@ -0,0 +1,6 @@
{
"$schema":"vendor/phpbench/phpbench/phpbench.schema.json",
"runner.bootstrap": "vendor/autoload.php",
"runner.path": "tests",
"runner.file_pattern": "*Bench.php"
}
-83215
View File
File diff suppressed because it is too large Load Diff
+5 -9
View File
@@ -1,17 +1,13 @@
includes:
- phpstan-baseline.neon
parameters:
level: max
level: 8
paths:
- src
- app
- bin
- tests
- src/Utopia/Bus
- src/Appwrite/Bus
- src/Appwrite/Transformation
bootstrapFiles:
- app/init/constants.php
scanDirectories:
- vendor/swoole/ide-helper
excludePaths:
- tests/resources
- app/sdks
@@ -216,18 +216,45 @@ class Builds extends Action
}
if ($resource->getCollection() === 'functions' && empty($deployment->getAttribute('entrypoint', ''))) {
throw new \Exception('Entrypoint for your Appwrite Function is missing. Please specify it when making deployment or update the entrypoint under your function\'s "Settings" > "Configuration" > "Entrypoint".');
$this->markDeploymentFailed(
$dbForProject,
$dbForPlatform,
$deployment,
$resource,
$project,
$queueForRealtime,
$queueForStatsUsage,
$github,
$platform,
$durationStart,
'Entrypoint for your Appwrite Function is missing. Please specify it when making deployment or update the entrypoint under your function\'s "Settings" > "Configuration" > "Entrypoint".'
);
return;
}
$version = $this->getVersion($resource);
$runtime = $this->getRuntime($resource, $version);
$spec = Config::getParam('specifications')[$resource->getAttribute('buildSpecification', APP_COMPUTE_SPECIFICATION_DEFAULT)];
if ($resource->getCollection() === 'functions' && \is_null($runtime)) {
throw new \Exception('Runtime "' . $resource->getAttribute('runtime', '') . '" is not supported');
if (\is_null($runtime)) {
$runtimeLabel = $resource->getAttribute('runtime', '') ?: $resource->getAttribute('buildRuntime', '');
$this->markDeploymentFailed(
$dbForProject,
$dbForPlatform,
$deployment,
$resource,
$project,
$queueForRealtime,
$queueForStatsUsage,
$github,
$platform,
$durationStart,
'Runtime "' . $runtimeLabel . '" is not supported'
);
return;
}
$spec = Config::getParam('specifications')[$resource->getAttribute('buildSpecification', APP_COMPUTE_SPECIFICATION_DEFAULT)];
// Realtime preparation
$event = "{$resource->getCollection()}.[{$resourceKey}].deployments.[deploymentId].update";
$queueForRealtime
@@ -1291,18 +1318,19 @@ class Builds extends Action
}
}
protected function getRuntime(Document $resource, string $version): array
/**
* @return array|null Runtime config array, or null if the runtime is not supported (caller should fail deployment for functions).
*/
protected function getRuntime(Document $resource, string $version): ?array
{
$runtimes = Config::getParam($version === 'v2' ? 'runtimes-v2' : 'runtimes', []);
$key = $resource->getAttribute('runtime');
$runtime = match ($resource->getCollection()) {
'functions' => $runtimes[$resource->getAttribute('runtime')] ?? null,
'sites' => $runtimes[$resource->getAttribute('buildRuntime')] ?? null,
default => null
};
if (\is_null($runtime)) {
throw new \Exception('Runtime "' . $resource->getAttribute('runtime', '') . '" is not supported');
}
return $runtime;
}
@@ -1315,6 +1343,62 @@ class Builds extends Action
};
}
/**
* Mark a deployment as failed with a user-facing message (e.g. validation / bad config).
* Updates the deployment, resource, realtime, optional VCS status, and usage — then returns.
* Use this instead of throwing for failures caused by bad user input so the error is shown
* in build logs and not reported as an unhandled exception (e.g. to Sentry).
*/
protected function markDeploymentFailed(
Database $dbForProject,
Database $dbForPlatform,
Document $deployment,
Document $resource,
Document $project,
Realtime $queueForRealtime,
StatsUsage $queueForStatsUsage,
GitHub $github,
array $platform,
float $durationStart,
string $message
): void {
$deploymentId = $deployment->getId();
$endTime = DateTime::now();
$durationEnd = \microtime(true);
$buildDuration = (int) \ceil($durationEnd - $durationStart);
$existingLogs = $deployment->getAttribute('buildLogs', '');
$buildLogs = empty($existingLogs) ? $message : $existingLogs . "\n" . $message;
$deployment = $dbForProject->updateDocument('deployments', $deploymentId, new Document([
'buildEndedAt' => $endTime,
'buildDuration' => $buildDuration,
'status' => 'failed',
'buildLogs' => $buildLogs,
]));
if ($deployment->getSequence() === $resource->getAttribute('latestDeploymentInternalId', '')) {
$dbForProject->updateDocument($resource->getCollection(), $resource->getId(), new Document(['latestDeploymentStatus' => 'failed']));
}
$queueForRealtime
->setPayload($deployment->getArrayCopy())
->trigger();
$providerRepositoryId = $deployment->getAttribute('providerRepositoryId', '');
if (!empty($providerRepositoryId)) {
$installationId = $deployment->getAttribute('installationId', '');
$installation = $dbForPlatform->getDocument('installations', $installationId);
$providerInstallationId = $installation->getAttribute('providerInstallationId');
$github->initializeVariables($providerInstallationId, System::getEnv('_APP_VCS_GITHUB_PRIVATE_KEY'), System::getEnv('_APP_VCS_GITHUB_APP_ID'));
$owner = $deployment->getAttribute('providerRepositoryOwner', $github->getOwnerName($providerInstallationId));
$repositoryName = $deployment->getAttribute('providerRepositoryName', $github->getRepositoryName($providerRepositoryId));
$this->runGitAction('failed', $github, $deployment->getAttribute('providerCommitHash', ''), $owner, $repositoryName, $project, $resource, $deploymentId, $dbForProject, $dbForPlatform, $queueForRealtime, $platform);
}
$this->sendUsage($resource, $deployment, $project, $queueForStatsUsage);
}
protected function getCommand(Document $resource, Document $deployment): string
{
if ($resource->getCollection() === 'functions') {
+1 -8
View File
@@ -299,14 +299,7 @@ class Client
$responseHeaders['status-code'] = $responseStatus;
if ($responseStatus === 500) {
$errorPrefix = 'Server error(' . $method . ': ' . $path . '. Params: ' . json_encode($params) . '): ';
if (str_contains($responseType, 'text/html')) {
preg_match('/<title[^>]*>(.*?)<\/title>/si', is_string($responseBody) ? $responseBody : '', $matches);
$title = strip_tags($matches[1] ?? 'HTML response received');
echo $errorPrefix . '[HTML response] ' . $title . '\n';
} else {
echo $errorPrefix . json_encode($responseBody) . '\n';
}
echo 'Server error(' . $method . ': ' . $path . '. Params: ' . json_encode($params) . '): ' . json_encode($responseBody) . '\n';
}
return [
@@ -1,6 +1,6 @@
<?php
namespace Tests\E2E\Services\TablesDB\Permissions;
namespace Tests\E2E\Services\Databases\Permissions;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\E2E\Client;
@@ -9,7 +9,6 @@ use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\SchemaPolling;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideClient;
use Tests\E2E\Services\Databases\Permissions\DatabasesPermissionsBase;
use Utopia\Database\Helpers\ID;
use Utopia\Database\Helpers\Permission;
use Utopia\Database\Helpers\Role;
@@ -1,6 +1,6 @@
<?php
namespace Tests\E2E\Services\TablesDB\Permissions;
namespace Tests\E2E\Services\Databases\Permissions;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\E2E\Client;
@@ -9,7 +9,6 @@ use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\SchemaPolling;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideClient;
use Tests\E2E\Services\Databases\Permissions\DatabasesPermissionsBase;
use Utopia\Database\Helpers\ID;
use Utopia\Database\Helpers\Permission;
use Utopia\Database\Helpers\Role;
@@ -1,6 +1,6 @@
<?php
namespace Tests\E2E\Services\TablesDB\Permissions;
namespace Tests\E2E\Services\Databases\Permissions;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\E2E\Client;
@@ -9,7 +9,6 @@ use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\SchemaPolling;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideClient;
use Tests\E2E\Services\Databases\Permissions\DatabasesPermissionsBase;
use Utopia\Database\Helpers\ID;
use Utopia\Database\Helpers\Permission;
use Utopia\Database\Helpers\Role;
@@ -1,6 +1,6 @@
<?php
namespace Tests\E2E\Services\TablesDB;
namespace Tests\E2E\Services\Databases\TablesDB;
use Tests\E2E\Client;
use Tests\E2E\Scopes\ApiTablesDB;
@@ -1,12 +1,11 @@
<?php
namespace Tests\E2E\Services\TablesDB;
namespace Tests\E2E\Services\Databases;
use Tests\E2E\Scopes\ApiTablesDB;
use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideConsole;
use Tests\E2E\Services\Databases\DatabasesBase;
class TablesDBConsoleClientTest extends Scope
{
@@ -1,12 +1,11 @@
<?php
namespace Tests\E2E\Services\TablesDB;
namespace Tests\E2E\Services\Databases;
use Tests\E2E\Scopes\ApiTablesDB;
use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideClient;
use Tests\E2E\Services\Databases\DatabasesBase;
class TablesDBCustomClientTest extends Scope
{
@@ -1,12 +1,11 @@
<?php
namespace Tests\E2E\Services\TablesDB;
namespace Tests\E2E\Services\Databases;
use Tests\E2E\Scopes\ApiTablesDB;
use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideServer;
use Tests\E2E\Services\Databases\DatabasesBase;
class TablesDBCustomServerTest extends Scope
{
@@ -1,12 +1,11 @@
<?php
namespace Tests\E2E\Services\TablesDB\Transactions;
namespace Tests\E2E\Services\Databases\Transactions;
use Tests\E2E\Scopes\ApiTablesDB;
use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideClient;
use Tests\E2E\Services\Databases\Transactions\ACIDBase;
use Tests\E2E\Traits\DatabasesUrlHelpers;
class TablesDBACIDTest extends Scope
@@ -1,12 +1,11 @@
<?php
namespace Tests\E2E\Services\TablesDB\Transactions;
namespace Tests\E2E\Services\Databases\Transactions;
use Tests\E2E\Scopes\ApiTablesDB;
use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideClient;
use Tests\E2E\Services\Databases\Transactions\TransactionPermissionsBase;
class TablesDBTransactionPermissionsCustomClientTest extends Scope
{
@@ -1,12 +1,11 @@
<?php
namespace Tests\E2E\Services\TablesDB\Transactions;
namespace Tests\E2E\Services\Databases\Transactions;
use Tests\E2E\Scopes\ApiTablesDB;
use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideConsole;
use Tests\E2E\Services\Databases\Transactions\TransactionsBase;
use Tests\E2E\Traits\DatabasesUrlHelpers;
class TablesDBTransactionsConsoleClientTest extends Scope
@@ -1,12 +1,11 @@
<?php
namespace Tests\E2E\Services\TablesDB\Transactions;
namespace Tests\E2E\Services\Databases\Transactions;
use Tests\E2E\Scopes\ApiTablesDB;
use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideClient;
use Tests\E2E\Services\Databases\Transactions\TransactionsBase;
use Tests\E2E\Traits\DatabasesUrlHelpers;
class TablesDBTransactionsCustomClientTest extends Scope
@@ -1,12 +1,11 @@
<?php
namespace Tests\E2E\Services\TablesDB\Transactions;
namespace Tests\E2E\Services\Databases\Transactions;
use Tests\E2E\Scopes\ApiTablesDB;
use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideServer;
use Tests\E2E\Services\Databases\Transactions\TransactionsBase;
use Tests\E2E\Traits\DatabasesUrlHelpers;
class TablesDBTransactionsCustomServerTest extends Scope
@@ -2018,7 +2018,7 @@ class FunctionsCustomServerTest extends Scope
$functionId = $this->setupFunction([
'functionId' => ID::unique(),
'name' => 'Test Scopes executions',
'commands' => 'bash setup.sh && npm ci',
'commands' => 'bash setup.sh && npm install',
'runtime' => 'node-22',
'entrypoint' => 'index.js',
'scopes' => ['users.read'],
@@ -342,7 +342,7 @@ class SitesCustomServerTest extends Scope
'buildRuntime' => 'node-22',
'outputDirectory' => './dist',
'buildCommand' => 'npm run build',
'installCommand' => 'npm ci',
'installCommand' => 'npm install',
'fallbackFile' => '',
]);
@@ -404,7 +404,7 @@ class SitesCustomServerTest extends Scope
'buildRuntime' => 'node-22',
'outputDirectory' => './dist',
'buildCommand' => 'npm run build',
'installCommand' => 'npm ci',
'installCommand' => 'npm install',
]);
$this->assertNotEmpty($siteId);
@@ -445,7 +445,7 @@ class SitesCustomServerTest extends Scope
'buildRuntime' => 'node-22',
'outputDirectory' => './dist',
'buildCommand' => 'npm run build',
'installCommand' => 'npm ci',
'installCommand' => 'npm install',
]);
$this->assertNotEmpty($siteId);
@@ -569,7 +569,7 @@ class SitesCustomServerTest extends Scope
'buildRuntime' => 'node-22',
'outputDirectory' => './dist',
'buildCommand' => 'npm run build',
'installCommand' => 'npm ci',
'installCommand' => 'npm install',
]);
$this->assertNotEmpty($siteId);
@@ -598,7 +598,7 @@ class SitesCustomServerTest extends Scope
'buildRuntime' => 'node-22',
'outputDirectory' => './dist',
'buildCommand' => 'npm run build',
'installCommand' => 'npm ci',
'installCommand' => 'npm install',
'adapter' => 'ssr',
'fallbackFile' => '',
'$id' => $siteId,
@@ -849,7 +849,7 @@ class SitesCustomServerTest extends Scope
'providerBranch' => 'main',
'providerRootDirectory' => './',
'$id' => $siteId,
'installCommand' => 'npm ci'
'installCommand' => 'npm install'
]);
$dateValidator = new DatetimeValidator();
@@ -859,7 +859,7 @@ class SitesCustomServerTest extends Scope
$this->assertEquals('Test Site Updated', $site['body']['name']);
$this->assertEquals(true, $dateValidator->isValid($site['body']['$createdAt']));
$this->assertEquals(true, $dateValidator->isValid($site['body']['$updatedAt']));
$this->assertEquals('npm ci', $site['body']['installCommand']);
$this->assertEquals('npm install', $site['body']['installCommand']);
$this->cleanupSite($siteId);
}
@@ -2076,7 +2076,7 @@ class SitesCustomServerTest extends Scope
'buildRuntime' => 'node-22',
'outputDirectory' => './dist',
'buildCommand' => 'npm run build',
'installCommand' => 'npm ci',
'installCommand' => 'npm install',
'fallbackFile' => '',
]);
@@ -2176,7 +2176,7 @@ class SitesCustomServerTest extends Scope
'buildRuntime' => 'node-22',
'outputDirectory' => './dist',
'buildCommand' => 'npm run build',
'installCommand' => 'npm ci',
'installCommand' => 'npm install',
'fallbackFile' => '',
'logging' => false // set logging to false
]
@@ -2605,7 +2605,7 @@ class SitesCustomServerTest extends Scope
'buildRuntime' => 'node-22',
'outputDirectory' => './dist',
'buildCommand' => 'npm run build',
'installCommand' => 'npm ci',
'installCommand' => 'npm install',
]);
$this->assertNotEmpty($siteId);
@@ -2965,7 +2965,7 @@ class SitesCustomServerTest extends Scope
'buildRuntime' => 'node-22',
'outputDirectory' => './dist',
'buildCommand' => 'npm run build',
'installCommand' => 'echo "custom error" && npm ci',
'installCommand' => 'echo "custom error" && npm install',
'adapter' => 'ssr',
]);
$this->assertNotEmpty($siteId);
@@ -3008,7 +3008,7 @@ class SitesCustomServerTest extends Scope
'buildRuntime' => 'node-22',
'outputDirectory' => './dist',
'buildCommand' => 'npm run build',
'installCommand' => 'npm ci',
'installCommand' => 'npm install',
'fallbackFile' => '',
]);
@@ -3050,7 +3050,7 @@ class SitesCustomServerTest extends Scope
'buildRuntime' => 'node-22',
'outputDirectory' => './dist',
'buildCommand' => 'npm run build',
'installCommand' => 'npm ci',
'installCommand' => 'npm install',
'fallbackFile' => '',
]);
-1
View File
@@ -1 +0,0 @@
node_modules/
-1
View File
@@ -1 +0,0 @@
node_modules/
@@ -1528,6 +1528,17 @@
"@types/unist": "*"
}
},
"node_modules/@types/node": {
"version": "25.0.3",
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.0.3.tgz",
"integrity": "sha512-W609buLVRVmeW693xKfzHeIV6nJGGz98uCPfeXI1ELMLXVeKYZ9m15fAMSaUPBHYLGFsVRcMmSCksQOrZV9BYA==",
"license": "MIT",
"optional": true,
"peer": true,
"dependencies": {
"undici-types": "~7.16.0"
}
},
"node_modules/@types/unist": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz",
@@ -2609,9 +2620,9 @@
}
},
"node_modules/devalue": {
"version": "5.6.4",
"resolved": "https://registry.npmjs.org/devalue/-/devalue-5.6.4.tgz",
"integrity": "sha512-Gp6rDldRsFh/7XuouDbxMH3Mx8GMCcgzIb1pDTvNyn8pZGQ22u+Wa+lGV9dQCltFQ7uVw0MhRyb8XDskNFOReA==",
"version": "5.6.3",
"resolved": "https://registry.npmjs.org/devalue/-/devalue-5.6.3.tgz",
"integrity": "sha512-nc7XjUU/2Lb+SvEFVGcWLiKkzfw8+qHI7zn8WYXKkLMgfGSHbgCEaR6bJpev8Cm6Rmrb19Gfd/tZvGqx9is3wg==",
"license": "MIT"
},
"node_modules/devlop": {
@@ -5117,6 +5128,14 @@
"integrity": "sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==",
"license": "MIT"
},
"node_modules/undici-types": {
"version": "7.16.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz",
"integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==",
"license": "MIT",
"optional": true,
"peer": true
},
"node_modules/unified": {
"version": "11.0.5",
"resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz",
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -2151,9 +2151,9 @@
}
},
"node_modules/devalue": {
"version": "5.6.4",
"resolved": "https://registry.npmjs.org/devalue/-/devalue-5.6.4.tgz",
"integrity": "sha512-Gp6rDldRsFh/7XuouDbxMH3Mx8GMCcgzIb1pDTvNyn8pZGQ22u+Wa+lGV9dQCltFQ7uVw0MhRyb8XDskNFOReA==",
"version": "5.6.3",
"resolved": "https://registry.npmjs.org/devalue/-/devalue-5.6.3.tgz",
"integrity": "sha512-nc7XjUU/2Lb+SvEFVGcWLiKkzfw8+qHI7zn8WYXKkLMgfGSHbgCEaR6bJpev8Cm6Rmrb19Gfd/tZvGqx9is3wg==",
"license": "MIT"
},
"node_modules/devlop": {
@@ -0,0 +1,60 @@
<?php
namespace Tests\Unit\Functions\Validator;
use Appwrite\Functions\Validator\Headers;
use PhpBench\Attributes\AfterMethods;
use PhpBench\Attributes\Assert;
use PhpBench\Attributes\BeforeMethods;
use PhpBench\Attributes\Iterations;
use PhpBench\Attributes\ParamProviders;
final class HeadersBench
{
private Headers $validator;
public function tearDown(): void
{
}
public function prepare(): void
{
$this->validator = new Headers();
}
public function providers(): iterable
{
yield 'empty' => [ 'value' => [] ];
$value = [];
for ($i = 0; $i < 10; $i++) {
$value[bin2hex(random_bytes(8))] = bin2hex(random_bytes(8));
}
yield 'items_10-size_320' => [ 'value' => $value ];
$value = [];
for ($i = 0; $i < 100; $i++) {
$value[bin2hex(random_bytes(8))] = bin2hex(random_bytes(8));
}
yield 'items_100-size_3200' => [ 'value' => $value ];
$value = [];
for ($i = 0; $i < 100; $i++) {
$value[bin2hex(random_bytes(32))] = bin2hex(random_bytes(32));
}
yield 'items_100-size_12800' => [ 'value' => $value ];
}
#[BeforeMethods('prepare')]
#[AfterMethods('tearDown')]
#[ParamProviders('providers')]
#[Iterations(50)]
#[Assert('mode(variant.time.avg) < 1 ms')]
public function benchHeadersValidator(array $data): void
{
$assertion = $this->validator->isValid($data['value']);
if (!$assertion) {
exit(1);
}
}
}