MCPcopy Create free account
hub / github.com/NativeScript/android / createReleaseNotes

Function createReleaseNotes

build-artifacts/scripts/release-notes.js:108–176  ·  view source on GitHub ↗
(milestone)

Source from the content-addressed store, hash-verified

106}
107
108function createReleaseNotes(milestone) {
109
110 console.log("Request closed issues in the milestone.");
111 issuesRequest.headers.Authorization = "Basic " + Buffer.from(username + ":" + password).toString("base64");
112 issuesRequest.path = '/repos/NativeScript/android-runtime/issues?milestone=' + milestone.number + '&state=closed';
113
114 var req = https.request(issuesRequest, gitHubResponse(function (data) {
115
116 if (!(data instanceof Array)) {
117 console.log("Error. Expected to get array with the milestones!\n");
118 process.exit(1);
119 } else {
120 var issues = data;
121
122 console.log("Received " + issues.length + " entries.");
123
124 var bugs = issues.filter(function (i) {
125 return i.labels.filter(function (l) {
126 return l.name == "bug";
127 }).length > 0;
128 });
129 var features = issues.filter(function (i) {
130 return i.labels.filter(function (l) {
131 return l.name == "feature";
132 }).length > 0;
133 });
134
135 var performance = issues.filter(function (i) {
136 return i.labels.filter(function (l) {
137 return l.name == "T:Performance";
138 }).length > 0;
139 });
140
141 console.log(" - " + bugs.length + " fixed (e.g. T:Bug)");
142 console.log(" - " + features.length + " new (e.g. T:Feature");
143 console.log(" - " + performance.length + " performance (e.g. T:Performance");
144
145 var md = "";
146
147 md += milestone.title + "\r\n==\r\n\r\n";
148
149 printSection("What's New", features);
150 printSection("Bug Fixes", bugs);
151 printSection("Performance", performance);
152
153 function printSection(title, issues) {
154 if (issues.length > 0) {
155 md += "## " + title + "\r\n\r\n";
156 issues.forEach(printIssue);
157 md += "\r\n";
158 }
159 }
160
161 function printIssue(i) {
162 md += " - [" + i.title + " (#" + i.number + ")](" + i.html_url + ")\r\n";
163 }
164
165 var currentLog = fs.readFileSync("../../CHANGELOG.md");

Callers 1

selectMilestoneFunction · 0.85

Calls 5

gitHubResponseFunction · 0.85
printSectionFunction · 0.85
logMethod · 0.65
toStringMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected