readthedocs-build icon indicating copy to clipboard operation
readthedocs-build copied to clipboard

Tests for traversal merging

Open agjohnson opened this issue 8 years ago • 4 comments
trafficstars

Looking quickly, it doesn't appear we have tests to test how a configuration file is merged if a nested configuration file is found.

I would expect:

  • Both files are found
  • The top level readthedocs.yml configuration has precedence
  • The nested readthedocs.yml doesn't merge in its keys to our configuration

agjohnson avatar Nov 15 '17 18:11 agjohnson

I don't fully understand this, at the end the top level configuration file is the one that is considered to load the settings and the nested file is ignored?

stsewd avatar Feb 25 '18 04:02 stsewd

There were some wonky ideas around the spec for our config early on. I do believe that child readthedocs.yml files will merge into the parent file. I'd probably say we don't want this behavior at all, right? If i have a parent readthedocs.yml file, there should be no case where I want my child readthedocs.yml file parsed. The only case I can think of is a repo with multiple projects in it, and potentially multiple readthedocs.yml files.

agjohnson avatar Mar 06 '18 07:03 agjohnson

+1 to removing this, and only supporting one file. I believe the "rtd.yml selection" code already does this, so we should remove the complexity in parsing that is needed for this support.

ericholscher avatar Mar 06 '18 07:03 ericholscher

I search in all the code and couldn't find nothing related to merging configuration files

There is only one test that has nested configuration files

https://github.com/rtfd/readthedocs-build/blob/15ad6112b3e87e72c22182af3b1765d35c19ea82/readthedocs_build/config/test_config.py#L95-L103

But here the filter isn't needed, since the code only loads and parse one configuration file (about this should be the test, then? Test that the code only parse one configuration file on load?).

stsewd avatar Mar 08 '18 04:03 stsewd