-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid kind does not throw an error without a kind format configured #688
Comments
hmm, changie definitely does validate the kind is valid, if you are using
It is worth mentioning that changie does not do any validation of the fragment at batch time, only at "new" time. Arguably maybe an incorrect design, but that's why you get the output you do. BodyConfig MinLength is available if you want to enforce body lengths. But again, its only checked at "new" time, not batch. I was not able to get the panic as you were saying, |
Hmm ok I'll keep that in mind. I didn't realise this was the case, that's a bit unfortunate; developers on my team have started using code review to suggest changelog wording fixes directly in the change file, so it's become somewhat normal to hand-edit them. I do get the error from Full error message:
Using 1.19.1 |
We have sort of done the same, it would probably be ideal to check the fragments at batch time, but it would still pass CI/CD unless you add like a I think the idea of validating fragments at batch time is probably a valid issue. Hard to say if it was a bug or not, but at least its a little less misleading when it comes to what is and isn't validated. I see in the code where it might panic/nil ref, but for whatever reason its not doing it for me. Weird. |
hmm, I got the error now, will definitely want to fix this, but it could also be fixed by general fragment validation since its basically just unable to find the right kind to fill in the information for. |
Ok, glad you can reproduce now. I had been using |
Example error from #711
|
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:
We use
changie merge -u '## unreleased
during development butchangie batch
produces the same result.What happened
Normally this invalid
kind
will cause changie to fail withpanic: 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 usekindFormat
, we add the kind tochangeFormat
to implement our needs described in #608:changeFormat: "- **{{.Kind}}**: {{.Body}}"
What we get is this entry in our changelog:
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
The text was updated successfully, but these errors were encountered: