Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add disable archiving segment for plugins #18279

Merged
merged 47 commits into from Dec 7, 2021

Conversation

peterhashair
Copy link
Contributor

@peterhashair peterhashair commented Nov 8, 2021

Description:

Fixes: #18134
add disable archiving segment configuration for plugins

  • Under [General]-> disable_archiving_segment_for_plugins accept string, sting with comma, array.
  • [General_{siteId}] can be enable by Site ID.

I guess this will be 4.7

Review

Peter Zhang added 6 commits November 8, 2021 14:35
add disable archiving segment for plugins
add isset check
update disable_archiving_segment_for_plugins to right place
update tests
Peter Zhang added 3 commits November 16, 2021 15:05
update wording
update wording and test
update tests
@peterhashair peterhashair marked this pull request as ready for review November 16, 2021 05:28
@peterhashair peterhashair added Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. labels Nov 16, 2021
@peterhashair peterhashair added this to the 4.7.0 milestone Nov 16, 2021
config/global.ini.php Outdated Show resolved Hide resolved
update wording
@peterhashair
Copy link
Contributor Author

The last test runs fully passed https://app.travis-ci.com/github/matomo-org/matomo/builds/241828886. the Last update just one wording in global.config.php, I think no need to run the test again.

@justinvelluppillai
Copy link
Contributor

@peterhashair changing the config changes one of the screenshots

@peterhashair
Copy link
Contributor Author

@justinvelluppillai right, let me run it again.

@peterhashair peterhashair self-assigned this Nov 17, 2021
@sgiehl
Copy link
Member

sgiehl commented Nov 19, 2021

[General_{siteId}] can be enable by Site ID.

If I see that right, the site specific config would then only work for that specific configuration value, right? Imho we should do it the same way like in tracker config. So it would be available for all values in General section.

See

public static function getConfigValue($name, $idSite = null)
{
$config = self::getConfig();
if (!empty($idSite)) {
$siteSpecificConfig = self::getSiteSpecificConfig($idSite);
$config = array_merge($config, $siteSpecificConfig);
}
return $config[$name];
}
private static function getConfig()
{
return Config::getInstance()->Tracker;
}
private static function getSiteSpecificConfig($idSite)
{
$key = 'Tracker_' . $idSite;
return Config::getInstance()->$key;
}

I'm not sure if it's easy to adjust the config class to support that. Maybe we need to introduce a new class GeneralConfig (like TrackerConfig) and replace all usages of the general config over time then...

@peterhashair
Copy link
Contributor Author

@sgiehl right, that makes sense let me do the adjustment.

Peter Zhang added 2 commits December 1, 2021 09:32
update en and check unsegmented reports
update lang
Copy link
Member

@sgiehl sgiehl left a comment

Choose a reason for hiding this comment

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

@peterhashair Left a couple of comments for smaller improvements. Regarding a UI test: I guess it would be good to have one, as it would also be kind of an integration test, as it ensures that tracked data isn't archived and displayed. Besides that guess it should be ready to merge after the adjustments

core/Config/GeneralConfig.php Outdated Show resolved Hide resolved
config/global.ini.php Show resolved Hide resolved
plugins/CoreHome/lang/en.json Outdated Show resolved Hide resolved
plugins/CoreHome/templates/_dataTable.twig Outdated Show resolved Hide resolved
Peter Zhang and others added 13 commits December 6, 2021 09:43
# Conflicts:
#	plugins/CoreHome/CoreHome.php
#	plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_removed.png
#	tests/UI/expected-screenshots/Theme_home.png
#	tests/UI/expected-screenshots/UIIntegrationTest_dashboard1.png
Co-authored-by: Stefan Giehl <stefan@matomo.org>
Co-authored-by: Stefan Giehl <stefan@matomo.org>
add screenshot tests
…rg/matomo into m-18134-archiving-configuration
update to overwrite
update config
update screen
# Conflicts:
#	tests/UI/expected-screenshots/UIIntegrationTest_admin_diagnostics_configfile.png
update screenshots
Copy link
Member

@sgiehl sgiehl left a comment

Choose a reason for hiding this comment

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

@peterhashair it seems you have updated a couple of screenshots that are unrelated to this issue. The updater screenshots are failing for a specific reason, and they should work again, once that issue is fixed. So the changes to them should be reverted. Also you added tests/UI/expected-screenshots/DisablePluginArchive.png, which is not used.

public function setUp(): void
{
$this->setUpWebsitesAndGoals();
$this->setUpConfig();
Copy link
Member

Choose a reason for hiding this comment

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

It would be good to also track some visits in this fixture, maybe one or two with different referrers. That would ensure that no archiving is done. Otherwise the reports would show the data...

@sgiehl sgiehl removed the Needs Review PRs that need a code review label Dec 6, 2021
@peterhashair
Copy link
Contributor Author

peterhashair commented Dec 6, 2021

@sgiehl right, update below. I am not too sure the refer tracking is correct, copied from other fixtures.

  • remove the unrelated UI changes.
  • set up a refer tracking.
  • update screenshot name

@@ -11,6 +11,7 @@
"CloseWidgetDirections": "You can close this widget by clicking on the 'X' icon at the top of the widget.",
"ChooseX": "Choose %1$s",
"DataForThisReportHasBeenPurged": "The data for this report is more than %s months old and has been purged.",
"DataForThisReportHasBeenDisabled": "Segmentation is currently disabled for this report. Please check %1$sthis FAQ%2$s for more details.",
Copy link
Member

Choose a reason for hiding this comment

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

@tsteur Not sure if this will be a feature we are going to use on cloud maybe. In that case I was wondering if linking an FAQ in the message would actually be helpful, as the user can't change that 🤔

Copy link
Member

@sgiehl sgiehl left a comment

Choose a reason for hiding this comment

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

The remaining failing tests seem unrelated, so should be good to merge now. Left a comment regarding cloud, so might be good to wait for an answer.

@tsteur
Copy link
Member

tsteur commented Dec 7, 2021

@sgiehl linking to an FAQ be great, the FAQ could also mention specifically the cloud that if they are on the cloud, to reach out to our support.

@sgiehl
Copy link
Member

sgiehl commented Dec 7, 2021

@peterhashair I have merged in the latest changes from 4.x-dev. If tests are passing, feel free to merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add new configuration to disable archiving the segment reports for specific plugins
5 participants