Skip to content

Set send stats to default#2032

Open
kwoot wants to merge 6 commits intoLibrePlan:mainfrom
kwoot:set-send-stats-to-default
Open

Set send stats to default#2032
kwoot wants to merge 6 commits intoLibrePlan:mainfrom
kwoot:set-send-stats-to-default

Conversation

@kwoot
Copy link
Copy Markdown
Contributor

@kwoot kwoot commented Apr 4, 2026

An attempt to set the default value of sending some anonymized usage stats to true.
We will only know that there was an install live somewhere in the world.

@@ -1,3 +1,3 @@
statsPage http://stats.libreplan-enterprise.com/
statsPage https://stats.libreplan.dev/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I visited https://stats.libreplan.dev/ in my browser and returns 405 Method Not Allowed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is now fixed. Expects a POST but returns 200 in all cases.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see, I thought the stats were public like https://formulae.brew.sh/analytics/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hm, never thought of it that way. This is a first implementation. Let me think about that.

statsPage https://stats.libreplan.dev/
minimumYear 2009
yearLimit 20 No newline at end of file
yearLimit 20
Copy link
Copy Markdown
Contributor

@sanbor sanbor Apr 6, 2026

Choose a reason for hiding this comment

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

if the minimum year is 2009 then in 2029 it will stop reporting. Maybe bump the minimum or maximum?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changed from 20 to 50.

<checkbox
label="${i18n:_t('Help the project developers to collect information about which LibrePlan version you are using')}"
tooltiptext="${i18n:_t('Check this option if you would like to send feedback to LibrePlan developers about program usage')}"/>
tooltiptext="${i18n:_t('Check this option if you would like to send feedback to LibrePlan developers about program usage')}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would change this text to "Allow collection of anonymous statistics to help us improve LibrePlan".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

columnDataType="BOOLEAN" />
</changeSet>

<changeSet id="set-allow_to_gather_usage_stats-to-true"
Copy link
Copy Markdown
Contributor

@sanbor sanbor Apr 6, 2026

Choose a reason for hiding this comment

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

This change is not needed because this is already done in file libreplan-business/src/main/resources/db.changelog-1.2.xml:

    <changeSet id="update allow_to_gather_usage_stats_enabled" author="bogdan/jeroen" runAlways="true">
        <comment>Update allow_to_gather_usage_stats_enabled field</comment>
        <update tableName="configuration">
            <column name="allow_to_gather_usage_stats_enabled" valueBoolean="TRUE"/>
        </update>
    </changeSet>

    <changeSet author="pluchyn" id="change_default_value_for_gather_usage_stats">
        <addDefaultValue tableName="configuration" columnName="allow_to_gather_usage_stats_enabled"
                         defaultValueBoolean="TRUE"/>
        <addNotNullConstraint tableName="configuration"
                              columnName="allow_to_gather_usage_stats_enabled"
                              defaultNullValue="TRUE"
                              columnDataType="BOOLEAN" />
    </changeSet>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think the original default in db.changelog-1.2.xml is FALSE and I need it to be TRUE. That means that at least ONCE after installation some stats are send. This is needed to know about the number of installs in the world and the trend.

Copy link
Copy Markdown
Contributor

@sanbor sanbor Apr 12, 2026

Choose a reason for hiding this comment

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

You are right. I started a fresh Libreplan instance and this setting was not on. However, I checked out your branch and went to configuration and I get an error.

Screenshot 2026-04-12 at 15 05 12

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, a rather dumb mistake on my part. Fixed of course.

Copy link
Copy Markdown
Contributor

@sanbor sanbor left a comment

Choose a reason for hiding this comment

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

Let me know if you have any questions or want to challenge my comments. Once you are done processing my comments in this PR I will take another look.

@kwoot
Copy link
Copy Markdown
Contributor Author

kwoot commented Apr 7, 2026

Hm, as the pot files are always regenerated in a different order, does it make sense to have them under version control? Based on git blame this has been the case for a long time now.

Thanks. The Dutch word for this mistake on my part would be "suf" :-).

Co-authored-by: Santiago Borrazás <sanbor@users.noreply.github.com>
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.

2 participants