Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ COPY composer.json /src/
RUN composer install --ignore-platform-reqs --optimize-autoloader \
--no-plugins --no-scripts --prefer-dist

FROM php:8.3.3-cli-alpine3.19 as final
FROM php:8.4.21-cli-alpine3.23 as final

LABEL maintainer="team@appwrite.io"

Expand Down
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@
"check": "./vendor/bin/phpstan analyse --level max src tests",
"test": "./vendor/bin/phpunit --configuration phpunit.xml tests"
},
"minimum-stability": "stable",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=8.0",
"php": ">=8.4",
Comment on lines +19 to +21
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Dev-branch dependency and loosened stability setting

"minimum-stability": "dev" means Composer can resolve any transitive dependency to a dev release. Combined with "utopia-php/query": "dev-feat/clickhouse-insert-delete-settings-mv as 0.3.2", the locked revision is a mutable branch tip — if the branch is force-pushed or rebased after composer.lock is committed, any fresh composer update would silently pull a different commit. The PR description acknowledges this needs flipping to ^0.3.2 once tagged.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Acknowledged — this is intentional during the rollout and is called out in the PR description. The plan is:

  1. Merge the upstream utopia-php/query PR and tag 0.3.2 (or whatever the next stable carries the ClickHouse builder + Method enum surface used here).
  2. Flip this PR's composer.json back to "utopia-php/query": "^0.3.2" and restore "minimum-stability": "stable" (dropping prefer-stable) in the same commit, refresh composer.lock, and only then merge.

Until the tag exists the dev-branch alias is required so CI can resolve the dependency at all. Leaving this thread open so it stays visible as a pre-merge gate.

"utopia-php/fetch": "^1.1",
"utopia-php/database": "5.*",
"utopia-php/query": "0.1.*"
"utopia-php/query": "dev-feat/clickhouse-insert-delete-settings-mv as 0.3.2"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"utopia-php/cache": "1.*",
"phpstan/phpstan": "1.*",
"phpstan/phpstan": "^2.0",
"laravel/pint": "1.*"
},
"autoload": {
Expand Down
390 changes: 183 additions & 207 deletions composer.lock

Large diffs are not rendered by default.

199 changes: 199 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
parameters:
ignoreErrors:
-
message: '#^Call to function is_array\(\) with array\<string, mixed\> will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Cannot access offset ''agg_val'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Cannot access offset ''agg_value'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Cannot access offset ''bucket'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Cannot access offset ''metric'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 3
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Cannot access offset ''ping'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Cannot access offset ''total'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 6
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Cannot access offset ''uptime'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Cannot access offset ''version'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Cannot access offset 0 on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 7
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Cannot cast mixed to float\.$#'
identifier: cast.double
count: 1
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Cannot cast mixed to int\.$#'
identifier: cast.int
count: 9
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Cannot cast mixed to string\.$#'
identifier: cast.string
count: 5
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Method Utopia\\Usage\\Adapter\\ClickHouse\:\:getTimeSeriesFromTable\(\) should return array\<string, array\{total\: float, data\: array\<array\{value\: float, date\: string\}\>\}\> but returns array\<array\{total\: 0\|float, data\: list\<array\{value\: float, date\: string\}\>\}\>\.$#'
identifier: return.type
count: 1
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Parameter \#1 \$input of class Utopia\\Usage\\Metric constructor expects array\<string, mixed\>, array\<mixed\> given\.$#'
identifier: argument.type
count: 2
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Part \$metricName \(mixed\) of encapsed string cannot be cast to string\.$#'
identifier: encapsedStringPart.nonString
count: 1
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Possibly invalid array key type mixed\.$#'
identifier: offsetAccess.invalidOffset
count: 10
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Method Utopia\\Usage\\Metric\:\:getTags\(\) should return array\<string, mixed\> but returns array\<mixed\>\.$#'
identifier: return.type
count: 1
path: src/Usage/Metric.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsArray\(\) with array\<Utopia\\Usage\\Metric\> will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 1
path: tests/Usage/Adapter/ClickHouseTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsArray\(\) with array\<string, array\{total\: float, data\: array\<array\{value\: float, date\: string\}\>\}\> will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 1
path: tests/Usage/Adapter/ClickHouseTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsArray\(\) with array\<string, int\> will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 2
path: tests/Usage/Adapter/ClickHouseTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsArray\(\) with array\<string, mixed\> will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 1
path: tests/Usage/Adapter/ClickHouseTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsArray\(\) with array\{healthy\: bool, host\: string, port\: int, database\: string, secure\: bool, version\?\: string, uptime\?\: int, error\?\: string, \.\.\.\} will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 1
path: tests/Usage/Adapter/ClickHouseTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsArray\(\) with array\{request_count\: int, keep_alive_enabled\: bool, compression_enabled\: bool, query_logging_enabled\: bool, max_retries\: int, retry_delay\: int, async_inserts\: bool, async_insert_wait\: bool\} will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 1
path: tests/Usage/Adapter/ClickHouseTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsInt\(\) with int will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 3
path: tests/Usage/Adapter/ClickHouseTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertTrue\(\) with true will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 2
path: tests/Usage/Adapter/ClickHouseTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsArray\(\) with array\<string, array\{total\: float, data\: array\<array\{value\: float, date\: string\}\>\}\> will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 1
path: tests/Usage/Adapter/DatabaseTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsArray\(\) with array\<string, int\> will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 2
path: tests/Usage/Adapter/DatabaseTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsArray\(\) with array\<string, mixed\> will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 1
path: tests/Usage/Adapter/DatabaseTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsArray\(\) with array\{healthy\: bool, database\?\: string, collection\?\: string, error\?\: string\} will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 1
path: tests/Usage/Adapter/DatabaseTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsArray\(\) with array\<int, array\<string, mixed\>\> will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 4
path: tests/Usage/MetricTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsArray\(\) with array\<string, mixed\> will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 2
path: tests/Usage/MetricTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertTrue\(\) with true will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 6
path: tests/Usage/MetricTest.php
Comment thread
greptile-apps[bot] marked this conversation as resolved.
8 changes: 8 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
includes:
- phpstan-baseline.neon

parameters:
level: max
paths:
- src
- tests
Loading
Loading