-
Notifications
You must be signed in to change notification settings - Fork 45
chore: rename nodereport to node-report #37
Conversation
@gdams the hyphen is not allowed in C variable or macro names, so the project won't build as-is. For example, NODEREPORT_VERSION will need to change to perhaps NODE_REPORT_VERSION, not node-report_VERSION. Ditto C variables and the environment variables. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this was a global search and replace. It's left very ugly looking function/variable names, e.g. Processnode-reportFileName
has replaced ProcessNodeReportFileName
.
@@ -21,7 +21,7 @@ | |||
}], | |||
], | |||
"defines": [ | |||
'NODEREPORT_VERSION="<!(node -p \"require(\'./package.json\').version\")"' | |||
'node-report_VERSION="<!(node -p \"require(\'./package.json\').version\")"' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please either revert this, or upper case. I don't believe -
is a valid character for C/C++ macro names.
@@ -1,7 +1,7 @@ | |||
2016-12-12, Version 1.0.7 | |||
========================= | |||
|
|||
* Fix version reporting in NodeReport section (Richard Lau) | |||
* Fix version reporting in node-report section (Richard Lau) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should rename in the history -- It was correct at the time.
@@ -23,7 +23,7 @@ | |||
|
|||
* Fix for failure in fatal error (OOM) test (Richard Chamberlain) | |||
|
|||
* Add support for nodereport on AIX (Richard Chamberlain) | |||
* Add support for node-report on AIX (Richard Chamberlain) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should rename in the history -- It was correct at the time.
-------------------------------------------------- | ||
|
||
*nodereport contributors listed at <https://github.com/nodejs/nodereport/blob/master/AUTHORS>* | ||
*node-report contributors listed at <https://github.com/nodejs/node-report/blob/master/AUTHORS>* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're updating this file, https://github.com/nodejs/nodereport/blob/master/AUTHORS no longer exists (it was removed by #13).
export node-report_FILENAME=stdout|stderr|<filename> | ||
export node-report_DIRECTORY=<full path> | ||
export node-report_COREDUMP=yes|no | ||
export node-report_VERBOSE=yes|no |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to keep the environment variables case (upper), probably without the hyphen.
// NODEREPORT_EVENTS env var overrides the defaults | ||
const options = process.env.NODEREPORT_EVENTS || 'exception+fatalerror+signal+apicall'; | ||
// node-report_EVENTS env var overrides the defaults | ||
const options = process.env.node-report_EVENTS || 'exception+fatalerror+signal+apicall'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to keep the environment variables case (upper), probably without the hyphen.
7a9cf0d
to
9d757a2
Compare
* Verbose mode | ||
******************************************************************************/ | ||
unsigned int ProcessNodeReportEvents(const char* args) { | ||
unsigned int ProcessProcessNode_ReportEvents(const char* args) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra Process
. Doesn't match the call in src/module.cc
.
I'd like a second opinion on the function name changes in the C++ code -- I'm finding it much harder to read. When I see |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't have to change the js and c++ symbol names, and many of the name changes are syntactically invalid. The env var names don't need changing, either. A number of comments refer to a report as a "NodeReport", which was weird to begin with, just call it a "report", which is better wording, and robust to module name changes. A bunch of other comments unnecessarily name the module, just remove that part of the comment. Any reader of the code surely knows the module the code is part of! Or can find out easily if they are really confused.
application. | ||
|
||
```js | ||
var nodereport = require('nodereport'); | ||
nodereport.triggerReport(); | ||
var node-report = require('node-report'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is syntactically invalid javascript, you need to be more discerning in your search and replace. revert it to the original.
export NODEREPORT_DIRECTORY=<full path> | ||
export NODEREPORT_COREDUMP=yes|no | ||
export NODEREPORT_VERBOSE=yes|no | ||
export NODE_REPORT_EVENTS=exception+fatalerror+signal+apicall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These don't have to be changed. Its the module name that is punctuated, we don't have to punctuate the env var names
``` | ||
|
||
## Examples | ||
|
||
To see examples of NodeReports generated from these events you can run the | ||
demonstration applications provided in the nodereport github repository. These are | ||
To see examples of node-reports generated from these events you can run the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"of reports generated"
To see examples of NodeReports generated from these events you can run the | ||
demonstration applications provided in the nodereport github repository. These are | ||
To see examples of node-reports generated from these events you can run the | ||
demonstration applications provided in the node-report github repository. These are |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"in the github repository"
2. `exception.js` - NodeReport triggered by unhandled exception. | ||
3. `fatalerror.js` - NodeReport triggered by fatal error on JavaScript heap out of memory. | ||
4. `loop.js` - looping application, NodeReport triggered using kill `-USR2 <pid>`. | ||
1. `api.js` - node-report triggered by JavaScript API call. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for all s/node-report/report/
|
||
const api = require('./api'); | ||
|
||
// NODEREPORT_EVENTS env var overrides the defaults | ||
const options = process.env.NODEREPORT_EVENTS || 'exception+fatalerror+signal+apicall'; | ||
// NODE_REPORT_EVENTS env var overrides the defaults |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert, unnecessary to change this
@@ -1,7 +1,7 @@ | |||
#include "node_report.h" | |||
#include <nan.h> | |||
|
|||
namespace nodereport { | |||
namespace node-report { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid, revert to original
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think every change in this file pretty much, except maybe some comments, can be reverted as unnecessary (and won't compile).
@@ -241,26 +241,26 @@ static int StartWatchdogThread(void* (*thread_main)(void* unused)) { | |||
pthread_sigmask(SIG_SETMASK, &sigmask, nullptr); | |||
pthread_attr_destroy(&attr); | |||
if (err != 0) { | |||
fprintf(stderr, "nodereport: StartWatchdogThread pthread_create() failed: %s\n", strerror(err)); | |||
fprintf(stderr, "node-report: StartWatchdogThread pthread_create() failed: %s\n", strerror(err)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change is one of the few that should stay, because it names the module
inline void* ReportSignalThreadMain(void* unused) { | ||
for (;;) { | ||
uv_sem_wait(&report_semaphore); | ||
if (nodereport_verbose) { | ||
fprintf(stdout, "nodereport: signal %s received\n", node::signo_string(report_signal)); | ||
if (node-report_verbose) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't need this line
if (nodereport_verbose) { | ||
fprintf(stdout, "nodereport: signal %s received\n", node::signo_string(report_signal)); | ||
if (node-report_verbose) { | ||
fprintf(stdout, "node-report: signal %s received\n", node::signo_string(report_signal)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do need this line. etc.
Superseded by #43. |
This changes nodereport to node-report