Regen tasks should only overwrite existing files if successful #2454
Labels
C-test-infra
Component: Integration test infrastructure
good first issue
Good for newcomers
help wanted
Issue needs an assignee
S-small
Size: One afternoon (small bug fix or enhancement)
T-enhancement
Type: Nice-to-have but not required
Milestone
We have a bunch of regen-style tasks (testdata, diplomat-gen, fingerprint, ffi-coverage) where we generate a bunch of files on top of checked-in files (and typically, check the difference on CI)
They typically work by deleting the existing files, running the task, and then overwriting the file. This means that if the task fails, the files will be in a weird state that often needs to be reset from git. Furthermore, for testdata,
git status
is basically useless during the long-running testdata regeneration.I think these tasks should run the generation to some temporary folder first, and only if the generation step succeeds, delete the old files and copy over new ones.
The text was updated successfully, but these errors were encountered: