Skip to content

Add optional Changelog root element to Bjoern specs#101

Merged
Mehtrick merged 4 commits into
masterfrom
copilot/add-changelog-root-element
Mar 8, 2026
Merged

Add optional Changelog root element to Bjoern specs#101
Mehtrick merged 4 commits into
masterfrom
copilot/add-changelog-root-element

Conversation

Copilot AI commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Adds a new optional Changelog free-text field to the .zgr spec format for documenting changes, background, and technical rationale. When present, it is surfaced in both generated Javadoc and AsciiDoc output. The field supports YAML multiline block scalars (| and >) for arbitrarily long content.

Spec format

Single-line:

Feature: My Feature
Changelog: "Describes what changed and why."
Scenarios:
  - Scenario: ...

Multiline (YAML literal block scalar):

Feature: My Feature
Changelog: |
  First line of the changelog.
  Second line with more details.
Scenarios:
  - Scenario: ...

Changes

  • Parser model (BjoernZGRModell, Bjoern) — new Changelog field with full @JsonProperty wiring and constructor mapping
  • Javadoc generation (BjoernFeatureTestClassBuilder) — appends @Changelog <text> to the abstract class Javadoc when present
  • AsciiDoc template (asciidoc.ftlh) — renders Changelog: <text> after the Reference line, guarded by a null/empty check; uses changelogAsAsciidoc for sanitized output
  • Sanitization (Bjoern) — getChangelogAsAsciidoc() applies AsciidocReplacer.replace() to escape AsciiDoc-special characters (e.g. pipe |\|)
  • Validator (BjoernKeywords, InvalidKeywordValidation) — added Changelog: as a recognized keyword; continuation lines inside a Changelog: | or Changelog: > block scalar are exempt from keyword validation
  • README — documents the new field and its rendering behavior in Java and docs
Original prompt

This section details on the original issue you should resolve

<issue_title>Neues Root Element "changelog"</issue_title>
<issue_description># Anforderung

Neues Root‑Element "changelog" hinzufügen.
Dieses Feld dient der Ablage eines beliebig langen Freitextes, der Änderungen, Hintergründe oder technische Beweggründe zur Spezifikation beschreibt.
Der Inhalt soll später automatisiert in Docs und Javadoc mit generiert werden.


Umsetzung

  • In der Bjoern‑Spezifikation ein neues Feld changelog hinzufügen

    • Typ: Textfeld / textarea
    • Inhalt: beliebig lang
    • Keine semantische Prüfung notwendig
    • Feld ist optional
  • Im Code:

    • Den Inhalt des Changelogs in der Javadoc der zugehörigen Spezifikations‑Klasse hinterlegen
      • Annotation/Tag: @Changelog oder internes Äquivalent
  • In den Docs:

    • Den Changelog‑Text am Ende der Einleitung nach dem Featurenamen einfügen
    • Generierung erfolgt nur, wenn auch tatsächlich ein changelog im Root vorhanden ist</issue_description>

<agent_instructions>also change the README!!!</agent_instructions>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: Mehtrick <4493019+Mehtrick@users.noreply.github.com>
@Mehtrick Mehtrick marked this pull request as ready for review March 4, 2026 21:05
Copilot AI review requested due to automatic review settings March 4, 2026 21:05
Copilot AI changed the title [WIP] Add new root element 'changelog' to specification Add optional Changelog root element to Bjoern specs Mar 4, 2026

@Mehtrick Mehtrick left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

stelle sicher dass das Changelog sanitized ist

Comment thread src/test/resources/changelog.zgr Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds an optional root-level Changelog field to the .zgr specification format and wires it through parsing, validation keywords, Java test-class Javadoc generation, and AsciiDoc documentation output.

Changes:

  • Extend YAML + internal models to carry Changelog and propagate it into generators.
  • Render changelog in generated artifacts (AsciiDoc template + @Changelog Javadoc tag).
  • Add/adjust tests and docs for the new keyword/field.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/main/java/de/mehtrick/bjoern/parser/modell/BjoernZGRModell.java Adds @JsonProperty("Changelog") field + accessors to YAML model.
src/main/java/de/mehtrick/bjoern/parser/modell/Bjoern.java Adds internal changelog field and constructor mapping from YAML model.
src/main/java/de/mehtrick/bjoern/generator/builder/BjoernFeatureTestClassBuilder.java Emits @Changelog in generated feature class Javadoc.
src/main/resources/asciidoc.ftlh Outputs Changelog: block in generated AsciiDoc when present.
src/main/java/de/mehtrick/bjoern/parser/validator/validations/BjoernKeywords.java Registers Changelog: as a valid keyword for validator keyword checks.
src/test/resources/changelog.zgr New test spec file including Changelog:.
src/test/java/de/mehtrick/bjoern/asciidoc/AsciiDocBuildTest.java Adds AsciiDoc generation tests for presence/absence of changelog output.
src/test/java/de/mehtrick/bjoern/generator/builder/BjoernFeatureTestClassBuilderTest.java Adds Javadoc generation test for @Changelog.
src/test/java/de/mehtrick/bjoern/parser/BjoernValidatorTest.java Updates expected allowed-keyword list to include Changelog:.
README.md Documents the new optional Changelog field and its outputs.

Comment thread src/test/resources/changelog.zgr Outdated
Comment thread src/test/java/de/mehtrick/bjoern/parser/BjoernValidatorTest.java
Co-authored-by: Mehtrick <4493019+Mehtrick@users.noreply.github.com>

Copilot AI commented Mar 4, 2026

Copy link
Copy Markdown
Contributor Author

stelle sicher dass das Changelog sanitized ist

Added getChangelogAsAsciidoc() to Bjoern.java which applies AsciidocReplacer.replace() (escapes pipe characters). The AsciiDoc template now uses changelogAsAsciidoc instead of the raw value. Done in c3646ab.

@Mehtrick Mehtrick merged commit 29c5436 into master Mar 8, 2026
5 checks passed
@Mehtrick Mehtrick deleted the copilot/add-changelog-root-element branch March 8, 2026 19:48
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.

Neues Root Element "changelog"

3 participants