Class Changelog

java.lang.Object
io.github.jbastgen.stemma.app.ai.Changelog

public final class Changelog extends Object
A changelog in the Keep a Changelog style (feature 5): reading the proposal of the AI, merging it into CHANGELOG.md under Unreleased without touching existing entries, and showing what the merge adds.
  • Field Details

  • Method Details

    • buildPrompt

      public static String buildPrompt(String template, String repo, List<String> commitLines)
      The prompt: {repo}, {commits} (one line each, with labels) and {sections}.
    • parse

      public static Map<String,List<String>> parse(String text)
      Reads ### Section headings with - bullets (a bullet may continue on indented lines). Text outside a section is ignored; sections without bullets are dropped; the same bullet twice is kept once.
    • render

      public static String render(String title, Map<String,List<String>> entries)
      The entries as the text of a release: with ## title on top when there is a title, else only the sections.
    • merge

      public static String merge(String existing, Map<String,List<String>> entries)
      Puts the entries under ## [Unreleased] of the changelog: into the section of that name when there is one (after its last bullet, skipping bullets that are already there), else as a new section. Everything else stays byte for byte; without an Unreleased heading one is added before the first release.
    • diffText

      public static String diffText(String before, String after)
      The diff as text: changed lines with +, and two lines of context around them; blank text when nothing changes.