octokit / octokit.rb

Ruby toolkit for the GitHub API
http://octokit.github.io/octokit.rb/
MIT License
3.83k stars 1.13k forks source link

[BUG]: `faraday-multipart` warning always printed #1701

Open dentarg opened 2 weeks ago

dentarg commented 2 weeks ago

What happened?

Since https://github.com/octokit/octokit.rb/pull/1688 (https://github.com/octokit/octokit.rb/commit/cff7c55bffc312f6ee3c9ceedb8b7929f07cef1d) octokit.rb always prints a warning if it can't load faraday-multipart. From the warning, it sounds like I don't need faraday-multipart unless I upload licenses. It would be great if the warning was only printed if I tried to do that; or that I could silence the warning somehow.

Versions

octokit.rb v9.0.0 and up

Relevant log output

$ bundle exec ruby -roctokit -e 'p Octokit::VERSION'
To use multipart middleware with Faraday v2.0+, install `faraday-multipart` gem; note: this is used by the ManageGHES client for uploading licenses
"9.1.0"

Code of Conduct

github-actions[bot] commented 2 weeks ago

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

willnet commented 3 hours ago

It would be ideal if we could delay the warning until it becomes necessary. However, if you just want to suppress the warning for now, it seems you can use ENV['OCTOKIT_SILENT'].

https://github.com/octokit/octokit.rb/blob/c1a9cb779bc31702ea398bce840c92ad87b9ade6/lib/octokit/warnable.rb#L13