Closed zackw closed 1 year ago
The logic to update seems to be in assessment.rb#dump_yaml
Regarding your question about the commit hash, it is not exposed on the website.
The code running in production can be found on the fork https://github.com/cg2v/Autolab
The current code is on the branch https://github.com/cg2v/Autolab/commits/deploy-fall-2022-1
We are using the Psych
Library for generating YAML files, and unfortunately it seems that it does not support a way to sort keys (https://github.com/ruby/psych/issues/542).
Possible workaround: https://stackoverflow.com/a/56137489
Your environment Carnegie Mellon's Autolab at https://autolab.andrew.cmu.edu/
Autolab v2.8.0 (Is the exact commit hash exposed anywhere on the website?)
Steps To Reproduce
git diff
the assessment configuration file.Example noisy diff
The first "hunk" of this diff is entirely due to reordering of mapping keys; nothing has actually changed. The second hunk shows the change I did make.
Desired diff for the same actual change
Notes
I don't speak Ruby, but https://dzone.com/articles/generating-yaml-hashes-sorted looks like it could be useful as, at least, a starting point for the fix. It is not strictly necessary for the keys to be sorted; the important thing is for them to always be written out in the same order; but sorting them is probably the easiest way to achieve that.