Skip to content

Conversation

cabutlermit
Copy link
Contributor

@cabutlermit cabutlermit commented Sep 8, 2025

What does this PR do?

  • Update the Dockerfile to pull the 5.4.0 container UrlSource
  • Update the Dockerfile to add the CustomReports plugin contents to the container (but do not install or activate it)
  • Update the HowTo information for premium plugins to make it a little more clear how to get started with a new premium plugin
  • Add the other plugin updates to the repository but do not add them to the container yet

Helpful background context

Upgrade the Docker container to run Matomo 5.4.0 so that we can enable the new CustomReports plugin.

How can a reviewer manually see the effects of these changes?

A log in to the UI for dev-matomo will show that it is running version 5.4.0.

The updated container was deployed to Dev1. It did require a database upgrade (./console core:upate) that took only a few seconds to update tables:

root@ip-172-32-1-149:/var/www/html# ./console core:update

    *** Update ***

    Database Upgrade Required

    Your Matomo database is out-of-date, and must be upgraded before you can continue.

    Matomo database will be upgraded from version 5.3.2 to the new version 5.4.0.

    *** Note: this is a Dry Run ***

    ALTER TABLE `matomo_user_token_auth` ADD COLUMN `ts_rotation_notified` DATETIME NULL;
    ALTER TABLE `matomo_user_token_auth` ADD COLUMN `ts_expiration_warning_notified` DATETIME NULL;
    ALTER TABLE `matomo_user` ADD COLUMN `ts_last_seen` TIMESTAMP null DEFAULT null;
    ALTER TABLE `matomo_user` ADD COLUMN `ts_inactivity_notified` TIMESTAMP null DEFAULT null;
    UPDATE `matomo_user` u JOIN (
                SELECT 
                    SUBSTRING_INDEX(o.option_name, 'UsersManager.lastSeen.', -1) AS login,
                    o.option_value AS last_seen
                FROM `matomo_option` o
                WHERE o.option_name LIKE 'UsersManager.lastSeen.%'
            ) AS userData
            ON u.login = userData.login
            SET u.ts_last_seen = CONVERT_TZ(FROM_UNIXTIME(userData.last_seen), 'SYSTEM', '+00:00');
    DELETE FROM `matomo_option` WHERE option_name LIKE 'UsersManager.lastSeen.%';

    *** End of Dry Run ***

A database upgrade is required. Execute update? (y/N) y

Starting the database upgrade process now. This may take a while, so please be patient.

    *** Update ***

    Database Upgrade Required

    Your Matomo database is out-of-date, and must be upgraded before you can continue.

    Matomo database will be upgraded from version 5.3.2 to the new version 5.4.0.

    The database upgrade process may take a while, so please be patient.

  Executing ALTER TABLE `matomo_user_token_auth` ADD COLUMN `ts_rotation_notified` DATETIME NULL;... Done. [1 / 6]
  Executing ALTER TABLE `matomo_user_token_auth` ADD COLUMN `ts_expiration_warning_notified` DATETIME NULL;... Done. [2 / 6]
  Executing ALTER TABLE `matomo_user` ADD COLUMN `ts_last_seen` TIMESTAMP null DEFAULT null;... Done. [3 / 6]
  Executing ALTER TABLE `matomo_user` ADD COLUMN `ts_inactivity_notified` TIMESTAMP null DEFAULT null;... Done. [4 / 6]
  Executing UPDATE `matomo_user` u JOIN (
                SELECT 
                    SUBSTRING_INDEX(o.option_name, 'UsersManager.lastSeen.', -1) AS login,
                    o.option_value AS last_seen
                FROM `matomo_option` o
                WHERE o.option_name LIKE 'UsersManager.lastSeen.%'
            ) AS userData
            ON u.login = userData.login
            SET u.ts_last_seen = CONVERT_TZ(FROM_UNIXTIME(userData.last_seen), 'SYSTEM', '+00:00');... Done. [5 / 6]
  Executing DELETE FROM `matomo_option` WHERE option_name LIKE 'UsersManager.lastSeen.%';... Done. [6 / 6]

Matomo has been successfully updated!

Includes new or updated dependencies?

NO

What are the relevant tickets?

Developer

  • All new ENV is documented in README (or there is none)
  • Stakeholder approval has been confirmed (or is not needed)

Code Reviewer

  • The commit message is clear and follows our guidelines
    (not just this pull request message)
  • There are appropriate tests covering any new functionality
  • The documentation has been updated or is unnecessary
  • The changes have been verified
  • New dependencies are appropriate or there were no changes

Why these changes are being introduced:
Upgrade the Docker container to run Matomo 5.4.0 so that we can enable
the new CustomReports plugin.

How this addresses that need:
* Update the Dockerfile to pull the 5.4.0 container UrlSource
* Update the Dockerfile to add the CustomReports plugin contents to the
container (but do not install or activate it)
* Update the HowTo information for premium plugins to make it a little
more clear how to get started with a new premium plugin
* Add the other plugin updates to the repository but do not add them
to the container yet

Side effects of this change:
None.

Relevant ticket(s):
* https://mitlibraries.atlassian.net/browse/INFRA-577
* https://mitlibraries.atlassian.net/browse/INFRA-576
* https://mitlibraries.atlassian.net/browse/INFRA-569
@cabutlermit cabutlermit marked this pull request as ready for review September 8, 2025 17:08
@cabutlermit cabutlermit requested review from dhrutibc and a team as code owners September 8, 2025 17:08
Copy link

@dhrutibc dhrutibc left a comment

Choose a reason for hiding this comment

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

I see Matomo Dev running version 5.4.0.

@vab
Copy link
Contributor

vab commented Sep 8, 2025

lgtm

Sorry - this took me a minute because I couldn't use the code tab in gh due to the size of the delta.

@cabutlermit cabutlermit merged commit 6deccb8 into main Sep 8, 2025
2 checks passed
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.

3 participants