Skip to content

Upgrade Faraday lib to 2.9.0#36

Closed
soareswallace wants to merge 1 commit into
mainfrom
upgrade-faraday-lib-2.9.0
Closed

Upgrade Faraday lib to 2.9.0#36
soareswallace wants to merge 1 commit into
mainfrom
upgrade-faraday-lib-2.9.0

Conversation

@soareswallace
Copy link
Copy Markdown

No description provided.

Comment thread lib/incognia_api/client.rb Fixed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR upgrades the Faraday HTTP client library from version 1.10 to 2.9.0, modernizing the gem's HTTP handling capabilities. The upgrade requires significant changes to adapt to Faraday v2's breaking changes, including new middleware structure and API modifications.

Key changes:

  • Updated Faraday dependency from ~> 1.10 to >= 2.9.0, < 3.0
  • Replaced deprecated faraday_middleware with separate faraday-multipart and faraday-retry gems
  • Refactored authentication and connection setup to use Faraday v2 APIs

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
incognia_api.gemspec Updates Faraday dependency to v2.9.0 and adds new middleware gems
lib/incognia_api/client.rb Refactors HTTP client to use Faraday v2 APIs with manual auth header construction
lib/incognia_api/api.rb Updates require statements to use new Faraday middleware gems
fixtures/vcr_cassettes/token.yml Updates test fixtures to reflect new Faraday version in User-Agent headers

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +61 to +59
r.body = {
client_id: Incognia.config.client_id,
client_secret: Incognia.config.client_secret,
grant_type: "client_credentials"
}
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting r.body to a hash will not work correctly with the URL-encoded content type. The body should be URL-encoded string format or use Faraday's form encoding. Consider using URI.encode_www_form or let Faraday handle the encoding by using the :url_encoded request middleware properly.

Copilot uses AI. Check for mistakes.
@soareswallace soareswallace force-pushed the upgrade-faraday-lib-2.9.0 branch 5 times, most recently from e49317d to 9f8311a Compare September 18, 2025 13:28
@soareswallace soareswallace force-pushed the upgrade-faraday-lib-2.9.0 branch from 9f8311a to 9d40f30 Compare September 18, 2025 13:38
@IanGabriel12
Copy link
Copy Markdown
Contributor

Closing as this is already being addressed in: #37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants