Commit Graph

778 Commits

Author SHA1 Message Date
Lázaro Nixon
bde99e52ad
Install dartsass-rails when generating app with sass (#47545) 2023-03-01 06:51:29 +01:00
zzak
263d9ea626 Bump RDoc dependency
While we depend on rdoc through the sdoc gem, it only requires a minimum version.

This may be the cause for #47261 broke edgeapi.rubyonrails.org, those docs are generated with Ruby 2.6 or 2.7.

I'd also like to investigate increasing the Ruby version on the doc server, but I feel that has bigger impact.
2023-02-06 16:28:56 +09:00
Hartley McGuire
106692fb6c
Remove unused sequel gem from Gemfile
It was originally added in 175ba6666453684bba3c24d03b75580a1f8e68bb
as the database driver for Que in the Active Job integration tests.

However, the gem is now unused since the Que adapter and its integration
tests were removed in cb22eb2b3628de428171175063371155d70a136c
2023-01-31 19:13:22 -05:00
zzak
896c7faedf Use Gemfile to manage Rack version for dev 2023-01-25 12:24:19 +09:00
zzak
3503bccec6
Revert "Use eval_gemfile to read .Gemfile" 2023-01-21 10:30:47 +09:00
Sam Bostock
d525d9f4e3
Use eval_gemfile to read .Gemfile
eval_gemfile includes some error handling and management of Bundler's
internal state.
2023-01-17 11:33:26 -05:00
Petrik
34b920e776 Upgrade sdoc to support Ruby 3.2
Add support for Ruby 3.2 as File.exists? has been removed
2023-01-11 12:46:46 +01:00
Hartley McGuire
0d339411e1
Remove sprockets-export from Gemfile
Its usage was removed in 7d116c9 but I forgot to remove it

The other changes come from running bundle install, it looks like they
were supposed to be removed in d9e79ce
2023-01-03 22:56:28 -05:00
Aaron Patterson
18b2964dea
Merge pull request #46206 from lsylvester/karma-ujs
use Karma as the test runner for the UJS tests
2023-01-03 17:45:52 -08:00
Lachlan Sylvester
d9e79ce7f4 use Karma as the test runner for the UJS tests 2022-12-31 23:03:09 +11:00
Haroon Ahmed
7662fd653c Update capybara gem to version 3.38. This version supports puma 6 2022-12-27 22:00:36 +00:00
Petrik
e17457bae2 Update sdoc to 2.5.0 to support better code highlighting 2022-12-19 15:44:34 +01:00
Yasuo Honda
425d60c97d
Revert "Lock sqlite3 gem to 1.4 to run Rails CI using rubylang/ruby:master-nightly-focal" 2022-12-16 08:47:32 +09:00
Akira Matsuda
c73eafa634
Bump Rake version to 13 or higher for Ruby 3.2 compat
Rake 12 seems not to play nice with Ruby 3.2 because it does not include
baa23cc8a8
and thus cannot handle kwargs properly on Ruby 3.2.
2022-12-15 16:14:22 +09:00
Yasuo Honda
727d2b438b Lock sqlite3 gem to 1.4 to run Rails CI using rubylang/ruby:master-nightly-focal
Managed to reproduce https://buildkite.com/rails/rails/builds/90045#01839e89-85d4-4ef5-a443-6b2993f08f36

- Steps to reproduce

Install Docker
```
git clone https://github.com/rails/rails
cd rails
git clone https://github.com/rails/buildkite-config .buildkite/
RUBY_IMAGE=rubylang/ruby:master-nightly-focal docker-compose -f .buildkite/docker-compose.yml build base
```

- Actual behavior without this change

It gets `Gem::Ext::BuildError: ERROR: Failed to build gem native extension.`

The entire error message can be seen via
https://buildkite.com/rails/rails/builds/90045#01839e89-85d4-4ef5-a443-6b2993f08f36

- Why sqlite gem version is locked to 1.4?

The last successful build installed `sqlite3 1.5.1`. however now it
cannot install 1.5.1, 1.5.0 anymore.
https://buildkite.com/rails/rails/builds/90006#01839032-3ccd-4aca-ad58-2c08beb4351f/142-862

I still have not found the actual reason why. I've just found a related
issue https://bugs.ruby-lang.org/issues/19189
2022-12-13 20:14:04 +09:00
Yasuo Honda
2794d5761f Use cgi 0.3.6 or higher to address CookieStoreTest#test_session_store_with_all_domains
This commit addresses the following error by using cgi 0.3.6 that
includes https://github.com/ruby/cgi/pull/29

```ruby
$ ruby -v
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
$ gem info cgi

*** LOCAL GEMS ***

cgi (0.3.5)
    Author: Yukihiro Matsumoto
    Homepage: https://github.com/ruby/cgi
    Licenses: Ruby, BSD-2-Clause
    Installed at (default): /home/yahonda/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0

    Support for the Common Gateway Interface protocol.
$
```

```
$ cd actionpack
$ bin/test test/dispatch/session/cookie_store_test.rb -n test_session_store_with_all_domains
Running 27 tests in a single process (parallelization threshold is 50)
Run options: -n test_session_store_with_all_domains --seed 24288

E

Error:
CookieStoreTest#test_session_store_with_all_domains:
ArgumentError: invalid domain: ".example.com"
    /home/yahonda/.rbenv/versions/3.1.3/lib/ruby/3.1.0/cgi/cookie.rb:128:in `domain='
    /home/yahonda/.rbenv/versions/3.1.3/lib/ruby/3.1.0/cgi/cookie.rb:95:in `initialize'
    /home/yahonda/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/mock.rb:239:in `new'
    /home/yahonda/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/mock.rb:239:in `block in parse_cookies_from_header'
    /home/yahonda/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/mock.rb:236:in `each'
    /home/yahonda/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/mock.rb:236:in `parse_cookies_from_header'
    /home/yahonda/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/mock.rb:187:in `initialize'
    /home/yahonda/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/rack-test-2.0.2/lib/rack/test.rb:360:in `new'
    /home/yahonda/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/rack-test-2.0.2/lib/rack/test.rb:360:in `process_request'
    /home/yahonda/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/rack-test-2.0.2/lib/rack/test.rb:155:in `request'
    /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/testing/integration.rb:285:in `process'
    /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/testing/integration.rb:16:in `get'
    /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/testing/integration.rb:376:in `get'
    /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/session/cookie_store_test.rb:420:in `get'
    /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/session/cookie_store_test.rb:379:in `block in test_session_store_with_all_domains'
    /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/session/cookie_store_test.rb:438:in `block in with_test_route_set'
    /home/yahonda/src/github.com/rails/rails/actionpack/test/abstract_unit.rb:157:in `with_routing'
    /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/session/cookie_store_test.rb:424:in `with_test_route_set'
    /home/yahonda/src/github.com/rails/rails/actionpack/test/dispatch/session/cookie_store_test.rb:378:in `test_session_store_with_all_domains'

bin/test test/dispatch/session/cookie_store_test.rb:377

Finished in 0.079807s, 12.5303 runs/s, 0.0000 assertions/s.
1 runs, 0 assertions, 0 failures, 1 errors, 0 skips
$
```

Related to
https://github.com/ruby/cgi/pull/29
https://github.com/rails/rails/issues/46578
2022-11-28 13:57:46 +09:00
Yasuo Honda
e95051c734 Bump error_highlight 0.5.1 or higher
error_highlight 0.5.1 only changes ArgumentError#detailed_message
via https://github.com/ruby/error_highlight/pull/29

Therefore we can revert #46442 and bump the error_highlight version of
Gemfile.lock to the latest one.
2022-11-14 16:00:18 +09:00
Yasuo Honda
415fae9b2d Lock error_highlight version to 0.4.0
This commit locks error_highlight gem to 0.4.0
until https://github.com/ruby/error_highlight/issues/28 is resolved.

It should workaround CI failures like:
https://buildkite.com/rails/rails/builds/90833#0184571b-307d-4e94-8a2d-3c8a2669a12c/1052-1078
2022-11-08 23:33:35 +09:00
Jonathan Hefner
21f1199448 Always run rails app:update in app update tests
Prior to this commit, several tests in `AppGeneratorTest` were testing
app update behavior without actually running `rails app:update`.  This
meant the logic in `Rails::AppUpdater#generator_options` that detects
which frameworks and components are installed was not being tested.

Additionally, because `ENV["BUNDLE_GEMFILE"]` is set when tests are run
(by `require "bundler/setup"` in `tools/test.rb`), any tests which did
run `rails app:update` used the Rails repo Gemfile, instead of the
generated app Gemfile.  The difference becomes obvious when running
`rails app:update` after generating an app without Sprockets (as in
`test_app_update_does_not_generate_manifest_config_when_propshaft_is_used`),
because `rails app:update` will load the Sprockets railtie (due to
`Bundler.require` using the Rails repo Gemfile), and then exit with a
`Sprockets::Railtie::ManifestNeededError`.  However, if
`rails app:update` is run within a `quietly` block, such an error will
be swallowed.

This commit changes all such tests to run `rails app:update` via a
`run_app_update` helper that: (1) overrides the `BUNDLE_GEMFILE`
environment variable to point to the generated app Gemfile, (2) points
the `rails` gem in the generated app Gemfile to the Rails repo
(otherwise the `rails` gem version cannot be resolved), and (3) sets
`exception: true` so that the `system` call will raise an error if
`rails app:update` exits with an error code.

This commit also adds `jbuilder` and `web-console` to the Rails repo
Gemfile to ensure they are already installed when evaluating the
generated app Gemfile.

These changes do add a couple dozen seconds to the test suite run time,
but the thorough test coverage seems worth it.
2022-10-04 12:33:26 -05:00
MSP-Greg
6c674e4425
Updates for Puma 6 2022-09-22 12:40:54 -05:00
Yasuo Honda
349a66ebed Drop Rubinius code
Rubinius has not been maintained since May 2020 and based on the
discussion at https://github.com/rails/rails/pull/44984 ,
I think we can remove Rubinius specific code from Rails.
2022-09-15 23:43:51 +09:00
Rafael Mendonça França
e6d4ac0e50
Merge pull request #46009 from johnnyshields/bundler-use-windows-platform
Bundler should use platform :windows instead of :mingw, etc.
2022-09-14 22:35:59 -04:00
johnnyshields
b7e809a96e Bundler should use platform :windows instead of :mingw, :mswin, :x64_mingw, :mswin64. This is a recently added feature to bundler/rubygems in v3.3.22. 2022-09-13 16:45:59 +09:00
Yasuo Honda
cb22eb2b36 Remove QueAdapter from Active Job
Que and Rails (Active Job QueAdapter) have applied changes each other
to support Ruby 3 keyword arguments and options provided as top level keywords, etc
via these commits:

https://github.com/rails/rails/pull/44734
https://github.com/rails/rails/pull/44248
d9244b9074 via https://github.com/que-rb/que/pull/319

Finally, we've found it is quite difficult to maintain them.
Going forward Active Job Que adapter can be included in the future version of que gem itself.
Refer to https://github.com/rails/rails/issues/45899 the background for this change.

Active Job Que adapter can be included in the future version of que gem itself.
2022-09-12 22:31:10 +09:00
Jean Boussier
545482650b Update redis and resque
Fix: https://github.com/rails/rails/issues/45913
2022-09-07 15:10:43 +02:00
Yasuo Honda
e29db960b2 Lock redis version to v4 until #45913 is resolved
Refer to https://github.com/rails/rails/issues/45913
https://github.com/redis/redis-rb/issues/1142
2022-08-31 15:42:21 +09:00
Yasuo Honda
a4c4ee1b11 Lock que version to v1 until #45899 is resolved
Refer to https://github.com/rails/rails/issues/45899

https://github.com/rails/rails/issues/45899
2022-08-29 14:49:12 +09:00
Yusuke Endoh
3beb2aff3b Use error_highlight gem to locate the columns where an error was raised
This change incorporates to Rails a feature called error_highlight that
has been available since Ruby 3.1. This allow Rails' error report screen
to display the fine-grained location where an error occurred (not only a
line number but also beginning and end column numbers of the code
fragment).

For ErrorHighlight, see https://bugs.ruby-lang.org/issues/17930 in
detail.

To use error_highlight, ExceptionWrapper now prefers
`Exception#backtrace_locations` (since Ruby 2.1), which returns an array
of `Thread::Backtrace::Location`s, instead of `Exception#backtrace`.
This is because error_highlight requires `Thread::Backtrace::Location`
to locate the column where an error was raised.

Co-Authored-By: John Hawthorn <john@hawthorn.email>
Co-Authored-By: Jean Boussier <jean.boussier@gmail.com>
2022-08-24 00:28:50 +09:00
Jean Boussier
7587b7e99a Action Cable redis-rb 5+ compatibility
- Pass configuration as symbols
- Stop messing with the raw client
2022-08-22 09:01:27 +02:00
Jean Boussier
f2ab66da73 Stop testing hiredis
The driver being used is an implementation detail of `redis-rb`.
If somehow something break on one driver but not the other, it should
be reported to redis-rb and fixed there.

Also `redis-rb` `5.0` has a totally new client and hiredis binding
so all this code no longer works with redis-rb 5.0.
2022-08-22 09:01:27 +02:00
Eileen M. Uchitelle
914ac17156
Merge pull request #45539 from geongeorge/feature/updates-guide-generation-epub
Feature/updates guide generation - EPUB
2022-08-04 15:03:56 -04:00
Geon George
56e96d9344 Replaces mobi guide with epub for docs because of discontinued support
Removes kindlerb logic

Adds template for epub generator

Renames the kindle dir to /epub

Adds epub module to generator and replaces kindle

Fixes mimetype

Creates basic epub book

Deletes old kindle module

Adds zip package

Updates rubyzip gem name

Removes now unused gepub gem

Adds the required container file for epubs

Fixes media type

Adds new epub generation logic

Removes all buttons from output html

Refactors and generates valid epub files

Removes frontmatter logic used for kindlegen

Filters out epub files in zip

Updates link to kindle doc on sidebar

Fixes rubocop issues

Adds deprecation warning for the old kindle task

Refactors and cleans up epub module

Cleans up epub code

Cleans up private internal method code style

Removes unnecessary imagemagick check
2022-08-05 00:18:20 +05:30
Étienne Barrié
889886d6ad Allow rack-test >= 2 2022-07-06 14:54:39 +02:00
Yasuo Honda
767c8391f7 Lock rack-test version to v1 until #45467 is resolved
Action Pack CI has been failing since rack-test v2.0.0.
Refer to https://github.com/rails/rails/pull/45177
2022-06-28 09:46:39 +09:00
eileencodes
9766eb4a83
Fix tests for minitest 5.16
In minitest/minitest@6e06ac9 minitest changed such that it now accepts
`kwargs` instead of requiring kwargs to be shoved into the args array.
This is a good change but required some updates to our test code to get
the new version of minitest passing.

Changes are as follows:

1) Lock minitest to 5.15 for Ruby 2.7. We don't love this change but
it's pretty difficult to get 2.7 and 3.0 to play nicely together with
the new kwargs changes. Dropping 2.7 support isn't an option right
now for Rails. This is safe because all of the code changes here are
internal methods to Rails like assert_called_with. Applications
shouldn't be consuming them as they are no-doc'd.
2) Update the `assert_called_with` method to take any kwargs but also
the returns kwarg.
3) Update callers of `assert_called_with` to move the kwargs outside the
args array.
4) Update the message from marshaled exceptions. In 5.16 the exception
message is "result not reported" instead of "Wrapped undumpable
exception".

Co-authored-by: Matthew Draper <matthew@trebex.net>
2022-06-23 08:32:11 -04:00
eileencodes
7f93661551
Lock minitest for now
CI runs bundle update so minitest got updated and my PR started failing
due to this change 6e06ac9d3e

I will relax the minitest requirement once the failing specs can be
fixed, but I don't want that to block this. It wasn't immediately
obvious to me what needs to change in our tests to get them passing.
There is also an open issue here
https://github.com/minitest/minitest/issues/912 regarding this change.
2022-06-15 12:24:41 -04:00
Yasuo Honda
133fe10083 Use queue_classic 4.0.0
Refer to https://github.com/QueueClassic/queue_classic/pull/339
2022-05-18 14:04:43 +09:00
Petrik
55073ac10f Use the CSS badge for the API docs as well
Sdoc 2.4.0 supports a CSS badge that can be set by passing the version
as the HORO_BADGE_VERSION env variable.

The old badge image can be removed, as it no longer needs to be copied
by the docs server: https://github.com/rails/rails-docs-server/pull/28
2022-05-10 21:05:59 +02:00
Jean Boussier
d7ac149f5f Use mysql2 0.5.4 2022-05-04 13:21:24 +02:00
Petrik
dc9c7cf1fa Update sdoc to 2.3.2 to support latest rdoc 2022-04-22 10:04:34 +02:00
Yasuo Honda
75d104fbb0 Use blade 0.7.3 to support Ruby 3.2
blade 0.7.3 includes https://github.com/javan/blade/pull/12

Related to https://github.com/rails/rails/pull/44152
18e3226c9b
2022-04-13 08:31:38 +09:00
Matthew Draper
e0edc1aa1d Switch from fork to queue_classic beta release 2022-02-27 22:55:41 +10:30
Ghouse Mohamed
715f117ac9 Bumps rubocop version to 1.25.1 2022-02-23 21:18:33 +05:30
Petrik
569d4ed196 Upgrade to sdoc 2.3.1
Fixes the following error in Firefox/Linux:

    Ctrl-C broken (Uncaught TypeError: $.browser is undefined)
2022-02-14 19:36:22 +01:00
Yasuo Honda
65f350e176 Released version of rbtree 0.4.5 supports Ruby 3.2.0dev
https://github.com/mame/rbtree is mirror of rbtree gem
and rbtree 0.4.5 has been released to support Ruby 3.2.0dev.
https://rubygems.org/gems/rbtree/versions/0.4.5

Related to https://github.com/rails/rails/pull/44152
2022-02-07 13:00:58 +09:00
Yasuo Honda
cc86e13fc9 Use released version of pg 1.3
pg 1.3.0 which supports Ruby 3.2.0dev has been released.
https://rubygems.org/gems/pg/versions/1.3.0

Follow up #44007
2022-01-25 21:15:48 +09:00
Jean Boussier
18e3226c9b Point blade to the official repository 2022-01-12 14:52:41 +01:00
Jean Boussier
c2da0add54 Fork rbtree and blade to fix ruby-head CI
They both need very minor fixes.
2022-01-12 11:07:28 +01:00
Yasuo Honda
f1f3ef5f90 Use pg gem 1.3.0.rc1 to support Ruby 3.2
Ruby 3.2.0dev removed `rb_cData`, `pg` gem cannot be installed with Ruby 3.2.0dev.

Refer Rails CI build failure at:
https://buildkite.com/rails/rails/builds/83631#fbe41b47-08d3-4b4a-8f17-692da1ab1ddf

This fix has been released as `1.3.0.rc1`

Refer:
https://github.com/ged/ruby-pg/issues/413
7c738ce5e6
2022-01-06 14:53:38 +09:00
Rafael Mendonça França
b65a3054e6
Merge pull request #44083 from rails/rm-temporary-mail-fix
Temporarily add net-gems as dependencies of frameworks that use mail
2022-01-05 18:42:47 -05:00