newrelic 7.1.0 → 7.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/NEWS.md CHANGED
@@ -1,3 +1,12 @@
1
+ ### v7.1.1 (2021-02-01)
2
+
3
+ * Upgrade @grpc/grpc-js to v1.2.5 to fix non-propagation of internal http2 errors
4
+ Now allows minor and patch auto-updates.
5
+
6
+ * Added workflow for publishing to npm when a v* tag is pushed to the repo.
7
+
8
+ * Fixes resolveMx test by using example.com for a valid exchange.
9
+
1
10
  ### 7.1.0 (2021-01-05):
2
11
 
3
12
  * Fixed SQL traces being generated with invalid ID.
@@ -35,6 +35,7 @@ code, the source code can be found at [https://github.com/newrelic/node-newrelic
35
35
 
36
36
  * [@newrelic/proxy](#newrelicproxy)
37
37
  * [@newrelic/test-utilities](#newrelictest-utilities)
38
+ * [@octokit/rest](#octokitrest)
38
39
  * [JSV](#JSV)
39
40
  * [architect](#architect)
40
41
  * [benchmark](#benchmark)
@@ -73,7 +74,7 @@ code, the source code can be found at [https://github.com/newrelic/node-newrelic
73
74
 
74
75
  ### @grpc/grpc-js
75
76
 
76
- This product includes source derived from [@grpc/grpc-js](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js) ([v1.2.2](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js/tree/v1.2.2)), distributed under the [Apache-2.0 License](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js/blob/v1.2.2/LICENSE):
77
+ This product includes source derived from [@grpc/grpc-js](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js) ([v1.2.5](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js/tree/v1.2.5)), distributed under the [Apache-2.0 License](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js/blob/v1.2.5/LICENSE):
77
78
 
78
79
  ```
79
80
  Apache License
@@ -1752,23 +1753,41 @@ This product includes source derived from [@newrelic/test-utilities](https://git
1752
1753
 
1753
1754
  ```
1754
1755
 
1755
- ### JSV
1756
+ ### @octokit/rest
1756
1757
 
1757
- This product includes source derived from [JSV](https://github.com/garycourt/JSV) ([v4.0.2](https://github.com/garycourt/JSV/tree/v4.0.2)), distributed under the [FreeBSD License](https://github.com/garycourt/JSV/tree/v4.0.2#license):
1758
+ This product includes source derived from [@octokit/rest](https://github.com/octokit/rest.js) ([v18.0.15](https://github.com/octokit/rest.js/tree/v18.0.15)), distributed under the [MIT License](https://github.com/octokit/rest.js/blob/v18.0.15/LICENSE):
1758
1759
 
1759
1760
  ```
1760
- Copyright 2010 Gary Court. All rights reserved.
1761
+ The MIT License
1762
+
1763
+ Copyright (c) 2012 Cloud9 IDE, Inc. (Mike de Boer)
1764
+ Copyright (c) 2017-2018 Octokit contributors
1765
+
1766
+ Permission is hereby granted, free of charge, to any person obtaining a copy
1767
+ of this software and associated documentation files (the "Software"), to deal
1768
+ in the Software without restriction, including without limitation the rights
1769
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1770
+ copies of the Software, and to permit persons to whom the Software is
1771
+ furnished to do so, subject to the following conditions:
1772
+
1773
+ The above copyright notice and this permission notice shall be included in
1774
+ all copies or substantial portions of the Software.
1761
1775
 
1762
- Redistribution and use in source and binary forms, with or without modification, are
1763
- permitted provided that the following conditions are met:
1776
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1777
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1778
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1779
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1780
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1781
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1782
+ THE SOFTWARE.
1783
+
1784
+ ```
1764
1785
 
1765
- 1. Redistributions of source code must retain the above copyright notice, this list of
1766
- conditions and the following disclaimer.
1786
+ ### JSV
1767
1787
 
1768
- 2. Redistributions in binary form must reproduce the above copyright notice, this list
1769
- of conditions and the following disclaimer in the documentation and/or other materials
1770
- provided with the distribution.
1788
+ This product includes source derived from [JSV](https://github.com/garycourt/JSV) ([v4.0.2](https://github.com/garycourt/JSV/tree/v4.0.2)), distributed under the [FreeBSD License](https://github.com/garycourt/JSV/tree/v4.0.2#license):
1771
1789
 
1790
+ ```
1772
1791
  THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED
1773
1792
  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
1774
1793
  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR
@@ -0,0 +1,96 @@
1
+ 'use strict'
2
+
3
+ const fs = require('fs')
4
+ const github = require('./github')
5
+
6
+ const FILE_NAME = 'NEWS.md'
7
+ const PROPOSED_NOTES_HEADER = 'Proposed Release Notes'
8
+ const NEXT_VERSION_HEADER = '### vNext (TBD):'
9
+
10
+ async function generateReleaseNotes() {
11
+ try {
12
+ const latestRelease = await github.getLatestRelease()
13
+ console.log(`The latest release is: ${latestRelease.name} published: ${latestRelease.published_at}`)
14
+ console.log(`Tag: ${latestRelease.tag_name}, Target: ${latestRelease.target_commitish}`)
15
+
16
+ const tag = await github.getTagByName(latestRelease.tag_name)
17
+ console.log('The tag commit sha is: ', tag.commit.sha)
18
+
19
+ const commit = await github.getCommit(tag.commit.sha)
20
+ const commitDate = commit.commit.committer.date
21
+
22
+ console.log(`Finding merged pull requests since: ${commitDate}`)
23
+
24
+ const mergedPullRequests = await github.getMergedPullRequestsSince(commitDate)
25
+ console.log(`Found ${mergedPullRequests.length}`)
26
+
27
+ const releaseNoteData = mergedPullRequests.map((pr) => {
28
+ const parts = pr.body.split(/(?:^|\n)##\s*/g)
29
+ const {1: proposedReleaseNotes} = parts
30
+
31
+ const titleRemoved = proposedReleaseNotes.replace(PROPOSED_NOTES_HEADER, '')
32
+ return {
33
+ notes: titleRemoved,
34
+ url: pr.html_url
35
+ }
36
+ })
37
+
38
+ const finalData = releaseNoteData.reduce((result, currentValue) => {
39
+ result.notes += '\n\n' + currentValue.notes.trim()
40
+ result.links += `\n\n* PR: ${currentValue.url}\n`
41
+ return result
42
+ }, {
43
+ notes: '',
44
+ links: ''
45
+ })
46
+
47
+ console.log('Final data: ', JSON.stringify(finalData))
48
+
49
+ await updateReleaseNotes(FILE_NAME, finalData.notes)
50
+
51
+ console.log('*** [SUCCESS] ***')
52
+ } catch(err) {
53
+ console.log('! [FAILURE] !')
54
+ console.error(err)
55
+ }
56
+ }
57
+
58
+ function updateReleaseNotes(file, newNotes) {
59
+ const promise = new Promise((resolve, reject) => {
60
+ fs.readFile(file, 'utf8', function (err, data) {
61
+ if (err) {
62
+ return reject(err)
63
+ }
64
+
65
+ if (data.startsWith(NEXT_VERSION_HEADER)) {
66
+ const errMessage = [
67
+ `${file} already contains '${NEXT_VERSION_HEADER}'`,
68
+ 'Delete existing vNext release notes (if desired) and run again'
69
+ ].join('\n')
70
+
71
+ return reject(new Error(errMessage))
72
+ }
73
+
74
+ const newContent = [
75
+ NEXT_VERSION_HEADER,
76
+ newNotes,
77
+ '\n\n',
78
+ data
79
+ ].join('')
80
+
81
+ fs.writeFile(file, newContent, 'utf8', function (err) {
82
+ if (err) {
83
+ return reject(err)
84
+ }
85
+
86
+ console.log(`Added new release notes to ${file} under the ${NEXT_VERSION_HEADER}`)
87
+
88
+ resolve()
89
+ })
90
+ })
91
+ })
92
+
93
+ return promise
94
+ }
95
+
96
+ generateReleaseNotes()
package/bin/github.js ADDED
@@ -0,0 +1,106 @@
1
+ 'use strict'
2
+
3
+ const { Octokit } = require("@octokit/rest")
4
+
5
+ const repoOwner = 'newrelic'
6
+ const repository = 'node-newrelic'
7
+
8
+ if (!process.env.GITHUB_TOKEN) {
9
+ console.log('GITHUB_TOKEN recommended to be set in ENV')
10
+ }
11
+
12
+ const octokit = new Octokit({
13
+ auth: process.env.GITHUB_TOKEN,
14
+ })
15
+
16
+ async function getLatestRelease() {
17
+ const result = await octokit.repos.getLatestRelease({
18
+ owner: repoOwner,
19
+ repo: repository
20
+ })
21
+
22
+ return result.data
23
+ }
24
+
25
+ async function getTagByName(name) {
26
+ const perPage = 100
27
+
28
+ let pageNum = 1
29
+
30
+ let result = null
31
+ do {
32
+ result = await octokit.repos.listTags({
33
+ owner: repoOwner,
34
+ repo: repository,
35
+ per_page: perPage,
36
+ page: pageNum
37
+ })
38
+
39
+ const found = result.data.find((tag) => {
40
+ return tag.name === name
41
+ })
42
+
43
+ if (found) {
44
+ return found
45
+ }
46
+
47
+ pageNum++
48
+ } while (result.data.length === perPage) // there *might* be more data
49
+
50
+ return null
51
+ }
52
+
53
+ async function getCommit(sha) {
54
+ const result = await octokit.repos.getCommit({
55
+ owner: repoOwner,
56
+ repo: repository,
57
+ ref: sha
58
+ })
59
+
60
+ return result.data
61
+ }
62
+
63
+ async function getMergedPullRequestsSince(date) {
64
+ const perPage = 50
65
+
66
+ const comparisonDate = new Date(date)
67
+
68
+ let pageNum = 1
69
+ const mergedPullRequests = []
70
+ let result = null
71
+ let hadData = false
72
+
73
+ do {
74
+ result = await octokit.pulls.list({
75
+ owner: repoOwner,
76
+ repo: repository,
77
+ state: 'closed',
78
+ sort: 'updated',
79
+ direction: 'desc',
80
+ per_page: perPage,
81
+ page: pageNum
82
+ })
83
+
84
+ const mergedPrs = result.data.filter((pr) => {
85
+ return pr.merged_at && new Date(pr.merged_at) > comparisonDate
86
+ })
87
+
88
+ mergedPullRequests.push(...mergedPrs)
89
+ // Since we are going by 'updated' on query but merged on filter,
90
+ // there's a chance some boundaries are off. While in super extreme
91
+ // cases we could still miss some it is unlikely given we are grabbing
92
+ // large pages.
93
+ hadData = mergedPrs.length > 0
94
+
95
+ pageNum++
96
+ } while (result.data.length === perPage && hadData) // might be more in next batch
97
+
98
+ return mergedPullRequests
99
+ }
100
+
101
+ module.exports = {
102
+ getLatestRelease,
103
+ getTagByName,
104
+ getCommit,
105
+ getMergedPullRequestsSince
106
+ }
@@ -0,0 +1,66 @@
1
+ 'use strict'
2
+
3
+ /**
4
+ * Executed as a part of the "version" step of npm version.
5
+ * Updates the placeholder release note header with the incremented version
6
+ * from running npm version
7
+ */
8
+
9
+ const fs = require('fs')
10
+ const packageInfo = require('../package.json')
11
+
12
+ const FILE_NAME = 'NEWS.md'
13
+ const NEXT_VERSION_HEADER = '### vNext (TBD):'
14
+
15
+ const SUCCESS_MSG = '*** [SUCCESS] ***'
16
+ const FAIL_MSG = '! [FAILURE] !'
17
+
18
+ updateChangelogVersion()
19
+
20
+ async function updateChangelogVersion() {
21
+ try {
22
+ await updateHeader(FILE_NAME)
23
+
24
+ console.log(SUCCESS_MSG)
25
+ } catch (err) {
26
+ console.log(FAIL_MSG)
27
+ console.error(err)
28
+ }
29
+ }
30
+
31
+ function updateHeader(file) {
32
+ const promise = new Promise((resolve, reject) => {
33
+ fs.readFile(file, 'utf8', (err, data) => {
34
+ if (err) {
35
+ return reject(err)
36
+ }
37
+
38
+ // toISOString() will always return UTC time
39
+ const todayFormatted = new Date().toISOString().split('T')[0]
40
+ const version = `v${packageInfo.version}`
41
+ const newChangelogHeader = `### ${version} (${todayFormatted})`
42
+
43
+ console.log('Updating vNext header to: ', newChangelogHeader)
44
+
45
+ if (!data.startsWith(NEXT_VERSION_HEADER)) {
46
+ const err = new Error(`Failed to find next version header in form: '${NEXT_VERSION_HEADER}'`)
47
+ return reject(err)
48
+ }
49
+
50
+ const modified = data.replace(
51
+ NEXT_VERSION_HEADER,
52
+ newChangelogHeader
53
+ )
54
+
55
+ fs.writeFile(file, modified, 'utf8', (err) => {
56
+ if (err) {
57
+ return reject (err)
58
+ }
59
+
60
+ console.log(SUCCESS_MSG)
61
+ })
62
+ })
63
+ })
64
+
65
+ return promise
66
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "newrelic",
3
- "version": "7.1.0",
3
+ "version": "7.1.1",
4
4
  "author": "New Relic Node.js agent team <nodejs@newrelic.com>",
5
5
  "license": "Apache-2.0",
6
6
  "contributors": [
@@ -136,13 +136,15 @@
136
136
  "unit": "rm -f newrelic_agent.log && time tap --test-regex='(\\/|^test\\/unit\\/.*\\.test\\.js)$' --timeout=180 --no-coverage",
137
137
  "update-cross-agent-tests": "./bin/update-cats.sh",
138
138
  "versioned-tests": "./bin/run-versioned-tests.sh",
139
- "versioned": "npm run prepare-test && time ./bin/run-versioned-tests.sh"
139
+ "update-changelog-version": "node ./bin/update-changelog-version",
140
+ "versioned": "npm run prepare-test && time ./bin/run-versioned-tests.sh",
141
+ "version": "npm run update-changelog-version && git add ./NEWS.md"
140
142
  },
141
143
  "bin": {
142
144
  "newrelic-naming-rules": "./bin/test-naming-rules.js"
143
145
  },
144
146
  "dependencies": {
145
- "@grpc/grpc-js": "1.2.2",
147
+ "@grpc/grpc-js": "^1.2.5",
146
148
  "@grpc/proto-loader": "^0.5.5",
147
149
  "@newrelic/aws-sdk": "^3.0.0",
148
150
  "@newrelic/koa": "^5.0.0",
@@ -161,6 +163,8 @@
161
163
  "devDependencies": {
162
164
  "@newrelic/proxy": "^2.0.0",
163
165
  "@newrelic/test-utilities": "^5.0.0",
166
+ "@octokit/rest": "^18.0.15",
167
+ "JSV": "~4.0.2",
164
168
  "architect": "*",
165
169
  "benchmark": "^2.1.4",
166
170
  "bluebird": "^3.4.7",
@@ -173,7 +177,6 @@
173
177
  "got": "^8.0.1",
174
178
  "http-errors": "^1.7.3",
175
179
  "jsdoc": "^3.6.3",
176
- "JSV": "~4.0.2",
177
180
  "memcached": ">=0.2.8",
178
181
  "minami": "^1.1.1",
179
182
  "mongodb": "^3.3.3",
@@ -1,18 +1,18 @@
1
1
  {
2
- "lastUpdated": "Tue Jan 05 2021 10:10:23 GMT-0800 (Pacific Standard Time)",
2
+ "lastUpdated": "Mon Feb 01 2021 09:58:16 GMT-0800 (Pacific Standard Time)",
3
3
  "projectName": "New Relic Node Agent",
4
4
  "projectUrl": "https://github.com/newrelic/node-newrelic",
5
5
  "includeDev": true,
6
6
  "dependencies": {
7
- "@grpc/grpc-js@1.2.2": {
7
+ "@grpc/grpc-js@1.2.5": {
8
8
  "name": "@grpc/grpc-js",
9
- "version": "1.2.2",
10
- "range": "1.2.2",
9
+ "version": "1.2.5",
10
+ "range": "^1.2.5",
11
11
  "licenses": "Apache-2.0",
12
12
  "repoUrl": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",
13
- "versionedRepoUrl": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js/tree/v1.2.2",
13
+ "versionedRepoUrl": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js/tree/v1.2.5",
14
14
  "licenseFile": "node_modules/@grpc/grpc-js/LICENSE",
15
- "licenseUrl": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js/blob/v1.2.2/LICENSE",
15
+ "licenseUrl": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js/blob/v1.2.5/LICENSE",
16
16
  "licenseTextSource": "file",
17
17
  "publisher": "Google Inc."
18
18
  },
@@ -184,6 +184,17 @@
184
184
  "publisher": "New Relic Node.js agent team",
185
185
  "email": "nodejs@newrelic.com"
186
186
  },
187
+ "@octokit/rest@18.0.15": {
188
+ "name": "@octokit/rest",
189
+ "version": "18.0.15",
190
+ "range": "^18.0.15",
191
+ "licenses": "MIT",
192
+ "repoUrl": "https://github.com/octokit/rest.js",
193
+ "versionedRepoUrl": "https://github.com/octokit/rest.js/tree/v18.0.15",
194
+ "licenseFile": "node_modules/@octokit/rest/LICENSE",
195
+ "licenseUrl": "https://github.com/octokit/rest.js/blob/v18.0.15/LICENSE",
196
+ "licenseTextSource": "file"
197
+ },
187
198
  "JSV@4.0.2": {
188
199
  "name": "JSV",
189
200
  "version": "4.0.2",