YAML To The Rescue?

Here at work, we have been run­ning into a lot of issues syn­chro­niz­ing the default con­fig­u­ra­tions pro­vid­ed by the devel­op­ers with those that have been pro­vid­ed by the team respon­si­ble for pack­ag­ing releas­es. The sys­tem as it is right now is, how shall we say, clunky, at best, requir­ing the devel­op­ers to go back and recon­fig­ure new fea­tures mul­ti­ple times through­out an iter­a­tion, often every evening before the night­ly build. This sim­ply will not stand. 

We have dis­cussed many times the issues and some pos­si­ble solu­tions. The devel­op­ers want some­thing they can check into source con­trol, run diffs on, and track changes over time. The oth­er team wants some­thing that they can manip­u­late through the User Interface. We have kicked the idea around sev­er­al times to make use of XML files to store the con­fig­u­ra­tion, and writ­ing meth­ods to read and write those files based on the changes made in the UI

This is prob­a­bly a clas­sic approach (I don’t know; in my career, I don’t think I’ve ever encoun­tered a “clas­sic” approach before.), but I have some mis­giv­ings. First off, XML is hard to read, and hard to write. Secondly, and per­haps a big­ger issue (for me), when the frame­work out­puts the con­fig­u­ra­tions gen­er­at­ed via the UI, it may look sig­nifi­gant­ly dif­fer­ent than it did before, effec­tive­ly ruin­ing the advan­tages of using tools like diff on the files as they change. But the biggest issue in our envi­ron­ment is merg­ing the con­fig­u­ra­tions com­ing from oth­er teams and ours. Unless a devel­op­er does it (at least par­tial­ly) by hand, the chances are high that the final prod­uct will end up as bad XML, and we are sud­den­ly star­ing at the same prob­lem we ini­tial­ly set out to solve. 

Enter YAML. Simple on the sur­face, com­plex as you delve into it, but easy to read and write, diff or merge. I think that’s the solu­tion to all of our prob­lems. Problem is, I haven’t (in my ten min­utes of research) yet found a good .NET imple­men­ta­tion to read and write it. 

Now, I real­ize that there may be some­thing awe­some out there, and if I find it, I’ll like­ly use it for the job at hand, but now I’ve found myself a project. Over the next cou­ple of weeks/months/whatever, I’m going to write my own imple­men­ta­tion of Yaml.NET.

Wish me luck!

Share