Commit Graph

13 Commits

Author SHA1 Message Date
Petrik
275a6130c1 Set secret_key_base on config in bug_report_templates
`secrets` are deprecated. For the bug templates we can set the
`secret_key_base` on `config` instead.
2023-06-18 18:58:22 +02:00
Yasuo Honda
174cc5c7a2
Revert "Lock sqlite3 gem to 1.4 to run bug report templates" 2022-12-16 08:49:38 +09:00
Yasuo Honda
bd77a4e182 Lock sqlite3 gem to 1.4 to run bug report templates
This commit locks sqlite3 gem version to 1.4
to run bug report templates using rubylang/ruby:master-nightly-focal

This issue does not reproduce Ruby 3.2.0dev installed locally.
It reproduces at Rails CI environment that runs Ruby using Docker.

https://buildkite.com/rails/rails/builds/91635#01850c57-922e-4bac-a083-732715667640

```
Installing sqlite3 1.5.4 with native extensions
/usr/local/lib/ruby/3.2.0+3/bundler/installer/parallel_installer.rb:220:in `handle_error': Gem::Ext::BuildError: ERROR: Failed to build gem native extension. (Bundler::InstallError)

    current directory: /usr/local/lib/ruby/gems/3.2.0+3/gems/sqlite3-1.5.4/ext/sqlite3
/usr/local/bin/ruby -I /usr/local/lib/ruby/3.2.0+3 extconf.rb
Building sqlite3-ruby using packaged sqlite3.
Extracting sqlite-autoconf-3400000.tar.gz into tmp/x86_64-linux-gnu/ports/sqlite3/3.40.0... OK
Running 'configure' for sqlite3 3.40.0... OK
Running 'compile' for sqlite3 3.40.0... OK
Running 'install' for sqlite3 3.40.0... OK
Activating sqlite3 3.40.0 (from /usr/local/lib/ruby/gems/3.2.0+3/gems/sqlite3-1.5.4/ports/x86_64-linux-gnu/sqlite3/3.40.0)...

Could not configure the build properly (pkg_config). Please install either the `pkg-config` utility or the `pkg-config` rubygem.

*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.
```

Related to https://github.com/rails/rails/pull/46711
2022-12-14 08:42:30 +09:00
Rafael Mendonça França
1717237ccc
No need to check for Ruby version on the bug reports template anymore
Those libraries are being defined as dependency of the right frameworks
now.
2022-01-06 20:50:33 +00:00
Ryuta Kamizono
336a0ee65f Update bug report templates to use Rails 7.0 2021-12-27 18:29:01 +09:00
Yasuo Honda
417ec15f5d Ruby 3.1.0 installs digest 3.1.0 as standard library
No need to add digest gem explicitly anymore.

Refer:
https://www.ruby-lang.org/en/news/2021/12/25/ruby-3-1-0-released/

> Standard libraries updates
> The following default gem are updated.
> digest 3.1.0

This commit is kind of reverting these pull requests.

https://github.com/rails/rails/pull/42902
https://github.com/rails/rails/pull/43424
https://github.com/rails/rails/pull/43433
2021-12-26 11:07:46 +09:00
Yasuo Honda
146308f979 Bump required digest version to 3.1.0.pre for Ruby 3.1
This commit addresses these failures.

- `bundle install` failure

```ruby
$ bundle install
Fetching gem metadata from https://rubygems.org/.........
Could not find gem 'digest (~> 3.0.1.pre)' in rubygems repository https://rubygems.org/ or installed locally.
The source contains the following versions of 'digest': 1.0.0, 3.0.0, 3.1.0.pre0, 3.1.0.pre1, 3.1.0.pre2, 3.1.0.pre2 java
$
```

* Action Mailbox bug report template failures

```ruby
$ cd guides/bug_report_templates
$ ruby -v
ruby 3.1.0dev (2021-10-12T11:53:18Z master 58ae1efb49) [x86_64-linux]
$ ruby action_mailbox_main.rb
Fetching gem metadata from https://rubygems.org/......
/home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/resolver.rb:278:in `block in verify_gemfile_dependencies_are_found!': Could not find gem 'digest (~> 3.0.1.pre)' in rubygems repository https://rubygems.org/ or installed locally. (Bundler::GemNotFound)
The source contains the following versions of 'digest': 1.0.0, 3.0.0, 3.1.0.pre0, 3.1.0.pre1, 3.1.0.pre2, 3.1.0.pre2 java
  from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/resolver.rb:253:in `each'
  from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/resolver.rb:253:in `verify_gemfile_dependencies_are_found!'
  from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/resolver.rb:50:in `start'
  from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/resolver.rb:23:in `resolve'
  from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/definition.rb:267:in `resolve'
  from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/definition.rb:183:in `resolve_remotely!'
  from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/installer.rb:280:in `resolve_if_needed'
  from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/installer.rb:82:in `block in run'
  from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/process_lock.rb:12:in `block in lock'
  from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/process_lock.rb:9:in `open'
  from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/process_lock.rb:9:in `lock'
  from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/installer.rb:71:in `run'
  from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/installer.rb:23:in `install'
  from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/inline.rb:63:in `block (2 levels) in gemfile'
  from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/settings.rb:131:in `temporary'
  from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/inline.rb:62:in `block in gemfile'
  from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/settings.rb:131:in `temporary'
  from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/inline.rb:55:in `gemfile'
  from action_mailbox_main.rb:5:in `<main>'
$
```

Refer e94bcda025
2021-10-12 22:41:22 +09:00
Yasuo Honda
2be1df7dca Address action_mailbox bug report templates failures with Ruby3.1.0dev
This commit addresses CI failure since https://buildkite.com/rails/rails/builds/81642#ee889e34-4f2f-4bb6-9204-9c9bd0d27fa8

`net-smtp` gem v0.2.2 released which adds dependency to digest gem  which attempts to install digest 3.0.0.
However, Ruby 3.1.0dev requires digest gem 3.0.1, which causes this failure.

Refer
https://github.com/ruby/net-smtp/releases/tag/v0.2.2
b1adc9e0be

- Steps to reproduce
```
$ cd guides/bug_report_templates
$ ruby action_mailbox_main.rb

- Result without this commit

```ruby
$ ruby -v
ruby 3.1.0dev (2021-10-10T15:24:09Z master 10c650628a) [x86_64-linux]
$ cd guides/bug_report_templates
$ ruby action_mailbox_main.rb
Fetching gem metadata from https://rubygems.org/......
Resolving dependencies...
Using rake 13.0.6
Using concurrent-ruby 1.1.9
Using minitest 5.14.4
Using builder 3.2.4
Using erubi 1.10.0
Using mini_mime 1.1.1
Using bundler 2.3.0.dev
Using rack 2.2.3
Using digest 3.0.0
Using io-wait 0.1.1
Using method_source 1.0.0
Using timeout 0.1.1
Using thor 1.1.0
Using zeitwerk 2.5.0.beta5
Using sqlite3 1.4.2
Using i18n 1.8.10
Using tzinfo 2.0.4
Using mail 2.7.1
Using marcel 1.0.2
Using rack-test 1.1.0
Using net-protocol 0.1.1
Using sprockets 4.0.2
Using activesupport 7.0.0.alpha2 from https://github.com/rails/rails.git (at /home/yahonda/src/github.com/rails/rails@5e1a039)
Using websocket-extensions 0.1.5
Using net-smtp 0.2.2
Using websocket-driver 0.7.5
Using crass 1.0.6
Using nio4r 2.5.8
Using racc 1.5.2
Using mini_portile2 2.6.1
Using nokogiri 1.12.5
Using loofah 2.12.0
Using rails-html-sanitizer 1.4.2
Using rails-dom-testing 2.0.3
Using globalid 0.5.2
Using actionview 7.0.0.alpha2 from https://github.com/rails/rails.git (at /home/yahonda/src/github.com/rails/rails@5e1a039)
Using activemodel 7.0.0.alpha2 from https://github.com/rails/rails.git (at /home/yahonda/src/github.com/rails/rails@5e1a039)
Using actionpack 7.0.0.alpha2 from https://github.com/rails/rails.git (at /home/yahonda/src/github.com/rails/rails@5e1a039)
Using activejob 7.0.0.alpha2 from https://github.com/rails/rails.git (at /home/yahonda/src/github.com/rails/rails@5e1a039)
Using actioncable 7.0.0.alpha2 from https://github.com/rails/rails.git (at /home/yahonda/src/github.com/rails/rails@5e1a039)
Using actionmailer 7.0.0.alpha2 from https://github.com/rails/rails.git (at /home/yahonda/src/github.com/rails/rails@5e1a039)
Using sprockets-rails 3.2.2
Using activerecord 7.0.0.alpha2 from https://github.com/rails/rails.git (at /home/yahonda/src/github.com/rails/rails@5e1a039)
Using railties 7.0.0.alpha2 from https://github.com/rails/rails.git (at /home/yahonda/src/github.com/rails/rails@5e1a039)
Using activestorage 7.0.0.alpha2 from https://github.com/rails/rails.git (at /home/yahonda/src/github.com/rails/rails@5e1a039)
Using actiontext 7.0.0.alpha2 from https://github.com/rails/rails.git (at /home/yahonda/src/github.com/rails/rails@5e1a039)
Using actionmailbox 7.0.0.alpha2 from https://github.com/rails/rails.git (at /home/yahonda/src/github.com/rails/rails@5e1a039)
Using rails 7.0.0.alpha2 from https://github.com/rails/rails.git (at /home/yahonda/src/github.com/rails/rails@5e1a039)
/home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/runtime.rb:309:in `check_for_activated_spec!': You have already activated digest 3.0.1.pre, but your Gemfile requires digest 3.0.0. Since digest is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports digest as a default gem. (Gem::LoadError)
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/runtime.rb:25:in `block in setup'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/spec_set.rb:136:in `each'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/spec_set.rb:136:in `each'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/runtime.rb:24:in `map'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/runtime.rb:24:in `setup'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/inline.rb:71:in `block in gemfile'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/settings.rb:131:in `temporary'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/inline.rb:55:in `gemfile'
	from action_mailbox_main.rb:5:in `<main>'
$
```
2021-10-11 00:59:15 +09:00
Ryuta Kamizono
d273d0b79d Relax version constraint in bug report templates
To prevent future PRs like #41711, #37985, #36936.
2021-08-07 13:20:26 +09:00
Haroon Ahmed
6fbb154306 Fix bug report templates that are failing to run because rails 6.1.0 is dependant on mimemagic 2021-06-30 21:22:33 +01:00
Yasuo Honda
255e3b9819 Add net/smtp gem for bug report templates to support Ruby 3.1
Ruby 3.1 extracts some gems to bundled one, which requires to add these gems to Gemfile explicitly.
`net/smtp` is one of them, which affected Action Mailbox bug report templates.

* Steps to reproduce

Install `ruby 3.1.0dev`

```
git clone https://github.com/rails/rails.git
cd rails/guides
ruby bug_report_templates/action_mailbox_gem.rb
ruby bug_report_templates/action_mailbox_main.rb
```

* This commit addresses the following error `cannot load such file -- net/smtp (LoadError)`

```
$ ruby bug_report_templates/action_mailbox_gem.rb
... snip ...
Using rails 6.1.0
/home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require': cannot load such file -- net/smtp (LoadError)
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `block in require'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:299:in `load_dependency'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/mail-2.7.1/lib/mail.rb:9:in `<module:Mail>'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/mail-2.7.1/lib/mail.rb:3:in `<top (required)>'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `block in require'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:299:in `load_dependency'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/actionmailbox-6.1.0/lib/action_mailbox/mail_ext.rb:3:in `<top (required)>'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `block in require'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:299:in `load_dependency'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/actionmailbox-6.1.0/lib/action_mailbox.rb:3:in `<top (required)>'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `block in require'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:299:in `load_dependency'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/actionmailbox-6.1.0/lib/action_mailbox/engine.rb:9:in `<top (required)>'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `block in require'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:299:in `load_dependency'
	from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require'
	from bug_report_templates/action_mailbox_gem.rb:17:in `<main>'
```

* Added comment when this dependency can be removed based on https://bugs.ruby-lang.org/issues/17873

Refer
https://github.com/ruby/ruby/pull/4530
https://github.com/rails/rails/pull/42308

Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2021-06-07 00:15:21 +09:00
Yasuo Honda
fa5db446ed Update bug report templates to use Rails 6.1.0 2020-12-13 16:52:48 +09:00
Benoit Tigeot
dbff2df7c2
Add Action Mailbox bug report templates 2020-07-15 11:04:12 -04:00