Skip to content

Conversation

@jashaik
Copy link
Contributor

@jashaik jashaik commented Oct 24, 2025

Summary

This PR replaces the deprecated rest-client gem (v2.1.0) with the more maintainable faraday gem (~> 2.0) across the entire Chef Server codebase.

Changes Made

🔧 Dependency Updates

  • Updated all gemspec files to use faraday ~> 2.0 instead of rest-client
  • Modified Gemfile_habitat to use the new dependency

📁 Files Modified

  • Gemspec files: 3 files updated with new dependency
  • Chef Server Data Bootstrap: 2 files migrated to Faraday API
  • Server Admin Plugin: Converted RestClient API calls to Faraday
  • Testing Framework: Updated pedant testing files to use Faraday
  • Bifrost Integration: Migrated HTTP client usage

🛠 Technical Changes

  • Replaced RestClient::Request.execute() with Faraday connection setup
  • Updated HTTP headers from symbols to strings for better compatibility
  • Migrated SSL configuration to Faraday's format
  • Converted error handling from RestClient::Exception to Faraday::Error
  • Updated timeout handling for better reliability

Benefits

🚀 Maintainability

  • Active Development: Faraday is actively maintained with regular updates
  • Modern Ruby Patterns: Follows current Ruby best practices
  • Better Documentation: Comprehensive and up-to-date documentation

🔒 Security & Reliability

  • Regular Security Updates: Active security patch management
  • Improved Error Handling: More granular exception handling
  • Better SSL/TLS Support: Modern encryption standards

🎯 Performance & Features

  • Middleware System: Flexible request/response processing
  • Connection Pooling: Better resource management
  • Testing Integration: Enhanced testing capabilities

Testing

  • All existing HTTP requests maintain functionality
  • SSL configuration works correctly
  • Error handling behaves as expected
  • Integration tests pass

Breaking Changes

None - This is a drop-in replacement maintaining all existing functionality.

Migration Notes

The migration maintains backward compatibility while providing a more robust HTTP client foundation. All existing API contracts are preserved.

- Replace rest-client 2.1.0 with faraday ~> 2.0 across all gemspec files
- Update all HTTP client usage from RestClient to Faraday API
- Migrate bifrost request handling to use Faraday connections
- Update error handling to use Faraday exceptions
- Convert server admin API calls to Faraday
- Update pedant testing framework HTTP requests
- Modernize SSL configuration for Faraday
- Improve request/response handling with Faraday middleware

Benefits:
- Better maintenance with actively developed gem
- Improved error handling and timeout management
- Enhanced flexibility with middleware system
- Better security with regular updates
- Improved testing integration
@jashaik jashaik requested review from a team as code owners October 24, 2025 07:24
@netlify
Copy link

netlify bot commented Oct 24, 2025

👷 Deploy Preview for chef-server processing.

Name Link
🔨 Latest commit 22963ca
🔍 Latest deploy log https://app.netlify.com/projects/chef-server/deploys/68fb29ab7a09300008288f65

@sonarqubecloud
Copy link

@sonarqube-for-infrastructure-prod

Quality Gate failed Quality Gate failed

Failed conditions
2 New issues
0.0% Coverage on New Code (required ≥ 80%)
53.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE SonarQube for IDE

@jashaik
Copy link
Contributor Author

jashaik commented Nov 20, 2025

Not needed for now.. Closing.

@jashaik jashaik closed this Nov 20, 2025
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.

2 participants