f3ath / cider

Tools for Dart package maintainers
https://pub.dev/packages/cider
MIT License
101 stars 17 forks source link

Using Cider in a team that has multiple developers #78

Open Schamppu opened 1 month ago

Schamppu commented 1 month ago

Hello! I'm using Cider, and we got two devs on the team.

I would love if Cider would allow us to either:

Currently, we both work on different branches, but when we merge the branches having unreleased changes always creates a merge conflict we need to deal with. Having these features would make each change its own file before making a release, and we could set these changes to a subfolder so it doesn't look as messy.

Schamppu commented 1 week ago

Hey @f3ath anything new on this regard?

f3ath commented 1 week ago

I understand the conflict happens in the "Unreleased" section when a feature branch get merged into "main". I also assume that you have some sort of automation in place which runs "cider release" from the main branch after the feature branches are merged.

In this case the most straightforward approach I can imagine is to delegate the compilation of the release section to a simple bash script. You can designate a special folder for the devs to add feature-specific release notes as separate files which then will be iterated and added into the changelog with something as simple as

#!/usr/bin/env bash
categories=( "added" "changed" "deprecated" "removed" "fixed" "security" )
for category in "${categories[@]}" ; do
  for file in $(find "release_notes/$category" -name "*.md" | sort) ; do
    cider log "$category" "$(cat "$file")"
    rm $file
  done
done

The folder will look like this:

-release_notes
 |-added
 | |-feature1.md
 | |-feature2.md
 | `-feature3.md
 |-changed
 | |-feature3.md
 | |-feature1.md
 | `-feature2.md
 ...
 `-fixed
   `-feature1.md
f3ath commented 1 week ago

For more complex scenarios you might want to use change directly to modify the changelog before calling cider release.