Skip to content

refactor(discovery): merge provider results in a DiscoveryMerge and pass the search filter as one object - #569

Merged
rubenvdlinde merged 4 commits into
developmentfrom
refactor/discovery-aggregator-merge
Nov 2, 2026
Merged

rubenvdlinde merged 4 commits into
developmentfrom
refactor/discovery-aggregator-merge

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

DiscoveryAggregator::search() was the largest PHP unit in versioniq (62 LOC, McCabe 14, 3 parameters). It now takes the provider ids and the installed-only flag as one DiscoveryFilter, turns a throwing provider into a failed result in runProvider(), and hands the merging to a per-search DiscoveryMerge, which groups hits by app id, prefers App Store summary and icon, collects provider errors and sorts installed apps first, then by name. Its one caller, ApiController::discover, passes the filter; the request parameters and the response are unchanged.

SIG numbers (gate 122, five-star profile, PHP, against development 3e6e4b8)

check before after 5-star 4-star
params >=3 22.93% 22.15% 7.5% 15.0%
size >15 54.69% 53.82% 23.6% 47.1%
size >30 22.64% 21.86% 11.6% 23.1% (met, more margin)
size >60 0.72% 0.00% 4.2% 8.3%
McCabe >5 40.01% 39.19% 10.1% 20.2%
McCabe >10 15.75% 14.99% 3.7% 7.3%
params >=5 6.84% 6.82% 1.65% 3.3%
params >=7 3.63% 3.62% 0.45% 0.9%

No PHP unit is above 60 LOC any more. Every touched or new unit is within the 5-star unit bounds (at most 12 LOC, McCabe 5, 2 params). versioniq stays 36/44 at 4-star. Gate 122 ratchet: 0 findings. Gate 123 (floor from #564): 36 held. Together with #567 and #568 this keeps the params >=3 share below development's while those two remove duplication.

Verification

  • Golden DiscoveryAggregatorGoldenTest: 23 cases (every provider-id filter with and without installed-only, providers disabled, throwing, returning errors or no hits, App Store duplicates, name ties), comparing the payload and every provider and app manager call. Recorded on the old code; plain re-run green on old and new.
  • Capped mutants against the golden only: DiscoveryMerge 16 of 16 (after adding the App Store duplicates case for three survivors), aggregator 5 of 5; no-op control survived each round.
  • Full unit-only suite under pcov with --fail-on-risky: OK (792 tests). composer check:strict: lint and psalm clean; php-cs-fixer flags only the inherited RemoveRetiredCronJobs pair. Hydra gates --scope-to-diff --base origin/development: exit 0.

AI assisted (Claude Code); reviewed against the golden before opening.

…ass the search filter as one object

DiscoveryAggregator::search() takes the provider ids and the installed-only
flag as one DiscoveryFilter, and a per-search DiscoveryMerge groups the hits,
prefers App Store metadata, collects provider errors and sorts the results.

Assisted-by: ClaudeCode:claude-opus-5-5
…pp Store hits

Assisted-by: ClaudeCode:claude-opus-5-5
@rubenvdlinde
rubenvdlinde merged commit 90b29ce into development Nov 2, 2026
7 checks passed
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/versioniq @ 13d3225

Check PHP Vue Security License Tests
lint ✅
phpcs ✅
phpmd ✅
psalm ✅
phpstan ✅
phpmetrics ✅
eslint ✅
stylelint ✅
build ✅
composer ✅ ✅ 32/32
npm ❌ ✅ 302/302
app:check-code ⏭️
info.xml ✅
REUSE ❌
lockfile sync ✅
PHPUnit ✅ 898/898 · 7 skipped (8 legs)
Newman ⏭️
Playwright ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development.
Hydra gates ✅

Quality workflow — 2026-11-02 22:44 UTC

Download the full PDF report from the workflow artifacts.

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