ReleaseHx API

While most users will interact with ReleaseHx via the rhx command-line tool, the gem can also be used as a library in your own Ruby projects. The full API reference will be available via RDoc comments in the source code.

Here is a high-level overview of the main components to get you started:

Core Data Models (ReleaseHx::RHYML)

The classes within the ReleaseHx::RHYML module are the core data objects for the application.

ReleaseHx::RHYML::Release

Represents a single product release, containing metadata (like version code and date) and a collection of Change objects.

ReleaseHx::RHYML::Change

Represents a single change within a release (ex: a bug fix or a new feature), containing properties like a summary, note, type, and tags.

You will typically create or receive a Release object to work with.

Creating a Release (ReleaseHx::DraftOps)

The ReleaseHx::DraftOps module provides methods for creating a Release object from a source.

  • Use DraftOps.from_payload to take a raw JSON payload from an API (like GitHub or Jira) and convert it into a Release object, according to a mapping configuration.

Generating Output (ReleaseHx::EnrichOps and DraftOps)

Once you have a Release object, you can generate output files.

  • Use DraftOps.process_template_content to generate a lightweight draft (like Markdown, AsciiDoc, or RHYML) from a Release object.

  • Use EnrichOps.enrich_from_rhyml to generate rich-text output (like HTML or PDF) from a Release object.

  • Use EnrichOps.enrich_from_file to generate rich-text output directly from a source file (ex: converting my-release.md to my-release.html). === Issue-data Mapping

In designing a domain-specific data model, I had to mimic the logic of the domain, which is dominated by Jira and GitHub, for better or worse. Here is the way fields are mapped/adapated by default for converting issue data to change data.

Table 1. Upstream/source issue data mapping table
Jira GitHub GitLab RHYML Ruby/Liquid

N/A

N/A

N/A

chid

chid

key

number

iid

tick

tick

commit (custom field, if available)

associated commit hash (via PR merge or commit references)

commit hash from merge request or commit ref

hash

hash

issuetype or label matching slug in types

type or label matching slug in types

issue_type or label matching slug in types

type

type

component

label: component:<component>

label: component::<component> or scoped labels

part

part

summary

title

title

summ

summ

N/A

N/A

N/A

head

head

custom field

## Release Note in body

## Release Note in body

note

note

label: deprecation

label: deprecation

label: deprecation

tags: [deprecation]

tags['deprecation'] / deprecation Boolean / .deprecation?

label: breaking

label: breaking

label: breaking

tags: [breaking]

tags['breaking'] / breaking Boolean / .breaking?

label: experimental

label: experimental

label: experimental

tags: [experimental]

tags['experimental'] / experimental Boolean / .experimental?

label: highlight

label: highlight

label: highlight

tags: [highlight]

tags['highlight'] / highlight Boolean / .highlight?

label: release_note_needed

label: release_note_needed

label: release_note_needed

N/A

N/A

label: changelog

label: changelog

label: changelog

N/A

N/A

fixVersions

milestone

milestone

nested context

version

assignee

assignee

assignee

lead

lead

Users are not beholden to these mappings. A powerful custom mapping system is available.