(I don't have Twitter so this is my tech community...
# general
b
(I don't have Twitter so this is my tech community) How do people handle reviewing changes to a file-generator? Our engs have a file checked into git because it means they can review the changes made to the generator, but other than that there's no point.
My first thought is a shadow-repo we use which holds onto the sample generated files by generating them on pushes to master. Then it comments on PR if a PR makes changes that produces a different result. 🤔
e
A checked-in "golden file" is a thing. Seems fine for text files anyway. Is this code or data?
I have a feeling you're leaving off potentially relevant details. Is the file huge; so not palatable for version control? Is it binary?
b
Not code, text data. Not huge by git's standards. We just have a lot lying around and it's awkward.
Also it's funny, the team that owns it wants it in to review changes, but also wants to stop being notified of changes. But that's a different story 😂
e
I don't get the review aspect. I've only ever used golden files as part of automated tests. Any change, test fails.
I mean, you review the file if the test fails ... should the format change, etc. But you don't actively review it.
b
Ah yeah that'd be a snapshot test. This isn't that
e
Ok. This feels too I'll defined in my head to register as a problem or, if it is one, the solution. I'm sure others will have opinions.
h
wouldn't you want to have a test that verifies the generator against the checked in file?
b
I think I'm seeing it how y'all are seeing it now, and I think I'm probably missing something
h
I.e., human verifies that generated file makes sense, and test verifies that the generator does in fact produce that output
b
Right. I figured out where the disconnect is. This isn't for testing/verifying the generator. The "generator" and the generated file are actually litmus testing a set of classes which produce data of varying kinds. Someone changes a class, or adds one, and then a script has us collecting a representative set of data from all the classes of the relevant type. So really, it's something a bit... else