feat: ad-hoc aggregation suite + multi-value filter fix (#1606-1610, #2027)#2057
Merged
Merged
Conversation
…2027) Ground-truthed the six adhoc-aggregation-suite requirements against HEAD before implementing: - REQ-AGG-101 (multi-field groupBy) and REQ-AGG-104 (cross-dialect native time-bucket) were already fully implemented and tested in AggregationQuery/AggregationRunner. Wired the missing HTTP surface: AggregationController::grouped() now parses a comma-list or repeated groupBy[] param into the multi-field shape. - REQ-AGG-105 (timeseries caching): the cache engine already read-through cached every ad-hoc query via AggregationCache; only the X-OR-Cache hit/miss response header was missing on value()/grouped()/timeseries() (aggregate() already had it). Added. - REQ-AGG-102 (multi-metric): implemented. AggregationQuery gains a metrics list (getMetrics()/isMultiMetric()/metricResponseKey()); the native path merges N single-metric native calls into one values map (reuses the proven per-dialect SQL builder rather than a new multi-column statement); the PHP fallback computes all metrics over the same row set. Wired into value()/grouped(), not timeseries() (rejected combination with dateBucket). - REQ-AGG-106 (bug #2027): fixed on both paths. A bare array filter value is now treated as an implicit `in` (any-of) instead of being silently ignored by the PHP fallback (previously counted every row) or bailing the native path with no translation. The `in`/`notIn`/`eq`/`ne` operators now correctly any-overlap match multi-value (JSON-array) object properties in the PHP fallback; the native path defers array-typed-property filters to the PHP fallback rather than emit a silently-wrong equality/IN predicate. - REQ-AGG-103 (cumulative time-bucket) is deferred — not implemented this wave; left as an open requirement, tasks.md marks it explicitly. Single-field/single-metric response shapes are regression-pinned byte-identical. 217 aggregation unit tests pass (130 pre-existing + 87 new/updated across 4 test files). Not archived: 5 of 6 requirements are done; REQ-AGG-103 remains open.
Contributor
Quality Report — ConductionNL/openregister @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ❌ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ❌ | ||||
| stylelint | ❌ | ||||
| composer | ❌ | ✅ 172/172 | |||
| npm | ❌ | ❌ | |||
| PHPUnit | ⏭️ | ||||
| Newman | ⏭️ | ||||
| Playwright | ⏭️ |
Quality workflow — 2026-07-23 22:15 UTC
Download the full PDF report from the workflow artifacts.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Implements the
adhoc-aggregation-suiteOpenSpec change — 5 of 6 requirements shipped, 1 deferred (see below). Ground-truthed each sub-part against HEAD before writing code: several were already fully implemented and only needed HTTP wiring or a missing response header.groupBy[]param)metricslist onvalue()/grouped(), native path merges N single-metric queries into onevaluesmap, PHP fallback computes all metrics over the same row setX-OR-Cache: hit|missheader onvalue()/grouped()/timeseries()in(any-of);in/notIn/eq/nenow any-overlap-match multi-value (JSON-array) properties; native path defers array-typed-property filters to the PHP fallback instead of emitting a silently-wrong predicateSingle-field/single-metric response shapes are regression-pinned byte-identical.
Not archived — REQ-AGG-103 is deferred;
tasks.mdmarks it explicitly as an open follow-up.Test plan
docker run --rm -v <worktree>:/app -w /app nextcloud:34.0.0-apache php vendor/bin/phpunit— 217 aggregation-scoped tests pass (130 pre-existing regression + 87 new/updated acrossAggregationQueryTest,AggregationRunnerMultiValueFilterTest(new),AggregationRunnerMultiMetricTest(new),AggregationControllerValueGroupedTest(new))vendor/bin/phpcsclean on all changedlib/files (1 pre-existing warning, unrelated to this change, verified present at HEAD too)Unit Testssuite (15k tests) run for regression sanity — the handful of pre-existing failures/errors (RelationHandler ctor arity, missing CSV fixture, SchemaLinkedTypes, MapLink/PhotoLink/PollLink deep-link format, a full-suite-only test-isolation issue affectingJSONResponse::addHeader) are unrelated to this change and reproduce identically in an untouched sibling worktree at a similar commit — confirmed pre-existing, not introduced hereKnown pre-existing CI infra failures (npm/eslint/stylelint/license/Newman) are unrelated to this backend change.