Skip to content

Commit 82d9689

Browse files
authored
ci: Updated prepare release to exclude semver major copy for repos other than node-newrelic (#3242)
1 parent ae9e21d commit 82d9689

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

bin/conventional-changelog.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ class ConventionalChangelog {
206206
owner: self.org,
207207
repository: self.repo,
208208
isPatch: false,
209-
version: self.newVersion
209+
version: self.newVersion,
210+
includeSemverCopy: self.repo === 'node-newrelic'
210211
}
211212

212213
const markdownFormatter = conventionalChangelogWriter(context, {

bin/templates/template.hbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
{{#each noteGroups}}
55
#### ⚠ {{title}}
66

7+
{{#if @root.includeSemverCopy}}
78
This version of the Node.js agent is a SemVer MAJOR update and contains the following breaking changes. MAJOR versions may drop support for language runtimes that have reached End-of-Life according to the maintainer. Additionally, MAJOR versions may drop support for and remove certain instrumentation. For more details on these changes please see the [migration guide](https://docs.newrelic.com/docs/apm/agents/nodejs-agent/installation-configuration/update-nodejs-agent/).
9+
{{/if}}
810

911
{{#each notes}}
1012
* {{#if commit.scope}}**{{commit.scope}}:** {{/if}}{{text}}

bin/test/conventional-changelog.test.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@ const exampleCommit = {
5252
}
5353
}
5454

55+
const exampleMarkdownNoSemverMajorCopy = `### v1.0.0 (2020-04-03)
56+
#### ⚠ BREAKING CHANGES
57+
58+
59+
* **thing:** updated Thing to prevent modifications to inputs
60+
61+
#### Bug fixes
62+
63+
* **thing:** updated Thing to prevent modifications to inputs ([#123](https://github.com/newrelic/node-newrelic/pull/123)), closes [1234](https://github.com/newrelic/testRepo/issues/1234)
64+
* Thing no longer mutates provided inputs, but instead clones inputs before performing modifications. Thing will now always return an entirely new output
65+
`
66+
5567
const exampleMarkdown = `### v1.0.0 (2020-04-03)
5668
#### ⚠ BREAKING CHANGES
5769
@@ -205,6 +217,16 @@ test('Conventional Changelog Class', async (t) => {
205217
}
206218
)
207219

220+
await t.test(
221+
'generateMarkdownChangelog - should create the new Markdown changelog entry, skip semver major copy',
222+
async (t) => {
223+
const { ConventionalChangelog } = t.nr
224+
const changelog = new ConventionalChangelog({ newVersion: '1.0.0', previousVersion: '0.9.0', repo: 'testRepo' })
225+
const markdown = await changelog.generateMarkdownChangelog([exampleCommit])
226+
assert.equal(markdown, exampleMarkdownNoSemverMajorCopy)
227+
}
228+
)
229+
208230
await t.test(
209231
'writeMarkdownChangelog - should not update the markdown file if notes already exist',
210232
async (t) => {

0 commit comments

Comments
 (0)