-
Notifications
You must be signed in to change notification settings - Fork 44
Description
Thanks for submitting a bug report, please fill in the following details.
Description
I recently had a misuse of a tempate function in my changie.yaml which led to an expected error when running changie batch auto. The unexpected part was that it still produced a partial changelog. The specific issue I had was only sending in one arg to the customs function instead of two. This led to changie stopping processing but not before it wrote to the next version's changelog "fragment" (not sure how you refer to it internally 😅 ) that lives under the .changes directory.
I understand how things are happening in code and I know this was user error but it might be good to save the user from their own mistakes sometimes. I could see this happening and being ignored or not seen before running changie merge and a release being cut before it's ever noticed...then there's larger issues to overcome. This is just one issue I ran into but if templates are being written and not cleaned up on error I can see it happening for different types of user errors.
Reproduction Steps
Steps to reproduce the behavior:
- Set the
changeFormatkey inchangie.yamlto intentionally misuse thecustomstemplate function so it errors:{{customs .Changes}} - Run
changie newand create a new change for one of the projects - Run
changie batch auto - See error
What happened
An error like:
Error: template: {{customs .Changes}}:1:2: executing "{{customs .Changes}}" at <customs>: wrong number of args for customs: want 2 got 1
as well as a versioned changelog file that looked like
## 1.5.0 - 2024-09-09
### Feature
Expected behavior
An error but nothing written to any files or files cleaned up before the process exits.
Additional context