Ha! That’s a good one. I should keep it as a quiz question for future interviews with project @maintainers
Can someone spot the mistake here? Bonus question: how could we improve the error log such that future developers don’t fall in the same trap?
Click to reveal the solution
The problem is that in your yaml file the patches are dict entries, and not strings. To write these values as strings, you must add a multiline character “|” for every patch:
To improve the error log, we should check that patch entries are actually strings, or convert them so strings.
It might be surprising that Tutor fails with this error despite the recent introduction of type annotations. In this particular case, the error is ignore because of a cast(...) statement, which goes to show how harmful type casting can be.
EDIT: as a side note, the “common-env-feature” patch should be renamed to “common-env-features”.
Are you quite sure that you are editing the file in $(tutor plugins printroot)/ and not your original yaml file? The plugin.yml file is copied to this directory when you run tutor plugins install and gets loaded from there.
If it wasn’t the case the stackstrace would have not change when I changed “common-env-feature” to “common-env-features” (as you can see in my third answer). It didn’t throw an error in the first case because I mispelled it.