So if I’m not mistaken, that means that if a plugin wants to override any of the settings that Tutor hardcodes (say, setting ENABLE_GRADE_DOWNLOADS to false in the lms-env-features patch), it’s the hardcoded definition that comes last and therefore applies.
Maybe I’m missing something, but shouldn’t the patch() invocations move from the top to the bottom of the FEATURES dictionary? Or, else, should there be configuration settings for all these hardcoded values, so that no plugin is needed to set them?
In general, I think it’s better if the *-env-features patches are not implemented. I have no idea how the Python json loader interprets identical keys with different values. Instead, you should enable the features from the settings patches. Remember that in such cases the patch should be formatted as Python code. For instance:
OK, that’s a bit of a surprise — the documentation doesn’t really say anything about some patches being preferred over others, so it’s not straightforward for plugin authors to discern which patches they should use and which they had rather not.
So is that a general recommendation? When in doubt, don’t use *-env-features, use *-settings instead?
As I am in the process of testing the migration of our Native environment to the Tutor environment, I was wondering about this because we have a lot of FEATURES activated that are not in the basic FEATURES available in the $(tutor config printroot)/config.yml file.
It wasn’t clear to me if I needed to include them in the $(tutor config printroot)/config.yml file or directly in the lms.env.json or cms.env.json files. From what I now understand, the json files would be overwritten the next time I rebuild my environment.
Which brings the question, how do separate the FEATURES for the lms from those for the cms in the config file?
Yes, you’re right Florian. The documentation does not really state that as a fact because it’s more of a personal opinion of mine. It’s just that I find that is much easier to patch python modules than json (or even yaml) files.
Actually, I am planning on migrating the lms/cms.env.json files to yaml in the Nutmeg release. We should take that opportunity to add a big warning at the top of the file: “Are you quite sure that you want to make changes to this file and not to the Python settings?” and then list all of the reasons why patching these files is not such a great idea.
This happens to be one of the rather confusing things that struck me when I first started working with Tutor: is there a particular reason why Tutor has stuck to lms.env.json when Open edX (with edx-configuration, pre-Maple) has been building /edx/etc/lms.yml files for a while now?