![]() |
Release Notes Manager
|
This file contains the main functions related to generating release notes from commit messages or pull requests. More...
#include <iostream>
#include <fstream>
#include <string>
#include <cstring>
#include <regex>
#include <curl/curl.h>
#include <json.hpp>
#include "Config.h"
#include "Enums.h"
#include "Utils.h"
#include "Format.h"
Functions | |
void | addPullRequestInfoInNotes (json pullRequestInfo, string &pullRequestsReleaseNotes, ReleaseNoteModes releaseNotesMode, int commitTypeIndex) |
Formats given pull request information (title, body) into a nice looking markdown format, then adds them in the given current release notes, based on the release notes mode. | |
string | getPullRequestInfo (string pullRequestUrl, string githubToken) |
Retrieves pull request info from the GitHub API using libcurl. | |
string | getCommitsNotesFromPullRequests (int commitTypeIndex, string releaseStartRef, string releaseEndRef, string githubToken, ReleaseNoteModes releaseNotesMode) |
Retrieves release notes from each commit's pull request between the start reference and the end reference based on the given conventional commit type, release notes mode, and using the given GitHub token. | |
string | getCommitsNotesFromCommitMessages (int commitTypeIndex, string releaseStartRef, string releaseEndRef) |
Retrieves release notes from each commit's message between the start reference and the end reference based on the given conventional commit type. | |
void | generateReleaseNotes (ReleaseNoteSources releaseNoteSource, string releaseStartRef, string releaseEndRef, string githubToken, ReleaseNoteModes releaseNoteMode) |
Generates release notes using commit messages between the start reference and the end reference using the given release notes source and if the source is pull requests then generates them based on the release note mode and using the given GitHub token. | |
void | generatePullRequestChangeNote (string pullRequestNumber, string githubToken) |
Generates a single change note with it's conventional commit type category for a single pull request using the GitHub API (Not using commit messages at all) | |
int | main (int argc, char *argv[]) |
Variables | |
Config | config |
This file contains the main functions related to generating release notes from commit messages or pull requests.
void addPullRequestInfoInNotes | ( | json | pullRequestInfo, |
string & | pullRequestsReleaseNotes, | ||
ReleaseNoteModes | releaseNotesMode, | ||
int | commitTypeIndex ) |
Formats given pull request information (title, body) into a nice looking markdown format, then adds them in the given current release notes, based on the release notes mode.
pullRequestInfo | JSON object containing raw pull request information |
pullRequestsReleaseNotes | Existing release notes generated from pull requests |
releaseNotesMode | The release notes mode that will decide if the pull request body will be included or not |
commitTypeIndex | Index of the commit type in the commit types 2d array that this pull request belongs to |
void generatePullRequestChangeNote | ( | string | pullRequestNumber, |
string | githubToken ) |
Generates a single change note with it's conventional commit type category for a single pull request using the GitHub API (Not using commit messages at all)
pullRequestNumber | The number of the pull request to generate change note for (e.g., 13, 144, 3722, etc.) |
githubToken | The GitHub token used to make authenticated requests to the GitHub API |
void generateReleaseNotes | ( | ReleaseNoteSources | releaseNoteSource, |
string | releaseStartRef, | ||
string | releaseEndRef, | ||
string | githubToken, | ||
ReleaseNoteModes | releaseNoteMode ) |
Generates release notes using commit messages between the start reference and the end reference using the given release notes source and if the source is pull requests then generates them based on the release note mode and using the given GitHub token.
releaseNoteSource | The source to generate release notes from (commit messages or pull requests) |
releaseStartRef | The git reference (commit SHA or tag name) that references the commit directly before the commit that starts the commit messages of the release, for example, the tag name of the previous release |
releaseEndRef | The git reference (commit SHA or tag name) that references the end of the commit messages of the release |
releaseNoteMode | The release notes mode when the source is pull requests |
githubToken | The GitHub token used to make authenticated requests to the GitHub API when source is pull requests |
string getCommitsNotesFromCommitMessages | ( | int | commitTypeIndex, |
string | releaseStartRef, | ||
string | releaseEndRef ) |
Retrieves release notes from each commit's message between the start reference and the end reference based on the given conventional commit type.
commitTypeIndex | Index of the commit type in the commit types 2d array, to only generate release notes from the given commit type (fix, feat, etc.) |
releaseStartRef | The git reference (commit SHA or tag name) that references the commit directly before the commit that starts the commit messages of the release, for example, the tag name of the previous release |
releaseEndRef | The git reference (commit SHA or tag name) that references the end of the commit messages of the release |
string getCommitsNotesFromPullRequests | ( | int | commitTypeIndex, |
string | releaseStartRef, | ||
string | releaseEndRef, | ||
string | githubToken, | ||
ReleaseNoteModes | releaseNotesMode ) |
Retrieves release notes from each commit's pull request between the start reference and the end reference based on the given conventional commit type, release notes mode, and using the given GitHub token.
commitTypeIndex | Index of the commit type in the commit types 2d array, to only generate release notes from the given commit type (fix, feat, etc.) |
releaseStartRef | The git reference (commit SHA or tag name) that references the commit directly before the commit that starts the commit messages of the release, for example, the tag name of the previous release |
releaseEndRef | The git reference (commit SHA or tag name) that references the end of the commit messages of the release |
releaseNotesMode | The release notes mode |
githubToken | The GitHub token used to make authenticated requests to the GitHub API |
string getPullRequestInfo | ( | string | pullRequestUrl, |
string | githubToken ) |
Retrieves pull request info from the GitHub API using libcurl.
pullRequestUrl | The GitHub API URL of the pull request |
githubToken | The GitHub token used to make authenticated requests to the GitHub API |
int main | ( | int | argc, |
char * | argv[] ) |
Config config |