From 0a4673256e5a82c81f54288c25cb7f700d51fc76 Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 1 Jan 2024 19:03:40 +0100 Subject: [PATCH 1/3] Add ruby 3.3 to edge and test flows Update actions/checkout to v4 Remove a spec not related to endpoint method missing --- .github/workflows/danger.yml | 2 +- .github/workflows/edge.yml | 4 ++-- .github/workflows/test.yml | 8 ++++---- docker-compose.yml | 5 +++-- spec/grape/endpoint_spec.rb | 11 ----------- 5 files changed, 10 insertions(+), 20 deletions(-) diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml index dffe84d15a..5e99cbf53b 100644 --- a/.github/workflows/danger.yml +++ b/.github/workflows/danger.yml @@ -6,7 +6,7 @@ jobs: danger: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 100 - name: Set up Ruby diff --git a/.github/workflows/edge.yml b/.github/workflows/edge.yml index bea28ef249..c617da14e1 100644 --- a/.github/workflows/edge.yml +++ b/.github/workflows/edge.yml @@ -6,14 +6,14 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['2.7', '3.0', '3.1', '3.2', ruby-head, truffleruby-head, jruby-head] + ruby: ['2.7', '3.0', '3.1', '3.2', '3.3', ruby-head, truffleruby-head, jruby-head] gemfile: [rails_edge, rack_edge, rack_3_0] runs-on: ubuntu-latest continue-on-error: true env: BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Ruby uses: ruby/setup-ruby@v1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index daf28bdd62..c3201f44a2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,12 +7,12 @@ jobs: name: RuboCop runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 3.2 + ruby-version: 3.3 bundler-cache: true rubygems: latest @@ -23,7 +23,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['2.7', '3.0', '3.1', '3.2'] + ruby: ['2.7', '3.0', '3.1', '3.2', '3.3'] gemfile: [rack_2_0, rack_3_0, rails_6_0, rails_6_1, rails_7_0, rails_7_1] include: - ruby: '2.7' @@ -36,7 +36,7 @@ jobs: env: BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Ruby uses: ruby/setup-ruby@v1 diff --git a/docker-compose.yml b/docker-compose.yml index 0f83ee0174..450bf872c1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,9 +9,10 @@ services: context: . dockerfile: docker/Dockerfile args: - - RUBY_VERSION=${RUBY_VERSION:-3} + - RUBY_VERSION=${RUBY_VERSION:-3.3} stdin_open: true tty: true + platform: linux/amd64 volumes: - .:/var/grape - - gems:/usr/local/bundle \ No newline at end of file + - gems:/usr/local/bundle diff --git a/spec/grape/endpoint_spec.rb b/spec/grape/endpoint_spec.rb index 14d99c6277..46a17a2b77 100644 --- a/spec/grape/endpoint_spec.rb +++ b/spec/grape/endpoint_spec.rb @@ -694,17 +694,6 @@ def app end.to raise_error(NoMethodError, %r{^undefined method `undefined_helper' for # in `/hey' endpoint}) end end - - context 'when performing an undefined method of an instance inside the API' do - it 'raises NoMethodError but stripping the internals of the Object class' do - subject.get('/hey') do - Object.new.x - end - expect do - get '/hey' - end.to raise_error(NoMethodError, /^undefined method `x' for #$/) - end - end end it 'does not persist params between calls' do From f16688a7c5861c1baa388224ad724a0af18eb733 Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 1 Jan 2024 22:41:42 +0100 Subject: [PATCH 2/3] Add CHANGELOG.md entry --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fcae35383a..3cbb2378b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ * [#2390](https://github.com/ruby-grape/grape/pull/2390): Drop support for Ruby 2.6 and Rails 5 - [@ericproulx](https://github.com/ericproulx). * [#2393](https://github.com/ruby-grape/grape/pull/2393): Optimize AttributeTranslator - [@ericproulx](https://github.com/ericproulx). * [#2395](https://github.com/ruby-grape/grape/pull/2395): Set `max-age` to 0 when `cookies.delete` - [@ericproulx](https://github.com/ericproulx). +* [#2397](https://github.com/ruby-grape/grape/pull/2397): Add support for ruby 3.3 - [@ericproulx](https://github.com/ericproulx). * Your contribution here. #### Fixes @@ -62,7 +63,7 @@ #### Features -* [#2288](https://github.com/ruby-grape/grape/pull/2288): Droped support for Ruby 2.5 - [@ericproulx](https://github.com/ericproulx). +* [#2288](https://github.com/ruby-grape/grape/pull/2288): Dropped support for Ruby 2.5 - [@ericproulx](https://github.com/ericproulx). * [#2288](https://github.com/ruby-grape/grape/pull/2288): Updated rubocop to 1.41.0 - [@ericproulx](https://github.com/ericproulx). * [#2296](https://github.com/ruby-grape/grape/pull/2296): Fix cops and enables some - [@ericproulx](https://github.com/ericproulx). * [#2302](https://github.com/ruby-grape/grape/pull/2302): Rack < 3 and update rack-test - [@ericproulx](https://github.com/ericproulx). From edfa69e17df027bc8d83b2ef21e8d8fa343bab56 Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 3 Jan 2024 11:26:29 +0100 Subject: [PATCH 3/3] Revert docker-compose --- docker-compose.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 450bf872c1..2b293708b1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,10 +9,9 @@ services: context: . dockerfile: docker/Dockerfile args: - - RUBY_VERSION=${RUBY_VERSION:-3.3} + - RUBY_VERSION=${RUBY_VERSION:-3} stdin_open: true tty: true - platform: linux/amd64 volumes: - .:/var/grape - gems:/usr/local/bundle