From 5bc4ad2cfe6322774f38fb0ea41a0662ef54bca3 Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Wed, 27 Jun 2018 14:44:53 +0200 Subject: [PATCH 01/16] Introduced the "skipLinks" option in the changelog generator (for single package). --- .../generatechangelogforsinglepackage.js | 7 ++- .../lib/release-tools/templates/commit.hbs | 36 +++++++------- .../utils/generatechangelogfromcommits.js | 2 + .../generatechangelogforsinglepackage.js | 31 ++++++++++-- ...eneratechangelogfromcommits-integration.js | 28 ++++++++--- .../utils/generatechangelogfromcommits.js | 48 +++++++++++++++++-- 6 files changed, 121 insertions(+), 31 deletions(-) diff --git a/packages/ckeditor5-dev-env/lib/release-tools/tasks/generatechangelogforsinglepackage.js b/packages/ckeditor5-dev-env/lib/release-tools/tasks/generatechangelogforsinglepackage.js index d8fff6f4e..e4d84199a 100644 --- a/packages/ckeditor5-dev-env/lib/release-tools/tasks/generatechangelogforsinglepackage.js +++ b/packages/ckeditor5-dev-env/lib/release-tools/tasks/generatechangelogforsinglepackage.js @@ -25,9 +25,11 @@ const transformCommitFunction = require( '../utils/transform-commit/transformcom * should be generated. * * @param {String|null} [newVersion=null] A version for which changelog will be generated. + * @param {Object} [options={}] Additional options. + * @param {Boolean} [options.skipLinks=false] If set on true, links to release or commits will be omitted. * @returns {Promise} */ -module.exports = function generateChangelogForSinglePackage( newVersion = null ) { +module.exports = function generateChangelogForSinglePackage( newVersion = null, options = {} ) { const log = logger(); const packageJson = getPackageJson(); @@ -74,7 +76,8 @@ module.exports = function generateChangelogForSinglePackage( newVersion = null ) tagName, isInternalRelease, newTagName: 'v' + version, - transformCommit: transformCommitFunction + transformCommit: transformCommitFunction, + skipLinks: !!options.skipLinks }; return generateChangelogFromCommits( changelogOptions ) diff --git a/packages/ckeditor5-dev-env/lib/release-tools/templates/commit.hbs b/packages/ckeditor5-dev-env/lib/release-tools/templates/commit.hbs index 288a1402b..00df1a71a 100644 --- a/packages/ckeditor5-dev-env/lib/release-tools/templates/commit.hbs +++ b/packages/ckeditor5-dev-env/lib/release-tools/templates/commit.hbs @@ -4,23 +4,25 @@ {{~title}} {{~/if}} -{{~!-- commit link --}} {{#if @root.linkReferences~}} - ([{{hash}}]( - {{~#if @root.repository}} - {{~#if @root.host}} - {{~@root.host}}/ - {{~/if}} - {{~#if @root.owner}} - {{~@root.owner}}/ - {{~/if}} - {{~@root.repository}} - {{~else}} - {{~@root.repoUrl}} - {{~/if}}/ - {{~@root.commit}}/{{hash}})) -{{~else}} - {{~hash}} -{{~/if}} +{{~#if showLinks}} + {{~!-- commit link --}} {{#if @root.linkReferences~}} + ([{{hash}}]( + {{~#if @root.repository}} + {{~#if @root.host}} + {{~@root.host}}/ + {{~/if}} + {{~#if @root.owner}} + {{~@root.owner}}/ + {{~/if}} + {{~@root.repository}} + {{~else}} + {{~@root.repoUrl}} + {{~/if}}/ + {{~@root.commit}}/{{hash}})) + {{~else}} + {{~hash}} + {{~/if}} +{{/if}} {{#if body}} diff --git a/packages/ckeditor5-dev-env/lib/release-tools/utils/generatechangelogfromcommits.js b/packages/ckeditor5-dev-env/lib/release-tools/utils/generatechangelogfromcommits.js index a7c3e29a8..60a5e1734 100644 --- a/packages/ckeditor5-dev-env/lib/release-tools/utils/generatechangelogfromcommits.js +++ b/packages/ckeditor5-dev-env/lib/release-tools/utils/generatechangelogfromcommits.js @@ -26,6 +26,7 @@ const { additionalCommitNotes } = require( './transform-commit/transform-commit- * @param {Boolean} [options.doNotSave=false] If set on `true`, changes will be resolved in returned promise * instead of saving in CHANGELOG file. * @param {Boolean} [options.additionalNotes=false] If set on `true, each category will contain additional description. + * @param {Boolean} [options.skipLinks=false] If set on true, links to release or commits will be omitted. * @returns {Promise} */ module.exports = function generateChangelogFromCommits( options ) { @@ -45,6 +46,7 @@ module.exports = function generateChangelogFromCommits( options ) { displayLogs: false, isInternalRelease: options.isInternalRelease || false, additionalNotes: {}, + showLinks: typeof options.skipLinks == 'undefined' ? true : !options.skipLinks }; if ( options.additionalNotes ) { diff --git a/packages/ckeditor5-dev-env/tests/release-tools/tasks/generatechangelogforsinglepackage.js b/packages/ckeditor5-dev-env/tests/release-tools/tasks/generatechangelogforsinglepackage.js index fb7ddb190..684b372ac 100644 --- a/packages/ckeditor5-dev-env/tests/release-tools/tasks/generatechangelogforsinglepackage.js +++ b/packages/ckeditor5-dev-env/tests/release-tools/tasks/generatechangelogforsinglepackage.js @@ -85,7 +85,8 @@ describe( 'dev-env/release-tools/tasks', () => { tagName: 'v0.5.0', newTagName: 'v1.0.0', transformCommit: stubs.transformCommit, - isInternalRelease: false + isInternalRelease: false, + skipLinks: false } ); expect( stubs.logger.info.calledThrice ).to.equal( true ); @@ -115,7 +116,8 @@ describe( 'dev-env/release-tools/tasks', () => { tagName: null, newTagName: 'v0.1.0', transformCommit: stubs.transformCommit, - isInternalRelease: false + isInternalRelease: false, + skipLinks: false } ); expect( stubs.getNewReleaseType.calledOnce ).to.equal( true ); @@ -177,7 +179,30 @@ describe( 'dev-env/release-tools/tasks', () => { tagName: 'v0.0.1', newTagName: 'v0.0.2', transformCommit: stubs.transformCommit, - isInternalRelease: true + isInternalRelease: true, + skipLinks: false + } ); + } ); + } ); + + it( 'passes the "skipLinks" option to the changelog generator', () => { + stubs.getNewReleaseType.returns( Promise.resolve( { + releaseType: 'minor' + } ) ); + stubs.cli.provideVersion.returns( Promise.resolve( '0.1.0' ) ); + stubs.versionUtils.getLastFromChangelog.returns( null ); + stubs.generateChangelogFromCommits.returns( Promise.resolve() ); + + return generateChangelogForSinglePackage( null, { skipLinks: true } ) + .then( () => { + expect( stubs.generateChangelogFromCommits.calledOnce ).to.equal( true ); + expect( stubs.generateChangelogFromCommits.firstCall.args[ 0 ] ).to.deep.equal( { + version: '0.1.0', + tagName: null, + newTagName: 'v0.1.0', + transformCommit: stubs.transformCommit, + isInternalRelease: false, + skipLinks: true } ); } ); } ); diff --git a/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits-integration.js b/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits-integration.js index f726b9c96..e4a8f9ebb 100644 --- a/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits-integration.js +++ b/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits-integration.js @@ -267,7 +267,7 @@ describe( 'dev-env/release-tools/utils', () => { '--message "NOTE: Please read #1." ' + '--message "BREAKING CHANGES: Some breaking change." ' ); - return generateChangelog( '0.4.2', true ) + return generateChangelog( '0.4.2', { isInternalRelease: true } ) .then( () => { const latestChangelog = getChangesForVersion( lastChangelogVersion ); @@ -403,7 +403,7 @@ describe( 'dev-env/release-tools/utils', () => { '--message "Fix: Foo Bar."' ); - return generateChangelog( '0.5.5', false, true ) + return generateChangelog( '0.5.5', { additionalNotes: true } ) .then( () => { const latestChangelog = replaceCommitIds( getChangesForVersion( lastChangelogVersion ) ); @@ -424,7 +424,7 @@ Besides changes in the dependencies, this version also contains the following bu } ); it( 'adds two blank lines for internal release (user specified "internal" version)', () => { - return generateChangelog( '0.5.6', true ) + return generateChangelog( '0.5.6', { isInternalRelease: true } ) .then( () => { const changelogAsArray = getChangelog().split( '\n' ).slice( 0, 9 ); @@ -472,24 +472,40 @@ Besides changes in the dependencies, this version also contains the following bu release(); } ); } ); + + it.only( 'does not generate links to commits and release', () => { + exec( 'git commit --allow-empty --message "Feature: Some amazing feature. Closes #1."' ); + + return generateChangelog( '0.6.0' ) + .then( () => { + console.log( getChangesForVersion( '0.6.0' ) ); + + release(); + } ); + } ); } ); function exec( command ) { return tools.shExec( command, { verbosity: 'error' } ); } - function generateChangelog( version, isInternalRelease = false, shouldAppendAdditionalNotes = false ) { + function generateChangelog( version, options = {} ) { lastChangelogVersion = version; + const isInternalRelease = !!options.isInternalRelease; + const additionalNotes = !!options.additionalNotes; + const skipLinks = !!options.skipLinks; + const transform = require( '../../../lib/release-tools/utils/transform-commit/transformcommitforsubrepository' ); return generateChangelogFromCommits( { version, isInternalRelease, + additionalNotes, + skipLinks, newTagName: 'v' + version, tagName: lastReleasedVersion ? 'v' + lastReleasedVersion : null, - transformCommit: transform, - additionalNotes: shouldAppendAdditionalNotes + transformCommit: transform } ); } diff --git a/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits.js b/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits.js index 734a1ab48..a70b6e861 100644 --- a/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits.js +++ b/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits.js @@ -159,7 +159,8 @@ describe( 'dev-env/release-tools/utils', () => { previousTag: 'v0.5.0', currentTag: 'v1.0.0', isInternalRelease: false, - additionalNotes: {} + additionalNotes: {}, + showLinks: true } ); expect( conventionalChangelogArguments[ 2 ] ).to.have.property( 'from', 'v0.5.0' ); expect( conventionalChangelogArguments[ 4 ] ).to.deep.equal( { foo: 'bar' } ); @@ -194,7 +195,8 @@ describe( 'dev-env/release-tools/utils', () => { previousTag: 'v0.5.0', currentTag: 'v0.5.1', isInternalRelease: true, - additionalNotes: {} + additionalNotes: {}, + showLinks: true } ); } ); } ); @@ -264,7 +266,47 @@ describe( 'dev-env/release-tools/utils', () => { previousTag: 'v0.5.0', currentTag: 'v0.5.1', isInternalRelease: false, - additionalNotes: additionalCommitNotes + additionalNotes: additionalCommitNotes, + showLinks: true + } ); + } ); + } ); + + it( 'allows generating changelog without links to commits ("skipLinks" option)', () => { + const newChangelogChunk = [ + '## 1.0.0', + '', + '### Features', + '', + 'Besides new features introduced in the dependencies, this build also introduces these features:', + '', + '* This test should pass!' + ].join( '\n' ); + + changelogBuffer = Buffer.from( newChangelogChunk ); + + stubs.fs.existsSync.returns( true ); + stubs.changelogUtils.getChangelog.returns( changelogUtils.changelogHeader ); + + const options = { + version: '0.5.1', + transformCommit: stubs.transformCommit, + tagName: 'v0.5.0', + newTagName: 'v0.5.1', + skipLinks: true + }; + + return generateChangelogFromCommits( options ) + .then( () => { + expect( conventionalChangelogArguments ).to.be.an( 'array' ); + expect( conventionalChangelogArguments[ 1 ] ).to.deep.equal( { + displayLogs: false, + version: '0.5.1', + previousTag: 'v0.5.0', + currentTag: 'v0.5.1', + isInternalRelease: false, + additionalNotes: {}, + showLinks: false } ); } ); } ); From ea7afc262c2a9df19ac7c35138951bd1dd03736a Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Wed, 27 Jun 2018 14:45:07 +0200 Subject: [PATCH 02/16] Improved the tests readability. --- .../release-tools/utils/generatechangelogfromcommits.js | 8 +++++--- .../release-tools/utils/generatechangelogfromcommits.js | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/ckeditor5-dev-env/lib/release-tools/utils/generatechangelogfromcommits.js b/packages/ckeditor5-dev-env/lib/release-tools/utils/generatechangelogfromcommits.js index 60a5e1734..fb4f090e5 100644 --- a/packages/ckeditor5-dev-env/lib/release-tools/utils/generatechangelogfromcommits.js +++ b/packages/ckeditor5-dev-env/lib/release-tools/utils/generatechangelogfromcommits.js @@ -62,13 +62,15 @@ module.exports = function generateChangelogFromCommits( options ) { const writerOptions = getWriterOptions( options.transformCommit ); conventionalChangelog( {}, context, gitRawCommitsOpts, parserOptions, writerOptions ) - .pipe( saveChangelogPipe( options.version, resolve, options.doNotSave ) ); + .pipe( changelogPipe( options.version, resolve, { + doNotSave: options.doNotSave + } ) ); } ); }; -function saveChangelogPipe( version, done, doNotSave = false ) { +function changelogPipe( version, done, options ) { return stream.noop( changes => { - if ( doNotSave ) { + if ( options.doNotSave ) { return done( changes.toString() ); } diff --git a/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits.js b/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits.js index a70b6e861..8fe6686cd 100644 --- a/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits.js +++ b/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits.js @@ -104,7 +104,7 @@ describe( 'dev-env/release-tools/utils', () => { } ); } ); - it( 'does not crate a changelog file if is not present but the "doNotSave" option is set on `true`', () => { + it( 'does not create a changelog file if is not present but the "doNotSave" option is set on `true`', () => { changelogBuffer = Buffer.from( 'Changelog.' ); stubs.fs.existsSync.returns( false ); @@ -230,7 +230,7 @@ describe( 'dev-env/release-tools/utils', () => { } ); } ); - it( 'allows appending additional notes for groups of commits ', () => { + it( 'allows appending additional notes for groups of commits', () => { const newChangelogChunk = [ '## 1.0.0', '', From c9b1bc5279757fee49b7594c5509a04e84e565ae Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Wed, 27 Jun 2018 14:45:36 +0200 Subject: [PATCH 03/16] Changed order of commands (because it did not worked on Windows). --- .../utils/generatechangelogfromcommits-integration.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits-integration.js b/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits-integration.js index e4a8f9ebb..f0b00db6e 100644 --- a/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits-integration.js +++ b/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits-integration.js @@ -51,8 +51,8 @@ describe( 'dev-env/release-tools/utils', () => { } ); after( () => { - exec( `rm -rf ${ tmpCwd }` ); process.chdir( cwd ); + exec( `rm -rf ${ tmpCwd }` ); } ); beforeEach( () => { From 69fcdcd9ccd164cfb8ff16521ef969b97fab95a5 Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Wed, 27 Jun 2018 15:38:01 +0200 Subject: [PATCH 04/16] Tests would work on Windows env. --- ...eneratechangelogfromcommits-integration.js | 74 +++++++++++-------- 1 file changed, 44 insertions(+), 30 deletions(-) diff --git a/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits-integration.js b/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits-integration.js index f0b00db6e..bf39e6119 100644 --- a/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits-integration.js +++ b/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits-integration.js @@ -11,7 +11,25 @@ const expect = require( 'chai' ).expect; const sinon = require( 'sinon' ); const proxyquire = require( 'proxyquire' ); const { tools, stream } = require( '@ckeditor/ckeditor5-dev-utils' ); -const { changelogHeader, getChangelog, getChangesForVersion } = require( '../../../lib/release-tools/utils/changelog' ); +const { + changelogHeader, + getChangelog: _getChangelog, + getChangesForVersion: _getChangesForVersion +} = require( '../../../lib/release-tools/utils/changelog' ); + +// Because of the Windows end of the line, we need to normalize them. +// If we won't do it, some of the assertions will fail because strings will be ending with "\r" that wasn't expected. +function normalizeStrings( content ) { + return content.replace( /\r\n/g, '\n' ); +} + +function getChangelog() { + return normalizeStrings( _getChangelog() ); +} + +function getChangesForVersion( ...params ) { + return normalizeStrings( _getChangesForVersion( ...params ) ); +} describe( 'dev-env/release-tools/utils', () => { const url = 'https://github.com/ckeditor/ckeditor5-test-package'; @@ -118,13 +136,13 @@ describe( 'dev-env/release-tools/utils', () => { const latestChangelog = replaceCommitIds( getChangesForVersion( lastChangelogVersion ) ); /* eslint-disable max-len */ - const expectedChangelog = ` + const expectedChangelog = normalizeStrings( ` ### Features * Another feature. Closes [#2](https://github.com/ckeditor/ckeditor5-test-package/issues/2). ([XXXXXXX](https://github.com/ckeditor/ckeditor5-test-package/commit/XXXXXXX)) This PR also closes [#3](https://github.com/ckeditor/ckeditor5-test-package/issues/3) and [#4](https://github.com/ckeditor/ckeditor5-test-package/issues/4). -`; +` ); /* eslint-enable max-len */ expect( latestChangelog ).to.equal( expectedChangelog.trim() ); @@ -144,13 +162,13 @@ describe( 'dev-env/release-tools/utils', () => { const latestChangelog = replaceCommitIds( getChangesForVersion( lastChangelogVersion ) ); /* eslint-disable max-len */ - const expectedChangelog = ` + const expectedChangelog = normalizeStrings( ` ### Bug fixes * Amazing fix. Closes [#5](https://github.com/ckeditor/ckeditor5-test-package/issues/5). ([XXXXXXX](https://github.com/ckeditor/ckeditor5-test-package/commit/XXXXXXX)) The PR also finally closes [#3](https://github.com/ckeditor/ckeditor5-test-package/issues/3) and [#4](https://github.com/ckeditor/ckeditor5-test-package/issues/4). So good! -`; +` ); /* eslint-enable max-len */ expect( latestChangelog ).to.equal( expectedChangelog.trim() ); @@ -172,7 +190,7 @@ describe( 'dev-env/release-tools/utils', () => { const latestChangelog = replaceCommitIds( getChangesForVersion( lastChangelogVersion ) ); /* eslint-disable max-len */ - const expectedChangelog = ` + const expectedChangelog = normalizeStrings( ` ### Other changes * Some docs improvements. Closes [#6](https://github.com/ckeditor/ckeditor5-test-package/issues/6). ([XXXXXXX](https://github.com/ckeditor/ckeditor5-test-package/commit/XXXXXXX)) @@ -186,7 +204,7 @@ describe( 'dev-env/release-tools/utils', () => { ### NOTE * Please read [#1](https://github.com/ckeditor/ckeditor5-test-package/issues/1). -`; +` ); /* eslint-enable max-len */ expect( latestChangelog ).to.equal( expectedChangelog.trim() ); @@ -207,7 +225,7 @@ describe( 'dev-env/release-tools/utils', () => { const latestChangelog = replaceCommitIds( getChangesForVersion( lastChangelogVersion ) ); /* eslint-disable max-len */ - const expectedChangelog = ` + const expectedChangelog = normalizeStrings( ` ### Features * Issues will not be hoisted. Closes [#8](https://github.com/ckeditor/ckeditor5-test-package/issues/8). ([XXXXXXX](https://github.com/ckeditor/ckeditor5-test-package/commit/XXXXXXX)) @@ -221,7 +239,7 @@ describe( 'dev-env/release-tools/utils', () => { ### NOTE * Please read [#1](https://github.com/ckeditor/ckeditor5-test-package/issues/1). -`; +` ); /* eslint-enable max-len */ expect( latestChangelog ).to.equal( expectedChangelog.trim() ); @@ -246,7 +264,7 @@ describe( 'dev-env/release-tools/utils', () => { const changelogAsArray = replaceDates( getChangelog() ).replace( changelogHeader, '' ).split( '\n' ); expectedChangelogeEntries.forEach( ( row, index ) => { - expect( row ).to.equal( changelogAsArray[ index ], `Index: ${ index }` ); + expect( row.trim() ).to.equal( changelogAsArray[ index ].trim(), `Index: ${ index }` ); } ); release(); @@ -287,11 +305,11 @@ describe( 'dev-env/release-tools/utils', () => { const latestChangelog = replaceCommitIds( getChangesForVersion( lastChangelogVersion ) ); /* eslint-disable max-len */ - const expectedChangelog = ` + const expectedChangelog = normalizeStrings( ` ### Features * Another feature. Closes [#2](https://github.com/ckeditor/ckeditor5-test-package/issues/2). ([XXXXXXX](https://github.com/ckeditor/ckeditor5-test-package/commit/XXXXXXX)) -`; +` ); /* eslint-enable max-len */ expect( latestChangelog ).to.equal( expectedChangelog.trim() ); @@ -312,11 +330,11 @@ describe( 'dev-env/release-tools/utils', () => { const latestChangelog = replaceCommitIds( getChangesForVersion( lastChangelogVersion ) ); /* eslint-disable max-len */ - const expectedChangelog = ` + const expectedChangelog = normalizeStrings( ` ### Bug fixes * Foo. ([XXXXXXX](https://github.com/ckeditor/ckeditor5-test-package/commit/XXXXXXX)) -`; +` ); /* eslint-enable max-len */ expect( latestChangelog ).to.equal( expectedChangelog.trim() ); @@ -337,11 +355,11 @@ describe( 'dev-env/release-tools/utils', () => { const latestChangelog = replaceCommitIds( getChangesForVersion( lastChangelogVersion ) ); /* eslint-disable max-len */ - const expectedChangelog = ` + const expectedChangelog = normalizeStrings( ` ### Bug fixes * Foo. ([XXXXXXX](https://github.com/ckeditor/ckeditor5-test-package/commit/XXXXXXX)) -`; +` ); /* eslint-enable max-len */ expect( latestChangelog ).to.equal( expectedChangelog.trim() ); @@ -361,11 +379,11 @@ describe( 'dev-env/release-tools/utils', () => { const latestChangelog = replaceCommitIds( getChangesForVersion( lastChangelogVersion ) ); /* eslint-disable max-len */ - const expectedChangelog = ` + const expectedChangelog = normalizeStrings( ` ### Bug fixes * Foo Bar. ([XXXXXXX](https://github.com/ckeditor/ckeditor5-test-package/commit/XXXXXXX)) -`; +` ); /* eslint-enable max-len */ expect( latestChangelog ).to.equal( expectedChangelog.trim() ); @@ -385,11 +403,11 @@ describe( 'dev-env/release-tools/utils', () => { const latestChangelog = replaceCommitIds( getChangesForVersion( lastChangelogVersion ) ); /* eslint-disable max-len */ - const expectedChangelog = ` + const expectedChangelog = normalizeStrings( ` ### Bug fixes * Bar Foo. ([XXXXXXX](https://github.com/ckeditor/ckeditor5-test-package/commit/XXXXXXX)) -`; +` ); /* eslint-enable max-len */ expect( latestChangelog ).to.equal( expectedChangelog.trim() ); @@ -408,13 +426,13 @@ describe( 'dev-env/release-tools/utils', () => { const latestChangelog = replaceCommitIds( getChangesForVersion( lastChangelogVersion ) ); /* eslint-disable max-len */ - const expectedChangelog = ` + const expectedChangelog = normalizeStrings( ` ### Bug fixes Besides changes in the dependencies, this version also contains the following bug fixes: * Foo Bar. ([XXXXXXX](https://github.com/ckeditor/ckeditor5-test-package/commit/XXXXXXX)) -`; +` ); /* eslint-enable max-len */ expect( latestChangelog ).to.equal( expectedChangelog.trim() ); @@ -492,17 +510,13 @@ Besides changes in the dependencies, this version also contains the following bu function generateChangelog( version, options = {} ) { lastChangelogVersion = version; - const isInternalRelease = !!options.isInternalRelease; - const additionalNotes = !!options.additionalNotes; - const skipLinks = !!options.skipLinks; - const transform = require( '../../../lib/release-tools/utils/transform-commit/transformcommitforsubrepository' ); return generateChangelogFromCommits( { version, - isInternalRelease, - additionalNotes, - skipLinks, + isInternalRelease: options.isInternalRelease, + additionalNotes: options.additionalNotes, + skipLinks: options.skipLinks, newTagName: 'v' + version, tagName: lastReleasedVersion ? 'v' + lastReleasedVersion : null, transformCommit: transform @@ -526,6 +540,6 @@ Besides changes in the dependencies, this version also contains the following bu } function replaceDates( changelog ) { - return changelog.replace( /\) \(\d{4}-\d{2}-\d{2}\)/g, ') (0000-00-00)' ); + return changelog.replace( /\d{4}-\d{2}-\d{2}/g, '0000-00-00' ); } } ); From 868515289ec66cf335d891dfe33e61a9b0816816 Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Wed, 27 Jun 2018 15:55:44 +0200 Subject: [PATCH 05/16] Generating changelog without the links should work. --- .../lib/release-tools/templates/commit.hbs | 2 +- .../utils/generatechangelogfromcommits.js | 3 ++- ...eneratechangelogfromcommits-integration.js | 23 +++++++++++++++---- .../utils/generatechangelogfromcommits.js | 12 ++++++---- 4 files changed, 30 insertions(+), 10 deletions(-) diff --git a/packages/ckeditor5-dev-env/lib/release-tools/templates/commit.hbs b/packages/ckeditor5-dev-env/lib/release-tools/templates/commit.hbs index 00df1a71a..0219daa7f 100644 --- a/packages/ckeditor5-dev-env/lib/release-tools/templates/commit.hbs +++ b/packages/ckeditor5-dev-env/lib/release-tools/templates/commit.hbs @@ -4,7 +4,7 @@ {{~title}} {{~/if}} -{{~#if showLinks}} +{{~#if @root.linkCommit}} {{~!-- commit link --}} {{#if @root.linkReferences~}} ([{{hash}}]( {{~#if @root.repository}} diff --git a/packages/ckeditor5-dev-env/lib/release-tools/utils/generatechangelogfromcommits.js b/packages/ckeditor5-dev-env/lib/release-tools/utils/generatechangelogfromcommits.js index fb4f090e5..89e76843c 100644 --- a/packages/ckeditor5-dev-env/lib/release-tools/utils/generatechangelogfromcommits.js +++ b/packages/ckeditor5-dev-env/lib/release-tools/utils/generatechangelogfromcommits.js @@ -46,7 +46,8 @@ module.exports = function generateChangelogFromCommits( options ) { displayLogs: false, isInternalRelease: options.isInternalRelease || false, additionalNotes: {}, - showLinks: typeof options.skipLinks == 'undefined' ? true : !options.skipLinks + linkCommit: typeof options.skipLinks == 'undefined' ? true : !options.skipLinks, + linkCompare: typeof options.skipLinks == 'undefined' ? true : !options.skipLinks }; if ( options.additionalNotes ) { diff --git a/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits-integration.js b/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits-integration.js index bf39e6119..1fc2fd0b9 100644 --- a/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits-integration.js +++ b/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits-integration.js @@ -491,12 +491,27 @@ Besides changes in the dependencies, this version also contains the following bu } ); } ); - it.only( 'does not generate links to commits and release', () => { - exec( 'git commit --allow-empty --message "Feature: Some amazing feature. Closes #1."' ); + it( 'does not generate links to commits and release', () => { + exec( 'git commit --allow-empty --message "Feature: Some amazing feature."' ); - return generateChangelog( '0.6.0' ) + return generateChangelog( '0.6.0', { skipLinks: true } ) .then( () => { - console.log( getChangesForVersion( '0.6.0' ) ); + const changelogAsArray = getChangelog().split( '\n' ).slice( 0, 10 ); + + expect( changelogAsArray[ 0 ], 'Index: 0' ).to.equal( 'Changelog' ); + expect( changelogAsArray[ 1 ], 'Index: 1' ).to.equal( '=========' ); + expect( changelogAsArray[ 2 ], 'Index: 2' ).to.equal( '' ); + expect( replaceDates( changelogAsArray[ 3 ] ), 'Index: 3' ).to.equal( + '## 0.6.0 (0000-00-00)' + ); + expect( changelogAsArray[ 4 ], 'Index: 4' ).to.equal( '' ); + expect( changelogAsArray[ 5 ], 'Index: 5' ).to.equal( '### Features' ); + expect( changelogAsArray[ 6 ], 'Index: 6' ).to.equal( '' ); + expect( changelogAsArray[ 7 ], 'Index: 7' ).to.equal( + '* Some amazing feature.' + ); + expect( changelogAsArray[ 8 ], 'Index: 8' ).to.equal( '' ); + expect( changelogAsArray[ 9 ], 'Index: 9' ).to.equal( '' ); release(); } ); diff --git a/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits.js b/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits.js index 8fe6686cd..d2569958d 100644 --- a/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits.js +++ b/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits.js @@ -160,7 +160,8 @@ describe( 'dev-env/release-tools/utils', () => { currentTag: 'v1.0.0', isInternalRelease: false, additionalNotes: {}, - showLinks: true + linkCommit: true, + linkCompare: true } ); expect( conventionalChangelogArguments[ 2 ] ).to.have.property( 'from', 'v0.5.0' ); expect( conventionalChangelogArguments[ 4 ] ).to.deep.equal( { foo: 'bar' } ); @@ -196,7 +197,8 @@ describe( 'dev-env/release-tools/utils', () => { currentTag: 'v0.5.1', isInternalRelease: true, additionalNotes: {}, - showLinks: true + linkCommit: true, + linkCompare: true } ); } ); } ); @@ -267,7 +269,8 @@ describe( 'dev-env/release-tools/utils', () => { currentTag: 'v0.5.1', isInternalRelease: false, additionalNotes: additionalCommitNotes, - showLinks: true + linkCommit: true, + linkCompare: true } ); } ); } ); @@ -306,7 +309,8 @@ describe( 'dev-env/release-tools/utils', () => { currentTag: 'v0.5.1', isInternalRelease: false, additionalNotes: {}, - showLinks: false + linkCommit: false, + linkCompare: false } ); } ); } ); From 92cf2883e91eab47fa9cd93ecb8a2915ef3423b3 Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Wed, 27 Jun 2018 15:57:17 +0200 Subject: [PATCH 06/16] Added debug mode which helps understand what 3rd party plugins do. --- README.md | 16 ++++++++++++++-- .../utils/generatechangelogfromcommits.js | 10 ++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c20f24655..0f8873d31 100644 --- a/README.md +++ b/README.md @@ -19,13 +19,25 @@ CKEditor 5 development tools packages Tests: -``` +```bash npm test ``` -Code coverage: +Tests with Debug mode: + +```bash +DEBUG=true npm test +``` +Test a single package: + +```bash +./node_modules/.bin/mocha packages/ckeditor5-dev-env/tests/* --recursive ``` + +Code coverage: + +```bash npm run coverage ``` diff --git a/packages/ckeditor5-dev-env/lib/release-tools/utils/generatechangelogfromcommits.js b/packages/ckeditor5-dev-env/lib/release-tools/utils/generatechangelogfromcommits.js index 89e76843c..8912e6238 100644 --- a/packages/ckeditor5-dev-env/lib/release-tools/utils/generatechangelogfromcommits.js +++ b/packages/ckeditor5-dev-env/lib/release-tools/utils/generatechangelogfromcommits.js @@ -62,6 +62,10 @@ module.exports = function generateChangelogFromCommits( options ) { const writerOptions = getWriterOptions( options.transformCommit ); + if ( process.env.DEBUG ) { + writerOptions.debug = getDebugFuntion(); + } + conventionalChangelog( {}, context, gitRawCommitsOpts, parserOptions, writerOptions ) .pipe( changelogPipe( options.version, resolve, { doNotSave: options.doNotSave @@ -90,3 +94,9 @@ function changelogPipe( version, done, options ) { done( version ); } ); } + +function getDebugFuntion() { + return ( ...params ) => { + console.log( ...params ); + }; +} From 74c515967bec776feea1b1811d5136830fbfe465 Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Wed, 27 Jun 2018 15:57:46 +0200 Subject: [PATCH 07/16] Improved the code syntax template. --- .../lib/release-tools/templates/template.hbs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ckeditor5-dev-env/lib/release-tools/templates/template.hbs b/packages/ckeditor5-dev-env/lib/release-tools/templates/template.hbs index 1c1de71e3..a9a76974a 100644 --- a/packages/ckeditor5-dev-env/lib/release-tools/templates/template.hbs +++ b/packages/ckeditor5-dev-env/lib/release-tools/templates/template.hbs @@ -8,8 +8,8 @@ Internal changes only (updated dependencies, documentation, etc.). {{#each commitGroups}} ### {{title}} -{{#if (lookup ../additionalNotes title)}} -{{ lookup ../additionalNotes title }} +{{#if (lookup @root.additionalNotes title)}} +{{ lookup @root.additionalNotes title }} {{/if}} {{#each commits}} From 1b3c09c76d5202420609db465e2e6f5f6629afce Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Wed, 27 Jun 2018 16:10:00 +0200 Subject: [PATCH 08/16] Fixed template/commit tests. --- .../tests/release-tools/templates/commit.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/ckeditor5-dev-env/tests/release-tools/templates/commit.js b/packages/ckeditor5-dev-env/tests/release-tools/templates/commit.js index c03eccadc..8eb3e286a 100644 --- a/packages/ckeditor5-dev-env/tests/release-tools/templates/commit.js +++ b/packages/ckeditor5-dev-env/tests/release-tools/templates/commit.js @@ -26,11 +26,12 @@ describe( 'dev-env/release-tools/changelog/templates', () => { repository: 'repository', commit: 'commit', issue: 'issues', - linkReferences: true + linkReferences: true, + linkCommit: true }; templateOptions = { data: { - root: rootOptions + root: rootOptions, } }; } ); @@ -86,5 +87,14 @@ describe( 'dev-env/release-tools/changelog/templates', () => { '\n\n Some paragraph.\n\n * List Item 1.\n * List Item 2.'; expect( template( data, templateOptions ) ).to.equal( expectedEntry + '\n' ); } ); + + it( 'hide the commit hash', () => { + rootOptions.linkCommit = false; + + const data = { subject: 'Test', hash: '1234qwe' }; + + const expectedEntry = '* Test'; + expect( template( data, templateOptions ) ).to.equal( expectedEntry + '\n' ); + } ); } ); } ); From b3fe95808f3d9bf19d259fcc11aa324b4f1b56f4 Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Wed, 27 Jun 2018 16:10:41 +0200 Subject: [PATCH 09/16] Short glob does not work on Windows. --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6a70797cc..6b08138e1 100644 --- a/package.json +++ b/package.json @@ -21,8 +21,8 @@ "bugs": "https://github.com/ckeditor/ckeditor5-dev/issues", "homepage": "https://github.com/ckeditor/ckeditor5-dev#readme", "scripts": { - "test": "mocha packages/*/tests --recursive --timeout 5000", - "coverage": "istanbul cover _mocha packages/*/tests -- --recursive --timeout 5000", + "test": "mocha packages/*/tests/**/*.js --recursive --timeout 5000", + "coverage": "istanbul cover _mocha packages/*/tests/**/*.js -- --recursive --timeout 5000", "changelog": "node ./scripts/changelog.js", "lint": "eslint --quiet '**/*.js'", "precommit": "lint-staged" From 942229004de1fe59f5055734c13333309d619484 Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Wed, 27 Jun 2018 20:40:31 +0200 Subject: [PATCH 10/16] Travis, please... From 12a8ffa32287f59c6775e24eadfec3bb3e893e94 Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Thu, 28 Jun 2018 08:03:11 +0200 Subject: [PATCH 11/16] Typo. --- .../ckeditor5-dev-env/tests/release-tools/templates/commit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ckeditor5-dev-env/tests/release-tools/templates/commit.js b/packages/ckeditor5-dev-env/tests/release-tools/templates/commit.js index 8eb3e286a..d9fa4f666 100644 --- a/packages/ckeditor5-dev-env/tests/release-tools/templates/commit.js +++ b/packages/ckeditor5-dev-env/tests/release-tools/templates/commit.js @@ -88,7 +88,7 @@ describe( 'dev-env/release-tools/changelog/templates', () => { expect( template( data, templateOptions ) ).to.equal( expectedEntry + '\n' ); } ); - it( 'hide the commit hash', () => { + it( 'hides the commit hash', () => { rootOptions.linkCommit = false; const data = { subject: 'Test', hash: '1234qwe' }; From 103b3bd01c7148dab0c9aa7ebbb347a64cdb79e3 Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Thu, 28 Jun 2018 08:03:26 +0200 Subject: [PATCH 12/16] Revert "Short glob does not work on Windows." This reverts commit b3fe95808f3d9bf19d259fcc11aa324b4f1b56f4. --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6b08138e1..6a70797cc 100644 --- a/package.json +++ b/package.json @@ -21,8 +21,8 @@ "bugs": "https://github.com/ckeditor/ckeditor5-dev/issues", "homepage": "https://github.com/ckeditor/ckeditor5-dev#readme", "scripts": { - "test": "mocha packages/*/tests/**/*.js --recursive --timeout 5000", - "coverage": "istanbul cover _mocha packages/*/tests/**/*.js -- --recursive --timeout 5000", + "test": "mocha packages/*/tests --recursive --timeout 5000", + "coverage": "istanbul cover _mocha packages/*/tests -- --recursive --timeout 5000", "changelog": "node ./scripts/changelog.js", "lint": "eslint --quiet '**/*.js'", "precommit": "lint-staged" From 1aa095c702941666b6de6694fd4c16d798579fde Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Thu, 28 Jun 2018 08:21:40 +0200 Subject: [PATCH 13/16] Added a comment that explains what we have a DEBUG mode. --- .../lib/release-tools/utils/generatechangelogfromcommits.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/ckeditor5-dev-env/lib/release-tools/utils/generatechangelogfromcommits.js b/packages/ckeditor5-dev-env/lib/release-tools/utils/generatechangelogfromcommits.js index 8912e6238..d4cb8272d 100644 --- a/packages/ckeditor5-dev-env/lib/release-tools/utils/generatechangelogfromcommits.js +++ b/packages/ckeditor5-dev-env/lib/release-tools/utils/generatechangelogfromcommits.js @@ -62,7 +62,10 @@ module.exports = function generateChangelogFromCommits( options ) { const writerOptions = getWriterOptions( options.transformCommit ); + /* istanbul ignore next */ if ( process.env.DEBUG ) { + // Displays the final `context` which will be used to generate the changelog. + // It contains grouped commits, repository details, etc. writerOptions.debug = getDebugFuntion(); } From 4ddefb96ffad6a794692ed729a9d20297ac878dd Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Thu, 28 Jun 2018 09:07:20 +0200 Subject: [PATCH 14/16] Simplified the test. --- .../utils/generatechangelogfromcommits.js | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits.js b/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits.js index d2569958d..80abd3f43 100644 --- a/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits.js +++ b/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits.js @@ -233,17 +233,7 @@ describe( 'dev-env/release-tools/utils', () => { } ); it( 'allows appending additional notes for groups of commits', () => { - const newChangelogChunk = [ - '## 1.0.0', - '', - '### Features', - '', - 'Besides new features introduced in the dependencies, this build also introduces these features:', - '', - '* This test should pass!' - ].join( '\n' ); - - changelogBuffer = Buffer.from( newChangelogChunk ); + changelogBuffer = Buffer.from( 'Changelog.' ); stubs.fs.existsSync.returns( true ); stubs.changelogUtils.getChangelog.returns( changelogUtils.changelogHeader ); @@ -276,17 +266,7 @@ describe( 'dev-env/release-tools/utils', () => { } ); it( 'allows generating changelog without links to commits ("skipLinks" option)', () => { - const newChangelogChunk = [ - '## 1.0.0', - '', - '### Features', - '', - 'Besides new features introduced in the dependencies, this build also introduces these features:', - '', - '* This test should pass!' - ].join( '\n' ); - - changelogBuffer = Buffer.from( newChangelogChunk ); + changelogBuffer = Buffer.from( 'Changelog.' ); stubs.fs.existsSync.returns( true ); stubs.changelogUtils.getChangelog.returns( changelogUtils.changelogHeader ); From 68adf05bb77c69f81fceb53fd7f210aa17bd6ef6 Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Thu, 28 Jun 2018 09:12:41 +0200 Subject: [PATCH 15/16] Upgraded the lin-staged package that does not work on Windows 10 (and Node 10) properly. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6a70797cc..a9a895b58 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "husky": "^0.14.3", "istanbul": "^0.4.4", "lerna": "^2.2.0", - "lint-staged": "^7.0.0", + "lint-staged": "^7.2.0", "mocha": "^5.0.5" }, "engines": { From eda7c1a8bf03c5f224ab3d2d1aded536f5027d1f Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Thu, 28 Jun 2018 13:48:08 +0200 Subject: [PATCH 16/16] Simplified the code. --- .../lib/release-tools/templates/commit.hbs | 4 ++-- .../lib/release-tools/templates/header.hbs | 4 ++-- .../utils/generatechangelogfromcommits.js | 4 ++-- .../tests/release-tools/templates/commit.js | 4 ++-- .../utils/generatechangelogfromcommits.js | 16 ++++++++-------- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/ckeditor5-dev-env/lib/release-tools/templates/commit.hbs b/packages/ckeditor5-dev-env/lib/release-tools/templates/commit.hbs index 0219daa7f..6546751e3 100644 --- a/packages/ckeditor5-dev-env/lib/release-tools/templates/commit.hbs +++ b/packages/ckeditor5-dev-env/lib/release-tools/templates/commit.hbs @@ -4,7 +4,7 @@ {{~title}} {{~/if}} -{{~#if @root.linkCommit}} +{{~#unless @root.skipCommitsLink}} {{~!-- commit link --}} {{#if @root.linkReferences~}} ([{{hash}}]( {{~#if @root.repository}} @@ -22,7 +22,7 @@ {{~else}} {{~hash}} {{~/if}} -{{/if}} +{{/unless}} {{#if body}} diff --git a/packages/ckeditor5-dev-env/lib/release-tools/templates/header.hbs b/packages/ckeditor5-dev-env/lib/release-tools/templates/header.hbs index fadc7800d..b51d330bf 100644 --- a/packages/ckeditor5-dev-env/lib/release-tools/templates/header.hbs +++ b/packages/ckeditor5-dev-env/lib/release-tools/templates/header.hbs @@ -1,4 +1,4 @@ -## {{#if @root.linkCompare~}} +## {{#unless @root.skipCompareLink~}} [{{version}}]( {{~#if @root.repository~}} {{~#if @root.host}} @@ -14,6 +14,6 @@ /compare/{{previousTag}}...{{currentTag}}) {{~else}} {{~version}} -{{~/if}} +{{~/unless}} {{~#if date}} ({{date}}) {{/if}} diff --git a/packages/ckeditor5-dev-env/lib/release-tools/utils/generatechangelogfromcommits.js b/packages/ckeditor5-dev-env/lib/release-tools/utils/generatechangelogfromcommits.js index d4cb8272d..3ffdb16da 100644 --- a/packages/ckeditor5-dev-env/lib/release-tools/utils/generatechangelogfromcommits.js +++ b/packages/ckeditor5-dev-env/lib/release-tools/utils/generatechangelogfromcommits.js @@ -46,8 +46,8 @@ module.exports = function generateChangelogFromCommits( options ) { displayLogs: false, isInternalRelease: options.isInternalRelease || false, additionalNotes: {}, - linkCommit: typeof options.skipLinks == 'undefined' ? true : !options.skipLinks, - linkCompare: typeof options.skipLinks == 'undefined' ? true : !options.skipLinks + skipCommitsLink: Boolean( options.skipLinks ), + skipCompareLink: Boolean( options.skipLinks ) }; if ( options.additionalNotes ) { diff --git a/packages/ckeditor5-dev-env/tests/release-tools/templates/commit.js b/packages/ckeditor5-dev-env/tests/release-tools/templates/commit.js index d9fa4f666..3f41d74e6 100644 --- a/packages/ckeditor5-dev-env/tests/release-tools/templates/commit.js +++ b/packages/ckeditor5-dev-env/tests/release-tools/templates/commit.js @@ -27,7 +27,7 @@ describe( 'dev-env/release-tools/changelog/templates', () => { commit: 'commit', issue: 'issues', linkReferences: true, - linkCommit: true + skipCommitsLink: false }; templateOptions = { data: { @@ -89,7 +89,7 @@ describe( 'dev-env/release-tools/changelog/templates', () => { } ); it( 'hides the commit hash', () => { - rootOptions.linkCommit = false; + rootOptions.skipCommitsLink = true; const data = { subject: 'Test', hash: '1234qwe' }; diff --git a/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits.js b/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits.js index 80abd3f43..858ffd114 100644 --- a/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits.js +++ b/packages/ckeditor5-dev-env/tests/release-tools/utils/generatechangelogfromcommits.js @@ -160,8 +160,8 @@ describe( 'dev-env/release-tools/utils', () => { currentTag: 'v1.0.0', isInternalRelease: false, additionalNotes: {}, - linkCommit: true, - linkCompare: true + skipCommitsLink: false, + skipCompareLink: false } ); expect( conventionalChangelogArguments[ 2 ] ).to.have.property( 'from', 'v0.5.0' ); expect( conventionalChangelogArguments[ 4 ] ).to.deep.equal( { foo: 'bar' } ); @@ -197,8 +197,8 @@ describe( 'dev-env/release-tools/utils', () => { currentTag: 'v0.5.1', isInternalRelease: true, additionalNotes: {}, - linkCommit: true, - linkCompare: true + skipCommitsLink: false, + skipCompareLink: false } ); } ); } ); @@ -259,8 +259,8 @@ describe( 'dev-env/release-tools/utils', () => { currentTag: 'v0.5.1', isInternalRelease: false, additionalNotes: additionalCommitNotes, - linkCommit: true, - linkCompare: true + skipCommitsLink: false, + skipCompareLink: false } ); } ); } ); @@ -289,8 +289,8 @@ describe( 'dev-env/release-tools/utils', () => { currentTag: 'v0.5.1', isInternalRelease: false, additionalNotes: {}, - linkCommit: false, - linkCompare: false + skipCommitsLink: true, + skipCompareLink: true } ); } ); } );