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
Changeobjects. 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_payloadto take a raw JSON payload from an API (like GitHub or Jira) and convert it into aReleaseobject, 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_contentto generate a lightweight draft (like Markdown, AsciiDoc, or RHYML) from aReleaseobject. -
Use
EnrichOps.enrich_from_rhymlto generate rich-text output (like HTML or PDF) from aReleaseobject. -
Use
EnrichOps.enrich_from_fileto generate rich-text output directly from a source file (ex: convertingmy-release.mdtomy-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.
| Jira | GitHub | GitLab | RHYML | Ruby/Liquid |
|---|---|---|---|---|
N/A |
N/A |
N/A |
|
|
|
|
|
|
|
|
associated commit hash (via PR merge or commit references) |
commit hash from merge request or commit ref |
|
|
|
|
|
|
|
|
label: |
label: |
|
|
|
|
|
|
|
N/A |
N/A |
N/A |
|
|
custom field |
|
|
|
|
label: |
label: |
label: |
|
|
label: |
label: |
label: |
|
|
label: |
label: |
label: |
|
|
label: |
label: |
label: |
|
|
label: |
label: |
label: |
N/A |
N/A |
label: |
label: |
label: |
N/A |
N/A |
|
|
|
nested context |
|
|
|
|
|
|
Users are not beholden to these mappings. A powerful custom mapping system is available.