op Release Notes is a simple release notes tool that pulls directly from your GitLab repository gleening closed issues based on your defined milestones.
op Release Notes utilizes GitLab API to pull all open issues that have a milestone assigned in your GitLab project. It will use the milestone as the versioning number and group closed issues to those milestones. It will create a "release-notes.json" file.
You may use the JSON file however you deem, just know there is also a web based tool available to you that will draw the release notes.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
To use op Release Notes, you will need to have a couple of things:
- GitLab Url
- GitLab Project Id
- Personal Access Token
Install op-release-notes NPM package
npm install op-release-notes
Edit your projects package.json file to add config variables
"config": {
"gitlabUrl": "https://gitlab.sandia.gov",
"gitlabProjectId": "<git project id>",
"gitlabAccessToken": "<personal access token>",
"iconPath": "images/icon_sm.png"
},
The JSON file will be created upon request. This can be setup to run real-time in your code, upon bootup of the application or as part of your CI/CD process. It is up to you to determine the correct injection point into your process.
If you would like real-time generation... Insert the following in your application at the point in the flow where you would like GitLab queried and the "release-notes.json" file populated.
const opRelNotes = require("op-release-notes"); opRelNotes.QueryForData();
If you would like CI/CD generation... place this anywhere in your CI/CD process.
Note: The data will be gathered from GitLab at the time it processes, so any unclosed issues will not be captured. Please make sure you take this into concideration prior to injecting this step in your process. {: .note}
Here is an example of it running after a commit and unit test.
//just kidding... I havent proven this out yet to give a sample... still working on it check back === later
Feel free to take the "release-notes.json" file and process it however you see fit in your application. We have provided a Javascript function to display the Release Notes in a given element id.
For an example of how to use this, try the following:
<div id="release-notes-container"></div> <script> const opRelNotes = require("op-release-notes"); // Enter your HTML element ID to create the release notes. opRelNotes.Draw("release-notes-container"); </script>
- Philip Eckenroth - Initial work