Skip to content

Commit

Permalink
Begin v2 release (#1297)
Browse files Browse the repository at this point in the history
* Update UPGRADING.md to highlight adapters being moved out
* Cleanup tests
* Cleanup Gemfile
* Update CI
  • Loading branch information
iMacTia committed Aug 1, 2021
1 parent a089fb8 commit 6333b73
Show file tree
Hide file tree
Showing 15 changed files with 68 additions and 418 deletions.
33 changes: 11 additions & 22 deletions .github/workflows/ci.yml
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:

push:
branches: [main, 0.1x]
branches: [main, 1.x, 0.1x]

env:
GIT_COMMIT_SHA: ${{ github.sha }}
Expand All @@ -14,27 +14,24 @@ env:
jobs:
linting:
runs-on: ubuntu-latest
env:
BUNDLE_WITH: lint
BUNDLE_WITHOUT: development:test

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2

- name: Set up Ruby 2.7
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true

- name: Rubocop
run: |
gem install bundler
bundle config set without 'development test'
bundle config set with 'lint'
bundle install
bundle exec rubocop --format progress
run: bundle exec rubocop --format progress

- name: Yard-Junk
run: |
gem install yard-junk --no-document
yard-junk --path lib
run: bundle exec yard-junk --path lib

build:
needs: [linting]
Expand All @@ -43,22 +40,14 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ['2.4', '2.5', '2.6', '2.7', '3.0']
ruby: ['2.6', '2.7', '3.0']

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}

- name: Install dependencies
run: |
sudo apt-get install libcurl4-openssl-dev
- name: Build
run: |
gem install bundler -v '<2'
bundle install --jobs 4 --retry 3
bundler-cache: true

- name: Test
continue-on-error: ${{ matrix.experimental }}
Expand Down
18 changes: 6 additions & 12 deletions .github/workflows/publish.yml
Expand Up @@ -10,20 +10,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- uses: actions/checkout@v2

- name: Set up Ruby 2.6
- name: Set up Ruby 2.7
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
ruby-version: 2.7

- name: Publish to RubyGems
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build faraday.gemspec
gem push faraday-*.gem
env:
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
uses: dawidd6/action-publish-gem@v1
with:
api_key: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
33 changes: 11 additions & 22 deletions Gemfile
Expand Up @@ -2,39 +2,28 @@

source 'https://rubygems.org'

ruby RUBY_VERSION

# Even though we don't officially support JRuby, this dependency makes Faraday
# compatible with it, so we're leaving it in for jruby users to use it.
gem 'jruby-openssl', '~> 0.10.7', platforms: :jruby

group :development, :test do
gem 'coveralls_reborn', require: false
gem 'multipart-parser'
gem 'pry'
gem 'rack', '~> 2.2'
gem 'rake'
gem 'rspec', '~> 3.7'
gem 'rspec_junit_formatter', '~> 0.4'
gem 'simplecov'
gem 'webmock', '~> 3.4'
end

group :lint, :development do
group :development, :lint do
gem 'rubocop', '~> 0.90.0'
gem 'rubocop-inclusivity', '~> 1.0'
gem 'rubocop-packaging', '~> 0.5'
gem 'rubocop-performance', '~> 1.0'
end

group :test, :development do
gem 'coveralls_reborn', require: false
gem 'em-http-request', '>= 1.1', require: 'em-http', platform: :ruby
gem 'em-synchrony', '>= 1.0.3', require: %w[em-synchrony em-synchrony/em-http], platform: :ruby
gem 'excon', '>= 0.27.4'
gem 'httpclient', '>= 2.2'
gem 'multipart-parser'
# TODO: remove this once v4 is released
options = (RUBY_VERSION.start_with?('3') ? { github: 'grosser/net-http-persistent', branch: 'grosser/spec' } : {})
gem 'net-http-persistent', '>= 3.0', **options
gem 'patron', '>= 0.4.2', platforms: :ruby
gem 'rack-test', '>= 0.6', require: 'rack/test'
gem 'rspec', '~> 3.7'
gem 'rspec_junit_formatter', '~> 0.4'
gem 'simplecov'
gem 'typhoeus', '~> 1.4'
gem 'webmock', '~> 3.4'
gem 'yard-junk'
end

gemspec
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -16,10 +16,10 @@ Need more details? See the [Faraday API Documentation][apidoc] to see how it wor

## Supported Ruby versions

This library aims to support and is [tested against][actions] the following Ruby
implementations:

* Ruby 2.4+
This library aims to support and is [tested against][actions] the currently officially supported Ruby
implementations. This means that, even without a major release, we could add or drop support for Ruby versions,
following their [EOL](https://endoflife.date/ruby).
Currently that means we support Ruby 2.6+

If something doesn't work on one of these Ruby versions, it's a bug.

Expand Down
32 changes: 32 additions & 0 deletions UPGRADING.md
@@ -1,6 +1,38 @@
## Faraday 2.0

### Adapters have moved!

With this release, we've officially moved all adapters out of Faraday.
What that means, is that they won't be available out-of-the-box anymore,
and you'll instead need to add them to your Gemfile.

#### Why was this decision made?

We've taken this decision for the following technical reasons:

* We wanted the Faraday gem to focus on providing a clean, standardized, middleware-stack-based API.
* We wanted to free the core team from maintaining all the different adapters, relying more on the community to
maintain them based on the broad interest. This will allow the core team to focus on implementing features
focused on the Faraday API more quickly, without having to push it on all adapters immediately.
* With the community creating more and more adapters, we wanted to avoid having first and second-class adapters
by having some of them included with the gem and others available externally.
* Moving adapters into separate gems allow to solve the dependency issues once and for all.
Faraday will remain a dependency-free gem, while adapter gems will be able to automatically pull
any necessary dependency, without having to rely on the developer to do so.

#### So what will this mean for me?

We did our best to make this transition as painless as possible for you, so here is what we did.

* All adapters have already been moved out and released as separate gems.
They've then been re-added into Faraday's dependencies so that you wouldn't notice.
This means that immediately after v2.0 will be released, all the adapters that were previously available will be
already compatible with Faraday 2.0!
* We've setup an [Awesome Faraday](https://github.com/lostisland/awesome-faraday) repository, where you can find and discover adapters.
We also highlighted their unique features and level of compliance with Faraday's features.

### Others

* Rename `Faraday::Request#method` to `#http_method`.

## Faraday 1.0
Expand Down
11 changes: 0 additions & 11 deletions lib/faraday.rb
Expand Up @@ -27,17 +27,6 @@
require 'faraday/file_part'
require 'faraday/param_part'

unless defined?(JRUBY_VERSION)
require 'faraday/em_http'
require 'faraday/em_synchrony'
end
require 'faraday/excon'
require 'faraday/httpclient'
require 'faraday/net_http'
require 'faraday/net_http_persistent'
require 'faraday/patron'
require 'faraday/rack'

# This is the main namespace for Faraday.
#
# It provides methods to create {Connection} objects, and HTTP-related
Expand Down
49 changes: 0 additions & 49 deletions spec/faraday/adapter/em_http_spec.rb

This file was deleted.

18 changes: 0 additions & 18 deletions spec/faraday/adapter/em_synchrony_spec.rb

This file was deleted.

49 changes: 0 additions & 49 deletions spec/faraday/adapter/excon_spec.rb

This file was deleted.

0 comments on commit 6333b73

Please sign in to comment.