-
Notifications
You must be signed in to change notification settings - Fork 43
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
feat: debugging support #446
Conversation
This installs a couple packages and sets up a logger for usage in normal and GHA environments
can't wait to use optional chaining lol
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 you add a bit to the README about how to generate these debugging messages? Will be helpful for support folks to know about.
* @link https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables | ||
*/ | ||
module.exports = function isGHA() { | ||
return process.env.GITHUB_ACTIONS === 'true'; |
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 can replace this with the ci-info library I'm pulling in for RM-3621 to do require('ci-info').GITHUB_ACTIONS
. That checks the GITHUB_ACTIONS
env variable and also has awareness if it's part of a pull request.
https://github.com/watson/ci-info/blob/master/vendors.json#L93-L96
Co-authored-by: Jon Ursenbach <[email protected]>
Use ci-info package here instead! Feedback: #446 (comment) Co-Authored-By: Jon Ursenbach <[email protected]>
This reverts commit 1d2fad0.
🧰 Changes
Commands that now have debugging
login
logout
whoami
openapi
validate
swagger
docs
docs:edit
versions
versions:create
versions:update
versions:delete
oas
open
Helper functions that now have debugging
fetch()
handleRes()
Obviously there are many other helper functions, but these are the only ones that felt necessary.
Additionally, I made a small enhancement to
bin/rdme
to output errors via the native GitHub Action annotation format so they're properly surfaced. You can see an example of this in this workflow run (and in the image below1).🧬 QA & Testing
No functional changes beyond migrating
isGHA()
into its own file and enhancing the logging inbin/rdme
(the results of which you can see in the annotation example above). Do tests pass? And can you see debug logs on this workflow run?Fixes RM-3451, RM-3544
Footnotes
Yes, the "Process completed with exit code 1" error is excessive and is bugging me as well, and no, I don't know how to get rid of it... I think this is an unfortunate by-product of going with the composite action route 😞 ↩