Rollout event to show shortlog from previous
complete
Ran Magen
William Morgan out of curiosity, did you find that you need to appropriately escape the annotation value? If so, maybe you can save me some iteration time :)
William Morgan
Ran Magen: We're just doing
CHANGELOG=$(git log ...)
followed by kubectl annotate --overwrite dive.co/rollout-description="$CHANGELOG"
...Ran Magen
William Morgan: hmm gotcha.
yeah our set up is a bit specific I guess, we've been wanting to change it for a while though. our k8s manifest files are templates that our gradle build applies variables to, the annotation value is such a value, and because of how the template works, we've had a bug where if a commit message contains quotes, it closes the quotes of the annotation value, which causes an invalid manifest. ¯\_(ツ)_/¯
William Morgan
Ran Magen: Just keep adding backslashes until it works. More seriously, if there's something that Dive can do to make this easier, we're all ears!
Ran Magen
William Morgan Just tested this out, found some bugs, sending a bug report.
William Morgan
Ran Magen: You're the best 🙏
Ran Magen
Nice! Is this in prod?
William Morgan
complete
We've added a
dive.co/rollout-description
annotation, similar to the other annotations, that takes Markdown and displays as part of the event detail page.FYI internally (we run Dive with Dive) we populate this field with a variant of this git command:
git log --pretty=format:"* %s ([%aE, %ar] (https://url/to/commit/%H))" <oldsha>..<newsha>
Ran Magen
William Morgan: Fwiw we already had a script to generate the log we'd want to attach, because we send it to slack. It's a little more complex than your suggestion already, since it can find commits removed AND added by doing something along the lines of merging 2 logs
from..to
and to..from
William Morgan
Ran Magen: That sounds really useful. You should publish it somewhere so that we can use it too 😀
Ran Magen
William Morgan: I didn't really clean it up, pasted as is: https://gist.github.com/Enrico2/80b5f381354c8fe78677e67bb170d102
William Morgan
Ran Magen: Thank you!
William Morgan
in progress
William Morgan
planned
We're going to add an annotation that allows you to set a "description" of a rollout, in markdown. This can be used to generate a shortlog or anything else that you want to record as part of that rollout event.
William Morgan
under review
William Morgan
Totally. We've been tossing around variants of this idea. I want this functionality but I'm reluctant to tie it too tightly to a specific git feature, which may not work for everyone.
As a possible alternative, what would you think about another deployment annotation for an event "description" field that
you
populate with the shortlog (or anything else you want to put in there)?Ran Magen
William Morgan: actually yeah that's maybe better! if we go that route though, let's make sure some formatting is possible (newlines at the very least, but if we can get semi markdown a-la slack, that'd be awesome)
William Morgan
Ran Magen: Markdown should be doable. Stay tuned.