https://pantsbuild.org/ logo
#general
Title
# general
b

bitter-ability-32190

08/08/2022, 12:48 AM
(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

enough-analyst-54434

08/08/2022, 12:51 AM
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

bitter-ability-32190

08/08/2022, 12:53 AM
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

enough-analyst-54434

08/08/2022, 12:54 AM
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

bitter-ability-32190

08/08/2022, 12:59 AM
Ah yeah that'd be a snapshot test. This isn't that
e

enough-analyst-54434

08/08/2022, 1:07 AM
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

happy-kitchen-89482

08/08/2022, 1:31 AM
wouldn't you want to have a test that verifies the generator against the checked in file?
b

bitter-ability-32190

08/08/2022, 10:12 AM
I think I'm seeing it how y'all are seeing it now, and I think I'm probably missing something
h

happy-kitchen-89482

08/08/2022, 2:52 PM
I.e., human verifies that generated file makes sense, and test verifies that the generator does in fact produce that output
b

bitter-ability-32190

08/08/2022, 2:54 PM
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
2 Views