Skip to content
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

changie batch should throw a better error message when a change entry yaml is invalid yaml #554

Closed
rocktavious opened this issue Oct 20, 2023 · 4 comments · Fixed by #556
Labels
bug Something isn't working

Comments

@rocktavious
Copy link
Contributor

rocktavious commented Oct 20, 2023

Description
Using the latest version of changie seems to have broken our deployment pipeline. We run changie batch v2023.10.20 today and we get the following error

yaml: line 2: mapping values are not allowed in this context

This worked on our last release v2023.10.3

What happened

yaml: line 2: mapping values are not allowed in this context

Expected behavior
To create the batch of changes

Additional context
Here is the .changie.yaml we are using

changesDir: ".changes"
unreleasedDir: unreleased
headerPath: header.tpl.md
changelogPath: CHANGELOG.md
versionExt: md
versionFormat: '## [{{.Time.Format "January 02, 2006"}}](https://github.com/OpsLevel/opslevel-go/compare/{{.PreviousVersion}}...{{.Version}})'
kindFormat: '### {{.Kind}}'
changeFormat: '* {{.Body}}'
kinds:
- label: Bugfix
- label: Feature
- label: Security
- label: Refactor
- label: Deprecated
- label: Removed
- label: Docs
- label: Dependency
newlines:
  afterChangelogHeader: 1
  beforeChangelogVersion: 1
  endOfVersion: 1
envPrefix: CHANGIE_
@rocktavious rocktavious added the bug Something isn't working label Oct 20, 2023
@rocktavious
Copy link
Contributor Author

hmm it appears this was due to a change entry with bad yaml

kind: Deprecated
body: BREAKING CHANGE: TeamMembershipUserInput Email field replaced with User field
time: 2023-10-13T13:27:10.249548-05:00

was the entry and you can see there is a non-escaped : or not quotes around it.

switching it to

kind: Deprecated
body: "BREAKING CHANGE: TeamMembershipUserInput Email field replaced with User field"
time: 2023-10-13T13:27:10.249548-05:00

Fixed the changie batch command. Maybe it would be good to be more explicit which .yaml file was failing to be parsed?

@miniscruff
Copy link
Owner

hmm it appears this was due to a change entry with bad yaml

kind: Deprecated
body: BREAKING CHANGE: TeamMembershipUserInput Email field replaced with User field
time: 2023-10-13T13:27:10.249548-05:00

was the entry and you can see there is a non-escaped : or not quotes around it.

switching it to

kind: Deprecated
body: "BREAKING CHANGE: TeamMembershipUserInput Email field replaced with User field"
time: 2023-10-13T13:27:10.249548-05:00

Fixed the changie batch command. Maybe it would be good to be more explicit which .yaml file was failing to be parsed?

Was this file manually written or did changie create a bad file?

A more explicit error sounds like a good plan as well, I would of had a hard time finding that.

@rocktavious
Copy link
Contributor Author

@miniscruff looks like it was due to a inline github edit 😢
Screen Shot 2023-10-20 at 4 18 37 PM

So ya no problem with changie - just a better error message would help. After i regenerated the .changie.yaml from scratch and used the baseline the tool generates and it still was erroring it hit me it might be a change entry yaml file. Sure enough. 😢

@rocktavious rocktavious changed the title changie batch is broken? changie batch should throw a better error message when a change entry yaml is invalid yaml Oct 20, 2023
@miniscruff
Copy link
Owner

@miniscruff looks like it was due to a inline github edit 😢
Screen Shot 2023-10-20 at 4 18 37 PM

So ya no problem with changie - just a better error message would help. After i regenerated the .changie.yaml from scratch and used the baseline the tool generates and it still was erroring it hit me it might be a change entry yaml file. Sure enough. 😢

Ok yea that makes sense. A new issue to update the error to include which file would be good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants