readthedocs.org
readthedocs.org copied to clipboard
Build: run `cat readthedocs.yaml` even when there is a config error
I just realized that we first validate the readthedocs.yaml file and then run cat readthedocs.yaml to show its content. What happens? If there is a syntax error or a missing required value or anything, we don't run the cat command. This makes hard to debug and understand what's going on.
We should first run the cat command and after that validate the file. This will help a lot with UX.
Example: https://beta.readthedocs.org/projects/test-builds/builds/23364407/
Related to
- https://github.com/readthedocs/readthedocs.org/issues/7005
- https://github.com/readthedocs/readthedocs.org/issues/4288
This issue would have been being helpful on this case https://github.com/readthedocs/readthedocs.org/issues/11173 where the user had two YAML file in the repository and Read the Docs was picking the incorrect one.
I took a look at this and it seems we need to split the readthedocs.config.config.load() function into two:
- find the YAML file to load
- load the YAML file and validate it
Moving out 1) will allow us to know what's the file we will be loading and show it to the user before loading and validating.
I think this an okay first step to take, but discussed next steps on this particular command more in #7005.