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

Splitting config.sample.php into two files for core and app #32387

Merged
merged 1 commit into from
Sep 3, 2018

Conversation

mmattel
Copy link
Contributor

@mmattel mmattel commented Aug 20, 2018

Description

This PR splits the current config.sample.php into two files:

config.sample.php core related
and
config.apps.sample.php apps related

config.sample.php contains all keys for the core system.
It stays more or less the same, only one set of keys has been moved.
(The moved keys are not used when installing the system from scratch so no issue.)

config.apps.sample.php contains now all keys for apps provided by ownCloud.
I went thru all repros and added all keys I have identified and described on best effort.

Related Issue

Motivation and Context

It clearly seperates keys used by core and those by apps.
It helps app developers to add keys to the right location

How Has This Been Tested?

  • test environment:
    no test needed

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • Backport (if applicable set "backport-request" label and remove when the backport was done)

@settermjd as discussed on talk, you need to update your script generating the documentation version to add the new file.

Note: we are planning the same split for occ commands in documentation.

@codecov
Copy link

codecov bot commented Aug 21, 2018

Codecov Report

Merging #32387 into master will decrease coverage by 0.01%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #32387      +/-   ##
============================================
- Coverage     64.06%   64.05%   -0.02%     
  Complexity    18634    18634              
============================================
  Files          1176     1177       +1     
  Lines         70152    70164      +12     
  Branches       1270     1270              
============================================
  Hits          44944    44944              
- Misses        24838    24850      +12     
  Partials        370      370
Flag Coverage Δ Complexity Δ
#javascript 52.89% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 65.32% <0%> (-0.02%) 18634 <0> (ø)
Impacted Files Coverage Δ Complexity Δ
config/config.apps.sample.php 0% <0%> (ø) 0 <0> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b04a4a7...8b3c180. Read the comment docs.

@PVince81
Copy link
Contributor

to me a first look as an admin I would guess that I need two config files: config.php and config.apps.php instead of a single one.

does that work in practice ? as far as I remember the detection pattern was "xx.config.php"

@mmattel
Copy link
Contributor Author

mmattel commented Aug 21, 2018

We have to decide what we want.
Either there is one sample file fits all, or two files splitting content for core and apps.
The latter (split) was often requested and makes sense, especially because of growing #keys and apps.
It was not intended to have/use a second active config.php file.
I have not found a description in documentation or code in core to have multiple active config files... ?

The intention was to have two sample files.
The active config.php file is generated on installation, all additions you want to have are added respectively copied there, based on sampe file(s). This is the standard way of doing.

If there is the possibility of having multiple active config.php files in parallel behaving like one, we have to document that. But if this is the case, it would be inline with the statement below:

I have already added on top of config.apps.sample.php a description how to enable keys:

 * All keys are only valid if the corresponding app is installed and enabled.
 * You MUST copy the keys needed to the active config.php file.

@PVince81
Copy link
Contributor

The latter (split) was often requested

do you have a reference for this ?

From what I see in the doc https://doc.owncloud.org/server/10.0/admin_manual/configuration/server/config_sample_php_parameters.html#config-php-parameters if you have several config files it would read from them but never write there. And those files take precedence over config.php. Now I wonder how this behaves if values are specified in separate files that do get rewritten by OC in config.php...

This also means that if we recommend people to have a separate apps.config.php file, the values there will never be writable by OC itself. This is only acceptable in scenarios where the admin explicitly agreed to have read-only config files in general.

My worry is that with this seemingly small change we're opening a can of worms.

What speaks against just re-sorting the keys inside config.sample.php and have a clear separator between "these are values for core" and "these are values for apps", maybe even sorted by app names ?

@mmattel
Copy link
Contributor Author

mmattel commented Aug 26, 2018

Reference for this request: @DeepDiver1975 He very much wanted it, at least I understsood this in that way. There were also other discusions in the past where I at least remember that splitting was a point but I cant remember the issues.

Again, I wanted to split the sample file. Not the config file itself even it is possible (I gave it a try and yes it works as you described). Primarily I would like to have one active config and not multiple. If you look around, the doc you referenced ist the only place this gets mentioned. The doc also explicity mentions to have as example the mail config in a seperate file, even now core writes eg mail changes to config.php...
So a new file is not a new mess, the box of worms as you describe it is already open since a while !

My very first attempt was to have a section to seperate content but @DeepDiver1975 insisted on splitting. Now where there are two files created, this looks imho much better and gives a better overview. As said, the description on top of the file clearly states that you should copy all relevant keys to config.php, no mentioning about multiple xxx.config.php

Finally, we have the same in splitting the occ command reference, see link above. This would be harmonized with this one.

@mmattel
Copy link
Contributor Author

mmattel commented Aug 28, 2018

Updated the apps file to run with the converter script for documentation repro.
For more details pls see the result in the refrenced doc PR

@mmattel
Copy link
Contributor Author

mmattel commented Sep 3, 2018

@PVince81 any (hopefully positive) statements?

@PVince81
Copy link
Contributor

PVince81 commented Sep 3, 2018

oh, I thought you guys merged this already

My very first attempt was to have a section to seperate content but @DeepDiver1975 insisted on splitting.

Would be good to have a link to the statement for this, to be sure there was no misunderstanding in writing.

At this point I don't really care

@mmattel
Copy link
Contributor Author

mmattel commented Sep 3, 2018

Here is the link as requested: #32268 (comment)

@PVince81 could you merge, I will asap create the backport

@PVince81
Copy link
Contributor

PVince81 commented Sep 3, 2018

hmm, I'd interpret the comment more to make it about having some file inside app repositories.
ok, so that could be the next step after this PR.

Fine, let's merge 👍

@PVince81 PVince81 merged commit b703769 into master Sep 3, 2018
@PVince81 PVince81 deleted the config.apps.sample.php branch September 3, 2018 15:36
mmattel pushed a commit that referenced this pull request Sep 3, 2018
….php

Splitting config.sample.php into two files for core and app
@lock lock bot locked as resolved and limited conversation to collaborators Sep 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

config.sample.php does not mention activity_expire_days
2 participants