Skip to content

Conversation

@miniscruff
Copy link
Owner

@miniscruff miniscruff commented Dec 28, 2025

Closes #848

Check the following

  • Maintain high code coverage
  • Be properly formatted
  • Documentation changes are included
  • Include a change file if expected

Copy link

@thompson-tomo thompson-tomo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the direction this would be taking us, and on thinking about it during my review i think we would be better suited to further reduce the top level config options as proposed in #847 (comment)

With my prefered document approach we would have

document:
  - key: changelog
    mode: append
    header:
      newlines:
        after: 1
  - key: news
    mode: standalone
    header:
      newlines:
        after: 1
...
project:
  - key: project-A
    documents:
      - changelog
  - key: project-B
    documents:
      - news
      - changelog
  - key: project-C
    documents:
      - news

This config approach would mean that we could have a different combination of docs per project, by default all document templates are used unless it is set.

b.VersionHeaderPath,
b.OldHeaderPath,
b.config.VersionHeaderPath,
b.cfg.ReleaseNotes.Header.FilePath,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be

Suggested change
b.cfg.ReleaseNotes.Header.FilePath,
b.cfg.ReleaseNotes.Version.FilePath,

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably, will take a look


_ = core.WriteNewlines(b.writer, b.config.Newlines.EndOfVersion)
_ = core.WriteNewlines(b.writer, b.config.Newlines.AfterReleaseNotes)
_ = core.WriteNewlines(b.writer, b.cfg.ReleaseNotes.Version.Newlines.After)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This setting was already used and section makes it conceptually clearer.

Suggested change
_ = core.WriteNewlines(b.writer, b.cfg.ReleaseNotes.Version.Newlines.After)
_ = core.WriteNewlines(b.writer, b.cfg.ReleaseNotes.Section.Newlines.After)

_ = core.WriteNewlines(b.writer, b.config.Newlines.EndOfVersion)
_ = core.WriteNewlines(b.writer, b.config.Newlines.AfterReleaseNotes)
_ = core.WriteNewlines(b.writer, b.cfg.ReleaseNotes.Version.Newlines.After)
_ = core.WriteNewlines(b.writer, b.cfg.ReleaseNotes.Newlines.After)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_ = core.WriteNewlines(b.writer, b.cfg.ReleaseNotes.Newlines.After)
_ = core.WriteNewlines(b.writer, b.cfg.ReleaseNotes.Chapter.Newlines.After)


l.Project = pc.Key
projPrefix = pc.Key + config.ProjectsVersionSeparator
projPrefix = pc.Key + cfg.Project.VersionSeparator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
projPrefix = pc.Key + cfg.Project.VersionSeparator
projPrefix = pc.Key + cfg.Project.Version.Separator

for i := range min(int(versionCount), len(vers)) {
if !firstOutput {
err := core.WriteNewlines(writer, config.Newlines.AfterChangelogVersion)
err := core.WriteNewlines(writer, cfg.Changelog.Newlines.After)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This naming feels out of place should we reuse

Suggested change
err := core.WriteNewlines(writer, cfg.Changelog.Newlines.After)
err := core.WriteNewlines(writer, cfg.ReleaseNotes.Section.Newlines.After)

Comment on lines +108 to +109
if cfg.Changelog.Header.FilePath != "" {
err = core.AppendFile(writer, filepath.Join(cfg.RootDir, cfg.Changelog.Header.FilePath))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Increase consistency

Suggested change
if cfg.Changelog.Header.FilePath != "" {
err = core.AppendFile(writer, filepath.Join(cfg.RootDir, cfg.Changelog.Header.FilePath))
if cfg.ReleaseNotes.Title.FilePath != "" {
err = core.AppendFile(writer, filepath.Join(cfg.RootDir, cfg.ReleaseNotes.Title.FilePath))

}

_ = core.WriteNewlines(writer, cfg.Newlines.AfterChangelogHeader)
_ = core.WriteNewlines(writer, cfg.Changelog.Header.Newlines.After)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_ = core.WriteNewlines(writer, cfg.Changelog.Header.Newlines.After)
_ = core.WriteNewlines(writer, cfg.ReleaseNotes.Title.Newlines.After)

Comment on lines +76 to +78
Change ChangeConfig `yaml:"change"`
ReleaseNotes ReleaseNotesConfig `yaml:"releaseNotes"`
Changelog ChangelogConfig `yaml:"changelog"`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consolidated into 1, based on current implementation

Suggested change
Change ChangeConfig `yaml:"change"`
ReleaseNotes ReleaseNotesConfig `yaml:"releaseNotes"`
Changelog ChangelogConfig `yaml:"changelog"`
ReleaseNotes ReleaseNotesConfig `yaml:"releaseNotes"`

Or alternatively if implementation switched

Suggested change
Change ChangeConfig `yaml:"change"`
ReleaseNotes ReleaseNotesConfig `yaml:"releaseNotes"`
Changelog ChangelogConfig `yaml:"changelog"`
Changelog ChangelogConfig `yaml:"changelog"`

However my preference would be

Or alternatively if implementation switched

Suggested change
Change ChangeConfig `yaml:"change"`
ReleaseNotes ReleaseNotesConfig `yaml:"releaseNotes"`
Changelog ChangelogConfig `yaml:"changelog"`
Documents DocumentConfig[] `yaml:"document"`

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am still refining all the terms and parts of the config, it was very rough when I started the design coming up on 2 years ago. I do want to do a full pass over on the anatomy of a changelog which is where some of the terms I have been using will need to be refined a bit. Like "a change" versus the "changelog" is not the most helpful at the moment. I don't even think I have enough of the properties in yet and certainly not all the newline spots. So bare with me.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries. What I think would help is to document the composition of the generated output which will help to check and verify the terminology being used.

See comment on body of PR.

EnvPrefix string `yaml:"envPrefix,omitempty"`

// TODO: docs
Fragment FragmentConfig `yaml:"fragment"`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this also be added to the consolidated property.

Comment on lines +482 to +483
b.cfg.Change.Newlines.Before+1,
b.cfg.Change.Newlines.After,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
b.cfg.Change.Newlines.Before+1,
b.cfg.Change.Newlines.After,
b.cfg.ReleaseNotes.Change.Newlines.Before+1,
b.cfg.ReleaseNotes.Change.Newlines.After,

@miniscruff
Copy link
Owner Author

Unrelated but I never expected to get any reviews so I didn't have my discord webhook enabled for PR reviews

@thompson-tomo
Copy link

thompson-tomo commented Dec 30, 2025

What would be helpful is to be able to see a visual & textual representation of the composition of a document produced by changie.

My thoughts would be the following:

  • A document is generated by the changie merge process. The document contains a title followed by one or more chapters.
  • A chapter represents a component and contains atleast a heading ie name of the component followed by one or more sections
  • A section represents a version and contains atleast a heading ie version followed by one or more blocks of content
  • A block represents either an issue-kind and contains atleast a heading ie issue-kind followed by one or more fragments when generated by changie or is a user defined block similar to what we have with versionHeader etc.
  • A fragment represents what was changed

For simplicity purposes this solution would mean we remove the changeFormat & format option from KindConfig and instead add them to a new BlockConfig option along with a list of issue kinds to be included in that fragment. The nice thing is it would enable issue kinds to easily be grouped together into a single block, allows multiple custom fragments with the potential for blocks to be between issue kinds etc.

@miniscruff
Copy link
Owner Author

What would be helpful is to be able to see a visual & textual representation of the composition of a document produced by changie.

My thoughts would be the following:

* A `document` is generated by the changie merge process. The document contains a `title` followed by one or more `chapters`.

* A `chapter` represents a `component` and contains atleast a `heading` ie name of the `component` followed by one or more `sections`

* A `section` represents a `version` and contains atleast a `heading` ie `version` followed by one or more `blocks` of content

* A `block` represents **either** an `issue-kind` and contains atleast a `heading` ie `issue-kind` followed by one or more `fragments` when generated by changie **or** is a user defined block similar to what we have with versionHeader etc.

* A `fragment` represents what was changed

For simplicity purposes this solution would mean we remove the changeFormat & format option from KindConfig and instead add them to a new BlockConfig option along with a list of issue kinds to be included in that fragment. The nice thing is it would enable issue kinds to easily be grouped together into a single block, allows multiple custom fragments with the potential for blocks to be between issue kinds etc.

Hm, a very different set of terms, here is the layout from the original discussion I created, ignoring the header/footer stuff:

Release Notes:

<version>
<for each component if enabled>
	<component>
<end component>

<for each kind if enabled>
<kind>
<end kind>

<for each fragment file>
    <fragment>
<end fragment>

Where version, component, kind and fragment are just a format we output.
And each has a separate option for before and after newlines.

Changelog File:

<header>
<for each release note>
    <release note file>
<end release note>

To phrase it similar to you, the list is something along the lines of:

  1. A changelog is generated by the changie merge command. It contains one or more release notes. It may also be split into different projects.
  2. A project is an optional layer by splitting one changie config, and likely one repository, across many output changelogs. By in large, you are meant to configure each project identically, otherwise you might be better of just creating a different .changie.yml in each directory.
  3. A release note is generated by the changie batch command and represents a single releasable point with a semver version. It contains one or more fragments ordered by component if configured, and by kind if configured.
  4. A component is an optional layer of organization that allows you to split a single release note into smaller sections while only maintaining one changelog.
  5. A kind is an optional layer for release notes that allows specifying per fragment what type of change you made. Think feature, refactoring, security and so on.
  6. A fragment represents a single user affected change. If configured a fragment also includes a kind, component or project.

Maybe that is intuitive, not sure, it's kinda late.

@thompson-tomo
Copy link

thompson-tomo commented Jan 1, 2026

So a comparison of the options would be:

option a option b option c
changelog document document
project chapter - component chapter - project
release note - version section - version section - version
component sub-section - component
kind block - kind block - kind
fragment fragment fragment

What I had missed was multiple projects in 1 document, hence new option c.

Personally I don't like using terms like changelog/release notes to describe the parts of the file produced as for me and I am sure other people, they are different things with many differences making them alternatives and not subset. See announcekit.app, releasecat.io, changelogfy, appcues.com, releasenotes.pm etc which highlight my thinking.

In my past role for each release I was creating 3 documents each with different audiences:

  • changelog - support team
  • release notes - field engineers & customers
  • release news - Sales team & customers

Also by using generic terms we allow for greater reuse including adr use case etc

@miniscruff
Copy link
Owner Author

So a comparison of the options would be:
option a option b option c
changelog document document
project chapter - component chapter - project
release note - version section - version section - version
component sub-section - component
kind block - kind block - kind
fragment fragment fragment

What I had missed was multiple projects in 1 document, hence new option c.

Personally I don't like using terms like changelog/release notes to describe the parts of the file produced as for me and I am sure other people, they are different things with many differences making them alternatives and not subset. See announcekit.app, releasecat.io, changelogfy, appcues.com, releasenotes.pm etc which highlight my thinking.

In my past role for each release I was creating 3 documents each with different audiences:

* changelog - support team

* release notes - field engineers & customers

* release news - Sales team & customers

Also by using generic terms we allow for greater reuse including adr use case etc

While I appreciate the research and thought put into this. I have a few comments:

  1. Using changelog as the final output is intentional, it is kinda where the name changie comes from.
  2. The use of release notes as it pertains to the output of batch may not be the most accurate according to those guides, if you write technical fragments. But, I have suggested to many, and it should be somewhere in the docs, that you write fragments to be user facing, such that you could share them.
  3. The idea of even having two steps, a batch and merge, is so that after you batch, you could manually add content separate from the fragments, such as images, overviews or calls to action.
  4. This more or less aligns with the definition that I can read ( granted I am not feeling great so I will be re-reading them soon )
  5. Now, your terms are quite accurate in terms of an extremely generic output documents. But, since these are just internal terms, and the output of changie is changelog specific, I prefer trying to keep it specific to changelogs.
  6. Projects have separate changelogs, that is why you would use projects, if you want separate changelogs. If you wanted a single changelog you would use a combination of components and kinds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Configuration Format Overhaul

3 participants