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 undocumented (ie, unsupported) config option (DI config only) to disable forcing range archiving on browser request. #7113

Merged
merged 5 commits into from Feb 4, 2015

Conversation

diosmosis
Copy link
Member

As title. From pro request on slack.

If in the future we decide there's a better way to do this, we can remove the option w/o any issue. If we decide it's a good thing, we can add an INI config option.

@tsteur
Copy link
Member

tsteur commented Jan 31, 2015

@diosmosis I'm curious how PRO would change this config value when not adding to INI? By using a plugin? A change to this file would be overwritten on an update.

BTW: Is there maybe a && !SettingsServer::isArchivePhpTriggered() needed? Not sure if we have tests for archiving range dates via core:archive etc. If not, a test would be nice.

If in the future we decide there's a better way to do this, we can remove the option w/o any issue. If we decide it's a good thing, we can add an INI config option.

Maybe also have a look at #7095 (comment) we need to clean up this mess. Don't have to do it in this PR though. Just FYI

@diosmosis
Copy link
Member Author

@diosmosis I'm curious how PRO would change this config value when not adding to INI? By using a plugin? A change to this file would be overwritten on an update.

If they add the setting to a config/config.php file it should override the global config, see:
https://github.com/piwik/piwik/blob/master/core/Container/ContainerFactory.php#L65

That said, it would be simpler to just not put a default value in global.ini.php and handle the case where empty(Config::getInstance()->General[...]) === true.

BTW: Is there maybe a && !SettingsServer::isArchivePhpTriggered() needed? Not sure if we have tests for archiving range dates via core:archive etc. If not, a test would be nice.

I don't think archiving ranges via core:archive is supported? I remember this is something that is being worked on but I don't think it's merged yet (haven't checked).

That said, it shouldn't be needed.

@tsteur
Copy link
Member

tsteur commented Feb 1, 2015

setting to a config/config.php file it should override the global config

Sweet, didn't know that

I don't think archiving ranges via core:archive is supported? I remember this is something that is being worked on but I don't think it's merged yet (haven't checked).

I thought that's why one wants to disable it via browser? If it isn't pre-archived via core:archive and is not processed via browser then one could simply disable range dates or not? Isn't there a config entry? Maybe I don't understand it

@diosmosis
Copy link
Member Author

I thought that's why one wants to disable it via browser? If it isn't pre-archived via core:archive and is not processed via browser then one could simply disable range dates or not? Isn't there a config entry?

Ok, from the slack chat, @mgazdzik is working on a command for pre-processing ranges. I'll add a test for archiving ranges via CLI.

if (StaticContainer::get('archiving.range.force_on_browser_request') !== false) {
return false;
} else {
Log::verbose("Not forcing archiving for range period.");
Copy link
Contributor

Choose a reason for hiding this comment

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

By the way in PSR-3 the log level "verbose" doesn't exist, I aliased it to "debug". So using verbose is the same as using debug.

@diosmosis
Copy link
Member Author

@tsteur Added some tests, mind taking another look?

@tsteur
Copy link
Member

tsteur commented Feb 3, 2015

As long as it works I'm happy with it :) Just out of curiosity, is there a reason why you know longer use DI but config? I presume PRO will set a value then in config and they can maybe set it per instance / hostname this way?

@diosmosis
Copy link
Member Author

Just out of curiosity, is there a reason why you know longer use DI but config?

Using DI config was an experiment. It might be a good idea, but since there was a simpler and more standard way to accomplish the same thing I went w/ that. Principle of least surprise and all that.

@tsteur
Copy link
Member

tsteur commented Feb 3, 2015

sweet :)

diosmosis added 5 commits February 4, 2015 13:00
…disable forcing range archiving on browser request.
…fig w/o adding documented default in global.ini.php and just handle case where config option is not defined.
…ion that makes sure range archiving is correctly enabled/disabled.
…:debug since Log::verbose is meaningless w/ monolog).
@diosmosis diosmosis force-pushed the allow_disable_range_archiving branch from e18e070 to 98cf703 Compare February 4, 2015 21:03
diosmosis added a commit that referenced this pull request Feb 4, 2015
Add undocumented (ie, unsupported) INI config option to disable forcing range archiving on browser request.
@diosmosis diosmosis merged commit f2fc752 into master Feb 4, 2015
@diosmosis diosmosis deleted the allow_disable_range_archiving branch February 4, 2015 22:00
@mattab
Copy link
Member

mattab commented Feb 9, 2015

The new setting looks good!

Feedback

  • I think all settings should be documented in global.ini.php simply for us already to remember what they do, maybe we could add it around browser_archiving_disabled_enforce

@mattab mattab added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Feb 16, 2015
diosmosis pushed a commit that referenced this pull request Feb 16, 2015
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.

None yet

4 participants