Skip to content

Commit cd34bab

Browse files
committed
Release blog post improvements; @author parsing and notable header.
- handle @author parsing when using . instead of , in the release version header - ensure ### prefixed Notable changes header - bumped changelog-url version too handle new v0.10.x releases Refs: #551 (comment) Fixes: #553 (comment)
1 parent 93e9302 commit cd34bab

File tree

4 files changed

+51
-5
lines changed

4 files changed

+51
-5
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
},
2929
"dependencies": {
3030
"autoprefixer-stylus": "0.8.1",
31-
"changelog-url": "1.0.0",
31+
"changelog-url": "1.0.2",
3232
"cheerio": "0.19.0",
3333
"chokidar": "1.2.0",
3434
"handlebars": "4.0.4",

scripts/release-post.js

+11-3
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,17 @@ function fetchChangelog (version) {
119119
}
120120

121121
function fetchChangelogBody (version) {
122-
const rxSectionBody = /(### )?Notable [\s\S]*/g
122+
const rxSectionBody = /(### )?(Notable [\s\S]*)/g
123123

124124
return fetchChangelog(version)
125125
.then(function (section) {
126126
const bodyMatch = rxSectionBody.exec(section)
127+
// ensure ### prefixed "Notable changes" header
128+
// https://github.com/nodejs/nodejs.org/pull/551#issue-138257829
129+
const body = bodyMatch ? '### ' + bodyMatch[2] : ''
130+
127131
return bodyMatch
128-
? bodyMatch[0]
132+
? body
129133
: Promise.reject(new Error(`Could not find changelog body of ${version} release`))
130134
})
131135
}
@@ -157,7 +161,11 @@ function verifyDownloads (version) {
157161
}
158162

159163
function findAuthorLogin (version, section) {
160-
const rxReleaseAuthor = /^(## )?.*? \([^\)]+\), @(\S+)/g
164+
// looking for the @author part of the release header, eg:
165+
// ## 2016-03-08, Version 5.8.0 (Stable). @Fishrock123
166+
// ## 2015-10-13, Version 4.2.1 'Argon' (LTS), @jasnell
167+
// ## 2015-09-08, Version 4.0.0 (Stable), @rvagg
168+
const rxReleaseAuthor = /^(## )?.*? \([^\)]+\)[,.] @(\S+)/g
161169
const matches = rxReleaseAuthor.exec(section)
162170
return matches ? matches[2] : Promise.reject(new Error(`Couldn't find @author of ${version} release :(`))
163171
}

tests/scripts/CHANGELOG.fixture.legacy.md

+24
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
2016-03-04, Version 0.10.43 (Maintenance), @rvagg
2+
3+
Notable changes:
4+
5+
* http_parser: Update to http-parser 1.2 to fix an unintentionally strict limitation of allowable header characters. (James M Snell) https://github.com/nodejs/node/pull/5242
6+
* domains:
7+
- Prevent an exit due to an exception being thrown rather than emitting an `'uncaughtException'` event on the `process` object when no error handler is set on the domain within which an error is thrown and an `'uncaughtException'` event listener is set on `process`. (Julien Gilli) https://github.com/nodejs/node/pull/3887
8+
- Fix an issue where the process would not abort in the proper function call if an error is thrown within a domain with no error handler and `--abort-on-uncaught-exception` is used. (Julien Gilli) https://github.com/nodejs/node/pull/3887
9+
* openssl: Upgrade from 1.0.1r to 1.0.1s (Ben Noordhuis) https://github.com/nodejs/node/pull/5508
10+
- Fix a double-free defect in parsing malformed DSA keys that may potentially be used for DoS or memory corruption attacks. It is likely to be very difficult to use this defect for a practical attack and is therefore considered low severity for Node.js users. More info is available at https://www.openssl.org/news/vulnerabilities.html#2016-0705
11+
- Fix a defect that can cause memory corruption in certain very rare cases relating to the internal `BN_hex2bn()` and `BN_dec2bn()` functions. It is believed that Node.js is not invoking the code paths that use these functions so practical attacks via Node.js using this defect are _unlikely_ to be possible. More info is available at https://www.openssl.org/news/vulnerabilities.html#2016-0797
12+
- Fix a defect that makes the CacheBleed Attack (https://ssrg.nicta.com.au/projects/TS/cachebleed/) possible. This defect enables attackers to execute side-channel attacks leading to the potential recovery of entire RSA private keys. It only affects the Intel Sandy Bridge (and possibly older) microarchitecture when using hyper-threading. Newer microarchitectures, including Haswell, are unaffected. More info is available at https://www.openssl.org/news/vulnerabilities.html#2016-0702
13+
- Remove SSLv2 support, the `--enable-ssl2` command line argument will now produce an error. The DROWN Attack (https://drownattack.com/) creates a vulnerability where SSLv2 is enabled by a server, even if a client connection is not using SSLv2. The SSLv2 protocol is widely considered unacceptably broken and should not be supported. More information is available at https://www.openssl.org/news/vulnerabilities.html#2016-0800
14+
15+
Commits:
16+
17+
* [164157abbb] - build: update Node.js logo on OSX installer (Rod Vagg) https://github.com/nodejs/node/pull/5401
18+
* [f8cb0dcf67] - crypto,tls: remove SSLv2 support (Ben Noordhuis) https://github.com/nodejs/node/pull/5529
19+
* [42ded2a590] - deps: upgrade openssl to 1.0.1s (Ben Noordhuis) https://github.com/nodejs/node/pull/5508
20+
* [1e45a6111c] - deps: update http-parser to version 1.2 (James M Snell) https://github.com/nodejs/node/pull/5242
21+
* [6db377b2f4] - doc: remove SSLv2 descriptions (Shigeki Ohtsu) https://github.com/nodejs/node/pull/5541
22+
* [563c359f5c] - domains: fix handling of uncaught exceptions (Julien Gilli) https://github.com/nodejs/node/pull/3887
23+
* [e483f3fd26] - test: fix hanging http obstext test (Ben Noordhuis) https://github.com/nodejs/node/pull/5511
24+
125
2015-12-04, Version 0.12.9 (LTS), @rvagg
226

327
Security Update

tests/scripts/release-post.test.js

+15-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ test('fetchChangelog(<version>)', (t) => {
139139

140140
t.test('rejects when a matching version section could not be found in changelog', (t) => {
141141
const github = nock('https://raw.githubusercontent.com')
142-
.get('/nodejs/node/v0.9999999.0/ChangeLog')
142+
.get('/nodejs/node-v0.x-archive/v0.9999999.0/ChangeLog')
143143
.reply(200, 'A changelog without version sections...')
144144

145145
releasePost.fetchChangelog('0.9999999.0').then(t.fail, (err) => {
@@ -157,6 +157,7 @@ test('fetchChangelogBody(<version>)', (t) => {
157157
const releasePost = require('../../scripts/release-post')
158158

159159
const changelogFixture = path.resolve(__dirname, 'CHANGELOG.fixture.md')
160+
const changelogLegacyFixture = path.resolve(__dirname, 'CHANGELOG.fixture.legacy.md')
160161

161162
t.test('does not include `## header` in matched version section', (t) => {
162163
const github = nock('https://raw.githubusercontent.com')
@@ -171,6 +172,19 @@ test('fetchChangelogBody(<version>)', (t) => {
171172
}, t.fail)
172173
})
173174

175+
t.test('ensures notable changes header are prefix with `###`', (t) => {
176+
const github = nock('https://raw.githubusercontent.com')
177+
.get('/nodejs/node/v0.10.43/ChangeLog')
178+
.replyWithFile(200, changelogLegacyFixture)
179+
180+
releasePost.fetchChangelogBody('0.10.43').then((body) => {
181+
t.true(body.startsWith('### Notable changes'))
182+
t.true(github.isDone(), 'githubusercontent.com was requested')
183+
184+
t.end()
185+
}, t.fail)
186+
})
187+
174188
t.end()
175189
})
176190

0 commit comments

Comments
 (0)