Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c4a357d

Browse filesBrowse files
cjihrigtargos
authored andcommitted
report: add report versioning
This commit adds a version to the diagnostic report feature. PR-URL: #28121 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
1 parent db65594 commit c4a357d
Copy full SHA for c4a357d

File tree

Expand file treeCollapse file tree

3 files changed

+6
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+6
-2
lines changed
Open diff view settings
Collapse file

‎doc/api/report.md‎

Copy file name to clipboardExpand all lines: doc/api/report.md
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ is provided below for reference.
2222
```json
2323
{
2424
"header": {
25+
"reportVersion": 1,
2526
"event": "exception",
2627
"trigger": "Exception",
2728
"filename": "report.20181221.005011.8974.0.001.json",
Collapse file

‎src/node_report.cc‎

Copy file name to clipboardExpand all lines: src/node_report.cc
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
extern char** environ;
2525
#endif
2626

27+
constexpr int NODE_REPORT_VERSION = 1;
2728
constexpr int NANOS_PER_SEC = 1000 * 1000 * 1000;
2829
constexpr double SEC_PER_MICROS = 1e-6;
2930

@@ -172,7 +173,7 @@ static void WriteNodeReport(Isolate* isolate,
172173
JSONWriter writer(out);
173174
writer.json_start();
174175
writer.json_objectstart("header");
175-
176+
writer.json_keyvalue("reportVersion", NODE_REPORT_VERSION);
176177
writer.json_keyvalue("event", message);
177178
writer.json_keyvalue("trigger", trigger);
178179
if (!filename.empty())
Collapse file

‎test/common/report.js‎

Copy file name to clipboardExpand all lines: test/common/report.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ function _validateContent(data) {
6363
'nodejsVersion', 'wordSize', 'arch', 'platform',
6464
'componentVersions', 'release', 'osName', 'osRelease',
6565
'osVersion', 'osMachine', 'cpus', 'host',
66-
'glibcVersionRuntime', 'glibcVersionCompiler', 'cwd'];
66+
'glibcVersionRuntime', 'glibcVersionCompiler', 'cwd',
67+
'reportVersion'];
6768
checkForUnknownFields(header, headerFields);
69+
assert.strictEqual(header.reportVersion, 1); // Increment as needed.
6870
assert.strictEqual(typeof header.event, 'string');
6971
assert.strictEqual(typeof header.trigger, 'string');
7072
assert(typeof header.filename === 'string' || header.filename === null);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.