Skip to content

Invalid kind does not throw an error without a kind format configured #688

@TheSpyder

Description

@TheSpyder

Description
I have a developer who appears to have hand-crafted a changelog message; I'm still working out what happened but in the meantime I think changie should be failing in this case and it doesn't.

Reproduction Steps
I'll attach a full replication zip, but the change file turned out like this:

kind: "Added a whoopsie"
body: 
time: 2024-07-24T12:08:15.373536+10:00

We use changie merge -u '## unreleased during development but changie batch produces the same result.

What happened
Normally this invalid kind will cause changie to fail with panic: runtime error: invalid memory address or nil pointer dereference, which is arguably a bug - better validation of change inputs would be nice - but in this case it doesn't fail because we don't use kindFormat, we add the kind to changeFormat to implement our needs described in #608:
changeFormat: "- **{{.Kind}}**: {{.Body}}"

What we get is this entry in our changelog:

- **Added a whoopsie**: 

Expected behavior
Changie should throw some sort of error, both about the invalid kind and the empty body. Ideally a nice error rather than the panic runtime error.

Additional context
kind-replication.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions