Skip to content

Release blog post improvements; @author parsing and notable header #576

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"dependencies": {
"autoprefixer-stylus": "0.8.1",
"changelog-url": "1.0.0",
"changelog-url": "1.0.2",
"cheerio": "0.19.0",
"chokidar": "1.2.0",
"handlebars": "4.0.4",
Expand Down
14 changes: 11 additions & 3 deletions scripts/release-post.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,17 @@ function fetchChangelog (version) {
}

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

return fetchChangelog(version)
.then(function (section) {
const bodyMatch = rxSectionBody.exec(section)
// ensure ### prefixed "Notable changes" header
// https://github.com/nodejs/nodejs.org/pull/551#issue-138257829
const body = bodyMatch ? '### ' + bodyMatch[2] : ''

return bodyMatch
? bodyMatch[0]
? body
: Promise.reject(new Error(`Could not find changelog body of ${version} release`))
})
}
Expand Down Expand Up @@ -157,7 +161,11 @@ function verifyDownloads (version) {
}

function findAuthorLogin (version, section) {
const rxReleaseAuthor = /^(## )?.*? \([^\)]+\), @(\S+)/g
// looking for the @author part of the release header, eg:
// ## 2016-03-08, Version 5.8.0 (Stable). @Fishrock123
// ## 2015-10-13, Version 4.2.1 'Argon' (LTS), @jasnell
// ## 2015-09-08, Version 4.0.0 (Stable), @rvagg
const rxReleaseAuthor = /^(## )?.*? \([^\)]+\)[,.] @(\S+)/g
const matches = rxReleaseAuthor.exec(section)
return matches ? matches[2] : Promise.reject(new Error(`Couldn't find @author of ${version} release :(`))
}
Expand Down
24 changes: 24 additions & 0 deletions tests/scripts/CHANGELOG.fixture.legacy.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
2016-03-04, Version 0.10.43 (Maintenance), @rvagg

Notable changes:

* 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
* domains:
- 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
- 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
* openssl: Upgrade from 1.0.1r to 1.0.1s (Ben Noordhuis) https://github.com/nodejs/node/pull/5508
- 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
- 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
- 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
- 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

Commits:

* [164157abbb] - build: update Node.js logo on OSX installer (Rod Vagg) https://github.com/nodejs/node/pull/5401
* [f8cb0dcf67] - crypto,tls: remove SSLv2 support (Ben Noordhuis) https://github.com/nodejs/node/pull/5529
* [42ded2a590] - deps: upgrade openssl to 1.0.1s (Ben Noordhuis) https://github.com/nodejs/node/pull/5508
* [1e45a6111c] - deps: update http-parser to version 1.2 (James M Snell) https://github.com/nodejs/node/pull/5242
* [6db377b2f4] - doc: remove SSLv2 descriptions (Shigeki Ohtsu) https://github.com/nodejs/node/pull/5541
* [563c359f5c] - domains: fix handling of uncaught exceptions (Julien Gilli) https://github.com/nodejs/node/pull/3887
* [e483f3fd26] - test: fix hanging http obstext test (Ben Noordhuis) https://github.com/nodejs/node/pull/5511

2015-12-04, Version 0.12.9 (LTS), @rvagg

Security Update
Expand Down
16 changes: 15 additions & 1 deletion tests/scripts/release-post.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ test('fetchChangelog(<version>)', (t) => {

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

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

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

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

t.test('ensures notable changes header are prefix with `###`', (t) => {
const github = nock('https://raw.githubusercontent.com')
.get('/nodejs/node/v0.10.43/ChangeLog')
.replyWithFile(200, changelogLegacyFixture)

releasePost.fetchChangelogBody('0.10.43').then((body) => {
t.true(body.startsWith('### Notable changes'))
t.true(github.isDone(), 'githubusercontent.com was requested')

t.end()
}, t.fail)
})

t.end()
})

Expand Down