Skip to content
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

Merged
merged 29 commits into from
Feb 24, 2022
Merged

feat: debugging support #446

merged 29 commits into from
Feb 24, 2022

Conversation

kanadgupta
Copy link
Member

@kanadgupta kanadgupta commented Feb 23, 2022

🧰 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).

image

🧬 QA & Testing

No functional changes beyond migrating isGHA() into its own file and enhancing the logging in bin/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

  1. 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 😞

@kanadgupta kanadgupta added this to the v6.5 milestone Feb 23, 2022
@kanadgupta kanadgupta added the enhancement New feature or request label Feb 24, 2022
@kanadgupta kanadgupta marked this pull request as ready for review February 24, 2022 03:07
@kanadgupta kanadgupta requested a review from erunion February 24, 2022 03:08
Copy link
Member

@erunion erunion left a 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.

bin/rdme Outdated Show resolved Hide resolved
* @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';
Copy link
Member

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

kanadgupta and others added 2 commits February 24, 2022 09:51
Co-authored-by: Jon Ursenbach <[email protected]>
Use ci-info package here instead!

Feedback: #446 (comment)
Co-Authored-By: Jon Ursenbach <[email protected]>
@kanadgupta
Copy link
Member Author

Can you add a bit to the README about how to generate these debugging messages? Will be helpful for support folks to know about.

@erunion it's on my list of outstanding items for #439!

This reverts commit 1d2fad0.
@kanadgupta
Copy link
Member Author

@erunion any other feedback besides docs? I've already started drafting some in my #439 branch

@kanadgupta kanadgupta requested a review from erunion February 24, 2022 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants