Skip to content

Prepare for Matomo 6 - #141

Merged
sgiehl merged 9 commits into
6.x-devfrom
prepare6x
Aug 10, 2026
Merged

Prepare for Matomo 6#141
sgiehl merged 9 commits into
6.x-devfrom
prepare6x

Conversation

@sgiehl

@sgiehl sgiehl commented Aug 9, 2026

Copy link
Copy Markdown
Member

Description

Prepares CustomVariables for Matomo 6, targeting the newly created 6.x-dev maintenance line
(created at 5.x-dev parity, so this PR is exactly the Matomo 6 preparation).

Metadata

  • plugin.json: version 6.0.0, require.matomo >=6.0.0-b1,<7.0.0-b1 (the -b1 lower bound
    keeps the plugin enabled against a beta core).
  • CHANGELOG.md: 6.0.0 entry added.

CI

  • PluginTests gained a database matrix (MySQL 8.0 / MariaDB 10.6), matching Matomo 6's new
    database minimums, and passes engine and version through to the action.
  • PHP versions use the matomo6_min_php / matomo6_max_php aliases instead of pinned literals,
    so the matrix follows core's supported range rather than drifting.
  • The UI job runs on Node 24 with an explicit Mysql / 8.0 database; without the latter it
    died with Unknown database 'piwik_tests' before comparing any screenshot.
  • phpcs.yml bumped to PHP 8.1.

Build

  • Vue dist rebuilt with the Vite toolchain, ESLint violations fixed.
  • The unminified CustomVariables.umd.js is dropped — only .umd.min.js is ever served — and
    gitignored.

Compatibility

  • Tracking fixture no longer passes an array custom-variable name to setCustomVariable(),
    which matomo-php-tracker 4 types as string; the malformed-cvar coverage is preserved by
    injecting into the visitorCustomVar payload directly.
  • segmentMatchNONE system test fixed for MySQL 8.0.
  • Expected UI screenshots updated for headless Chrome under Node 24 / Puppeteer 24.

The Matomo 6 breaking-changes sweep found no remaining use of a removed symbol. The
setCustomVariable() hits are the retained API called with string names, and the README.md
matches document the JavaScript tracker's _paq API, which is unrelated.

Review

  • Functional review done
  • Potential edge cases and regressions considered
  • Usability and UX considered
  • Security considered
  • Tests and CI green

Checklist

  • [✔] I have understood, reviewed, and tested all AI outputs before use
  • [✔] All AI instructions respect security, IP, and privacy rules

sgiehl added 9 commits July 9, 2026 14:43
Bump plugin version to 6.0.0 and require Matomo >=6.0.0-b1,<7.0.0-b1.
…violations (#134)

* Adapt Vue sources to the Vite build and rebuild dist for Matomo 6

Replaces a value re-export/import of a type-only entity so the esbuild-based Vite build can bundle it, and rebuilds the Vue dist files with the new toolchain.

* Rebuild Vue dist files for Vue 3.5

* Fix CustomVariables Vue declaration type errors

Export the usage-row interface, cast the readonly usage to the sort helper, and
coerce numeric translate args.
* Fix segmentMatchNONE test for MySQL 8.0

Comparing date/time segments against the placeholder string 'campaign'
(e.g. visitEndServerDate != 'campaign') is rejected by MySQL 8.0 as an
invalid DATE value; MySQL 5.7 tolerated it. Give each date/time segment a
valid, type-appropriate value instead - a date for DATE() segments and an
integer for the HOUR()/MINUTE()/YEAR()/... extractions - so they stay
covered and the query runs on MySQL 8.0. The matched result is unchanged
(the segment still matches no visits via the impossible deviceType condition).

* Run plugin tests against MySQL 8.0 and MariaDB 10.6

The workflow inherited the shared action's MySQL 5.7 default, which is below
Matomo's new minimum. Pin the database-backed jobs to the supported floor:
PluginTests now runs a MySQL 8.0 + MariaDB 10.6 matrix, and the UI job runs
on MySQL 8.0.

* Only upload plugin test artifacts for the MySQL matrix leg

PluginTests runs a MySQL + MariaDB matrix; the upload-artifacts condition
matched both legs and uploaded twice. Restrict the upload to the MySQL leg.
… Puppeteer 24) (#136)

* Update expected UI screenshots for the new headless Chrome (Node 24 / Puppeteer 24)

* Run the plugin UI tests on Node 24

Match the Node 24 / Puppeteer 24 screenshot-testing stack; the UI job was still pinned to Node 16.
…tracker 4.0 (#137)

* Drop the array custom-variable name from the tracking fixture

matomo-php-tracker 3.4.0 types setCustomVariable()'s $name as string, so
the deliberately-invalid array name now raises a TypeError. The id (6) is
already out of the valid range and not tracked, so the string variant on
the line above keeps the same coverage and the expected output is unchanged.

* Recover the malformed-custom-variable coverage via direct cvar injection

The invalid (array) custom-variable name can no longer be passed through the
type-safe setCustomVariable(); inject it directly into the public
visitorCustomVar payload so the fixture still verifies a malformed cvar is
not tracked. Cannot use a raw _cvar param (custom param / debug append)
because it would duplicate and override the valid cvars in the request.
Matomo's Vue build no longer emits <Plugin>.umd.js. Only the minified
CustomVariables.umd.min.js is ever served: PluginUmdAssetFetcher looks exclusively for
.umd.min.js, and development mode uses the .development.umd.js produced by
vue:build --watch.

The unminified bundle was a leftover from Vue CLI, whose lib build emitted it
alongside the minified one for free. See matomo-org/matomo#25027.
The Matomo 6 preparation bumped plugin.json to 6.0.0 but never recorded the
version in the changelog, leaving the released 5.0.6 as the newest entry.
…lease]

The matrix pinned the literals 8.1 / 8.5. github-action-tests resolves
matomo6_min_php / matomo6_max_php to the same versions today and keeps
following core's supported range, so the workflow no longer drifts when
core moves its PHP floor or ceiling.
@sgiehl
sgiehl requested a review from a team August 9, 2026 15:43
@sgiehl
sgiehl merged commit 4baf80d into 6.x-dev Aug 10, 2026
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants