| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Set process title of parallelized test workers
|
| | |
|
| |
| |
| |
| |
| | |
This version makes eager loading and autoloading consistent,
as documented in the upgrading guide.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
With this code (exctracted from derailed_benchmarks):
```ruby
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
gem "rails", "~> 6.0.0.rc1", require: false
end
FILES = [
"rails/engine/configuration",
"rails/source_annotation_extractor",
"active_support/deprecation"
]
module Kernel
alias :original_require :require
def require(file)
Kernel.require(file)
end
class << self
alias :original_require :require
end
end
Kernel.define_singleton_method(:require) do |file|
original_require(file)
end
FILES.each do |file|
puts "requiring file: #{file}"
require file
end
```
It fails with Rails 6 and the change introduced by 32065
```
requiring file: rails/engine/configuration
requiring file: rails/source_annotation_extractor
Traceback (most recent call last):
11: from repro_derailed.rb:33:in `<main>'
10: from repro_derailed.rb:33:in `each'
9: from repro_derailed.rb:35:in `block in <main>'
8: from repro_derailed.rb:21:in `require'
7: from repro_derailed.rb:30:in `block in <main>'
6: from repro_derailed.rb:30:in `require'
5: from /Users/benoit.tigeot/.rvm/gems/ruby-2.5.1/gems/railties-6.0.0.rc1/lib/rails/source_annotation_extractor.rb:8:in `<top (required)>'
4: from /Users/benoit.tigeot/.rvm/gems/ruby-2.5.1/gems/activesupport-6.0.0.rc1/lib/active_support/deprecation/proxy_wrappers.rb:10:in `new'
3: from /Users/benoit.tigeot/.rvm/gems/ruby-2.5.1/gems/activesupport-6.0.0.rc1/lib/active_support/deprecation/proxy_wrappers.rb:10:in `new'
2: from /Users/benoit.tigeot/.rvm/gems/ruby-2.5.1/gems/activesupport-6.0.0.rc1/lib/active_support/deprecation/proxy_wrappers.rb:125:in `initialize'
1: from /Users/benoit.tigeot/.rvm/gems/ruby-2.5.1/gems/activesupport-6.0.0.rc1/lib/active_support/deprecation/proxy_wrappers.rb:23:in `method_missing'
/Users/benoit.tigeot/.rvm/gems/ruby-2.5.1/gems/activesupport-6.0.0.rc1/lib/active_support/deprecation/proxy_wrappers.rb:148:in `warn': private method `warn' called for nil:NilClass (NoMethodError)
```
Related:
- https://github.com/schneems/derailed_benchmarks/pull/130
- https://github.com/rails/rails/pull/32065
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
definition
Tests are also only on the `Time` class
Update doc forgetting to erase when moved
Update guide `Date` class to `Time` class and defined file
Update guide correction omission
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We sometimes say "✂️ newline after `private`" in a code review (e.g.
https://github.com/rails/rails/pull/18546#discussion_r23188776,
https://github.com/rails/rails/pull/34832#discussion_r244847195).
Now `Layout/EmptyLinesAroundAccessModifier` cop have new enforced style
`EnforcedStyle: only_before` (https://github.com/rubocop-hq/rubocop/pull/7059).
That cop and enforced style will reduce the our code review cost.
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Use case:
I'm writing a wrapper around MessageEncryptor to make things easier
to rotate a secret in our app.
It works something like
```ruby
crypt = RotatableSecret.new(['old_secret', 'new_secret'])
crypt.decrypt_and_verify(message)
```
I'd like the caller to not have to care about passing the
`on_rotation` option and have the wrapper deal with it when
instantiating the MessageEncryptor object.
Also, almost all of the time the on_rotation should be the same when
rotating a secret (logging something or StatsD event) so I think
it's not worth having to repeat ourselves each time we decrypt a message.
|
|
|
|
|
|
|
| |
Listen interprets an empty list of directories as "watch the current
directory". Since EventedFileUpdateChecker doesn't share these
semantics, we should not initialize listen if we end up with an empty
directory list.
|
|
|
|
|
|
|
| |
This is a regression for #36184.
And also, add new `monotonic` argument to the last of the method
signature rather than the first.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, if a test worker exited early, the in-flight test it was
supposed to run wasn't reported as a failure.
If all workers exited immediately, this would be reported as ex.
Finished in 1.708349s, 39.2192 runs/s, 79.0237 assertions/s.
67 runs, 135 assertions, 0 failures, 0 errors, 2 skips
This commit validates that all workers finish running tests by ensuring
that the queue is empty after they exit. This works because we signal
the workers to exit by pushing nil onto the queue, so that there should
be a number of items left in the queue matching potentially missed
tests.
|
| |
|
| |
|
|\
| |
| | |
Fix EventedFileUpdateChecker through a symlink
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
On MacOS, Dir.tmpdir gives me a folder inside "/var/folders/". However,
/var is a symlink to /private/var.
Previously, the nonexistent directory test would fail because it was
initialized with /var/folders/... but the filenames from listen would be
the realpaths.
This commit normalizes the dirs by calling realpath on them if they
exist. This is done on boot!, so it will work with newly directories
through the symlink.
|
| |
| |
| |
| |
| | |
The common include of this test creates a tmpdir, we should use that for
consistency.
|
| | |
|
|/
|
|
| |
This is no longer used as of caa3cc8868206f8109e0d633efb09d31e94ef635
|
|
|
|
| |
attachment
|
|
|
|
|
|
|
|
|
|
| |
The `number_to_human_size` helpers in Action View and Active Support
calculate the "human size" with a base of 1024. The examples should
reflect that so they don't confuse the reader.
The updated documentations use the values from:
helper.number_to_human_size(1500)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'ActiveSupport::Notifications::Fanout::Subscribers::MonotonicTimed' and 'ActiveSupport::Notifications::monotonic_subscribe'
Also, change the signature of ‘ActiveSupport::Notifications::Fanout#subscribe’ to accept optional ‘monotonic’ boolean argument. Then initialize either a ‘Timed’ or ‘MonotonicTimed’ subscriber based on the value of ‘monotonic’ parameter.
Introduce ‘ActiveSupport::Notifications::monotonic_subscribe’ method
Also, provision ‘ActiveSupport::Notifications::subscribed’ to optionally accept ‘monotonic’ boolean argument.
Update documentation for ActiveSupport::Notifications
Add tests
Update guides documentation under the 'Active Support Instrumentation' chapter
Incorporate feedback: use optional keyword argument to specify optional 'monotonic' option to 'subscribed' method
Fix a typo
|
|
|
|
| |
https://github.com/rails/rails/blob/65bdd6ad085a02b976cd36f135c2a5ffb522e5a0/activesupport/CHANGELOG.md
|
|\
| |
| |
| |
| | |
azimux/improve-hwia-initialize-by-skipping-to_h-if-already-a-hash
HashWithIndifferentAccess#initialize performance improvement
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Rails 4 -> Rails 5 introduced a #to_hash call in
HashWithIndifferentAccess#initialize to guarantee access to
the #default and #default_proc methods. This can be a very
expensive operation for very large HashWithIndifferentAccess
objects. This commit bypasses this #to_hash call if it is
already a Hash.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The change to monotonic times causes failures for applications
where the subscribed block is expecting Time objects as described
in this issue: https://github.com/rails/rails/issues/36145
The original PR (https://github.com/rails/rails/pull/35984) was
concerned with errors on the cpu_time. Test was edited to reflect
changes to initializer using 0 values instead of nil
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
ActiveSupport `delegate` has `to` option, but it's not a option hash
anymore and now it's a keyword argument.
When `to` argument is not given, it raises an ArgumentError but
the message suggests supplying "options hash", which is now wrong.
Now it's fixed to provide correct suggestion to supply a keyword
argument.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Add test asserting truncate returns unfrozen string
* Ensure strings returned from truncate are not frozen
This fixes an issue where strings too short to be truncated were
returned unfrozen, where as long-enough strings were returned
frozen. Now retuned strings will not be frozen whether or not
the string returned was shortened.
* Update changelog w/ new truncate behavior description
[Jordan Thomas + Rafael Mendonça França]
|
| | |
|
| |
| |
| |
| |
| |
| | |
This commit more or less undoes 9b5401f, restores autoloaded? not to
touch the descendants tracker, and autoloaded_constants because it is
documented in the guide.
|
|\ \
| | |
| | | |
Refactor `ActiveSupport::Deprecation.deprecate_methods` not to expose internal methods
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
internal methods
In #33325, `deprecate_methods` is replaced from `prepend` to completely
emurated `alias_method_chain`, it exposed two internal methods
`xxx_with_deprecation` and `xxx_without_deprecation`.
After that, #34648 restored the `prepend` implementation, which doesn't
expose any internal methods, so we no longer be able to ensure to always
expose that internal methods.
As I said at https://github.com/rails/rails/pull/33325#issuecomment-409016725,
I think that internal methods exposed is not a specification but a
limitation when using `alias_method_chain`, there is no longer a reason
to follow that limitation.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Actionable errors let's you dispatch actions from Rails' error pages. This
can help you save time if you have a clear action for the resolution of
common development errors.
The de-facto example are pending migrations. Every time pending migrations
are found, a middleware raises an error. With actionable errors, you can
run the migrations right from the error page. Other examples include Rails
plugins that need to run a rake task to setup themselves. They can now
raise actionable errors to run the setup straight from the error pages.
Here is how to define an actionable error:
```ruby
class PendingMigrationError < MigrationError #:nodoc:
include ActiveSupport::ActionableError
action "Run pending migrations" do
ActiveRecord::Tasks::DatabaseTasks.migrate
end
end
```
To make an error actionable, include the `ActiveSupport::ActionableError`
module and invoke the `action` class macro to define the action. An action
needs a name and a procedure to execute. The name is shown as the name of a
button on the error pages. Once clicked, it will invoke the given
procedure.
|
| |
| |
| |
| |
| |
| |
| | |
There are four ways to pass the redis option, but only three were
documented. This is now consistent with implementation.
[ci skip]
|
|\ \
| | |
| | | |
Preserve html_safe? status on ActiveSupport::SafeBuffer#*
|
| | | |
|
|/ /
| |
| |
| |
| |
| | |
Resolves https://github.com/rails/rails/issues/35835
If an exception occurs during `parallelize_setup` make sure to catch that exception and apply it to the result of each successive test run. This results in marking all of the tests as failed to bring attention to the issue & ensure it is addressed before proceeding.
|
|\ \
| | |
| | | |
Describe how to silence the deprecation warning about empty I18n fall…
|
| | | |
|
|\ \ \
| | | |
| | | | |
Add documentations to concern methods [ci skip]
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
- Unused since https://github.com/rails/rails/commit/a91ea1d51048342d13f
|
|\ \ \ \
| | | | |
| | | | | |
Various fixes in ActiveSupport::Notifications::Event
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | | |
variables such as @cpu_time, @idle_time and @allocations; this reduces one allocation
|