Giter Club home page Giter Club logo

Comments (9)

bvieira avatar bvieira commented on June 15, 2024 1

Hello, thanks for trying to use sv4git 😃

It's not exactly a bug because it's implemented to work like this, but in the future I would like to implement in a way that is possible to choose the sections in changelog and also join them in a section called misc.

Any ideas or feedback is more then welcomed!

from sv4git.

bvieira avatar bvieira commented on June 15, 2024 1

The problem right now is that release-notes.headers is a map, so it is an unordered collection and I won't be able to get the sections order from it.

I need to check if go-yaml support any kind of ordered map or custom structure, but I found some open issues related to that.

One option would be add another attribute to sort it, but I think it would be error prone. It would be easy to add a new headers and forget to add it in the order array.

release-notes:
    headers:
        breaking-change: Breaking Changes
        feat: Features
        fix: Bug Fixes
    order: [feat, fix, refactor, perf, test, build, ci, chore, docs, style,breaking-change]

Another option would be create a new attribute for sections and deprecate the headers attribute. With this, would be possible to group commit types in a single section. Breaking changes is a special case because it has only messages and not commit types.

release-notes:
    sections:
        - name: Features
          commit-types: [feat]
        - name: Bug Fixes
          commit-types: [fix]
        - name: Misc
          commit-types: [perf, docs]
        - name: Breaking Changes
          template: breaking-change

from sv4git.

bvieira avatar bvieira commented on June 15, 2024 1

Okay then I misunderstood something. But just to be clear: I don't want to reorder or change existing sections. I want to add an additional one targeting another commit type.

I know, but right now, the types for sections are hardcoded on the template, it would be easy to loop in the headers for each key/value but the order would be a problem..

Maybe I should just support the other types in a fixed order, and then do the refactor to support group and custom order..

Although I'd suggest consolidating template and commit-types into something like content, because in the end all sections are bullet lists, right?

no, breaking-change is not a commit type. The sections with commit types has scope, commit hash and issues, but the section for breaking change has only a message. Right now there is 2 templates for sections (breaking change and commit), but the group probably would need another one, maybe to show the commit type..

from sv4git.

hypervtechnics avatar hypervtechnics commented on June 15, 2024 1

Wow thank you for already opening a PR regarding the functionality! 😝

Well I guess for the order you could take the order of values of the the versioning configuration? Then you would also handle user created types and still have the opt-behaviour through the headline configuration. Breaking changes could be at the top/bottom of each version notes. Grouping would then be another topic to handle. For this I think your second suggestion from above is the way to go.

In general, the second suggestion from above would be the superior one.

Anyways thank you again for directly addressing the feedback :)

from sv4git.

bvieira avatar bvieira commented on June 15, 2024 1

This feature is available in version 2.4.0!:rocket:

from sv4git.

hypervtechnics avatar hypervtechnics commented on June 15, 2024

Also running sv4git cl shows that the correct type is recognized:

user@supermachine01:~/projects/sv4git-test$ git sv cl -r hash -s 69c44c0
{"date":"2021-07-26","hash":"f0d9d6c","message":{"type":"chore","description":"Refine sv4git configuration"}}
{"date":"2021-07-26","hash":"1d3b726","message":{"type":"build","description":"add drone ci"}}
{"date":"2021-07-26","hash":"7b7dd31","message":{"type":"fix","description":"Fix heading"}}
{"date":"2021-07-26","hash":"a238066","message":{"type":"feat","description":"Add another line"}}
{"date":"2021-07-26","hash":"2068851","message":{"description":"Add build to headers"}}
{"date":"2021-07-04","hash":"247c5fa","message":{"type":"feat","description":"hm","isBreakingChange":true}}
{"date":"2021-07-04","hash":"480ab83","message":{"type":"feat","scope":"headline","description":"Introduced new headline"}}
{"date":"2021-07-04","hash":"885d53f","message":{"type":"build","description":"Add sv4git"}}
{"date":"2021-07-04","hash":"7c320f0","message":{"type":"docs","scope":"readme","description":"Fix linter error with title"}}

69... is the hash of the first commit

from sv4git.

hypervtechnics avatar hypervtechnics commented on June 15, 2024

Thanks for your response :)

Okay then I misunderstood something. But just to be clear: I don't want to reorder or change existing sections. I want to add an additional one targeting another commit type.

If the above case is also would you mean, I think the second option would be the way to go, as it is easier to understand and also easier to handle when upgrading versions (I guess?). Although I'd suggest consolidating template and commit-types into something like content, because in the end all sections are bullet lists, right?

from sv4git.

bvieira avatar bvieira commented on June 15, 2024

Well I guess for the order you could take the order of values of the the versioning configuration?

That's true, but could break retrocompatibility (current order in types is diferent from release note order).. but I think the second suggestion will be better in a long run..

from sv4git.

hypervtechnics avatar hypervtechnics commented on June 15, 2024

Thank you!

from sv4git.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.