Updated method template to include a warning for undocumented endpoints#185
Updated method template to include a warning for undocumented endpoints#185aviflombaum wants to merge 2 commits intoslack-ruby:masterfrom
Conversation
|
I updated the method template to include a warning to the logger for undocumented methods, wasn't quite sure how to test this as everything is autogenerated, but I was able to see the warning log happen when using this client. I'd imagine the test might be on something like the method_spec template adding a new test that |
Generated by 🚫 danger |
There was a problem hiding this comment.
Good start! First, this needs tests, please. LMK if you need help coding those.
Second if you use a method a lot you're going to flood logs, so we need a way to silence the logger for these. At the very least a global configuration to turn this off. Ideally the warning should appear once per method, too.
| @@ -1,6 +1,6 @@ | |||
| ### 0.11.1 (Next) | |||
|
|
|||
| * Your contribution here. | |||
| options = options.merge(user: users_id(options)['user']['id']) if options[:user] | ||
| <% end %> | ||
| <% if data['undocumented'] %> | ||
| logger.warn('<%= group %>.<%= name %> is an undocumented API endpoint.') |
There was a problem hiding this comment.
Maybe "The <%= group %>.<%= name %> method is undocumented."
|
I'm mostly confused as to where to code the tests - should I alter the I'll look until a silence option on the Will clean it up and squash commits too. |
|
You could just add specs into https://github.com/slack-ruby/slack-ruby-client/blob/master/spec/slack/web/client_spec.rb or add an undocumented_spec.rb picking one of the undocumented methods and ensuring |
|
Closing in favor of #197. @aviflombaum Take a look, is that what you had in mind? Make comments on that issue. |
No description provided.