Skip to content

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

Closed

Description

@rocktavious

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_

Activity

  1. rocktavious commented on Oct 20, 2023

    @rocktavious
    ContributorAuthor

    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?

  2. miniscruff commented on Oct 20, 2023

    @miniscruff
    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.

  3. rocktavious commented on Oct 20, 2023

    @rocktavious
    ContributorAuthor

    @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. 😢

  4. changed the title [-]changie batch is broken?[/-] [+]changie batch should throw a better error message when a change entry yaml is invalid yaml[/+] on Oct 20, 2023
  5. miniscruff commented on Oct 20, 2023

    @miniscruff
    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

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