-
Notifications
You must be signed in to change notification settings - Fork 0
feat: migrate ClickHouse adapter to utopia-php/query 0.3.x builder #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lohanidamodar
wants to merge
6
commits into
main
Choose a base branch
from
feat/utopia-query-0.3.x
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
377b639
chore(deps): bump utopia-php/query to 0.3.x (dev-branch pin)
lohanidamodar e84ff76
refactor(database): switch convertQueriesToDatabase to Method enum
lohanidamodar f0ded73
chore(deps): bump phpstan to ^2.0 with baseline
lohanidamodar 7bcb7f2
feat: migrate ClickHouse adapter to utopia-php/query 0.3.x builder
lohanidamodar a5e01ea
test(clickhouse): SQL snapshot tests + Dockerfile/composer PHP 8.4 bump
lohanidamodar 3a386e2
chore(clickhouse): drop unused runStatement() helper and unused State…
lohanidamodar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
greptile-apps[bot] marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| includes: | ||
| - phpstan-baseline.neon | ||
|
|
||
| parameters: | ||
| level: max | ||
| paths: | ||
| - src | ||
| - tests |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"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 aftercomposer.lockis committed, any freshcomposer updatewould silently pull a different commit. The PR description acknowledges this needs flipping to^0.3.2once tagged.There was a problem hiding this comment.
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:
utopia-php/queryPR and tag0.3.2(or whatever the next stable carries the ClickHouse builder + Method enum surface used here).composer.jsonback to"utopia-php/query": "^0.3.2"and restore"minimum-stability": "stable"(droppingprefer-stable) in the same commit, refreshcomposer.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.