-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print diagnose report from CLI #401
Conversation
a3bd76b
to
4fc72f5
Compare
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.
Nice!
While performing the daily checks some issues were found with this Pull Request.
|
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.
Great on the human friendly output! Could you add a separate changeset for the updated output?
I notice some duplicate commits from #402 merged into main in this PR as well. Does it need a rebase?
Will the diagnose_tests repo also test the JSON payload in the future?
@@ -61,6 +61,7 @@ export const JS_TO_RUBY_MAPPING: { [key: string]: string } = { | |||
debug: "debug", | |||
log: "log", | |||
logPath: "log_path", | |||
logFilePath: "log_file_path", |
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.
Is this line what adds it to the diagnose report as a config option? Because we shouldn't include it as a config option in the sent report, it's a config option users can directly set (only through the logPath config option). The path itself is already part of the paths section which that contains more details.
What I see in a sent 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 line was added because the diagnose command uses the JS_TO_RUBY_MAPPING
object to fetch the names for each field. Because there was no name for the logFilePath
field, it printed undefined: '/tmp/appsignal.log'
before this change.
In Ruby, the log_path and log_file_path aren't printed in the configuration at all.I'll update the test in diagnose_tests to make sure this isn't the case in Node.js either, so we can remove this line again.
.semaphore/semaphore.yml
Outdated
- cache restore packages-$SEMAPHORE_GIT_SHA-$SEMAPHORE_GIT_BRANCH-v$NODE_VERSION | ||
- git submodule init | ||
- git submodule update | ||
- LANGUAGE=nodejs test/integration/diagnose/bin/test |
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.
Can we disable the debug mode in the diagnose tests now? I see a lot of debug output there.
@jeffkreeftmeijer we'll need to rebase this on the build matrix. Let me know if you need help with that. |
@tombruijn I’m working on some support issues today, so it would be nice if you could pick this up. If you don’t have time, I’ll do it early next week. |
diagnose: | ||
- git submodule init | ||
- git submodule update | ||
- LANGUAGE=nodejs test/integration/diagnose/bin/test |
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.
@jeffkreeftmeijer I've rebased this branch on the build matrix. I've added the diagnose tests as an "extra test" for the node.js package so it gets run for every node.js version as well.
6797c84
to
8d9b7bf
Compare
8d9b7bf
to
ce945db
Compare
I’ve updated this pull request to remove the |
console.log(`Validation`) | ||
console.log( | ||
` Validating Push API key: ${this.colorize( | ||
data["validation"]["push_api_key"] |
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.
Not sure if it's in scope but I noticed that this output isn't accurate.
Given this config output (with an undefined push_api_key, which I also don't know if we should print it as undefined
):
Configuration
...
push_api_key: undefined
I get this validation:
Validation
Validating Push API key: valid
See also the admin view of this report: https://appsignal.com/admin/diagnose_reports/60e41eb35ac13f2d186f711f
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.
That should be caused by #408, which causes the result to return “valid” for any input. I’ve created a separate issue to fix that to make sure this moves along.
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.
See previous comments, GitHub still shows me I have approved it 🤷♂️
Co-authored-by: Tom de Bruijn <[email protected]>
Can you add a changeset for this PR? Something about diagnose report improvements. |
In order to get the CLI diagnose command up to speed with the output from the Ruby and Elixir integrations, we created https://github.com/appsignal/diagnose_tests, which is an specification that describes the desired output to use as a guide and check for the diagnose output. It's modeled after the diagnose command in Ruby, and will eventually be used to test and develop diagnose commands for all integrations.
This patch introduces diagnose_tests to the Node.js library, and implements a new diagnose command that matches the specification. Because of differences in the generated JSON reports, the diagnose output in the Node.js library is not an exact match with the Ruby integration. For those cases, the diagnose_tests specification has specific assertions for the Node.js. The goal is to eventually get rid of those, but we’re cutting this project here to be able to ship the new diagnose now, and have it checked on CI going forward.
Note: this patch depends on #402