- 09 11月, 2019 1 次提交
-
-
由 Rafael Mendonça França 提交于
class SensitiveJob < ApplicationJob self.log_arguments = false def perform(my_sensitive_argument) end end When dealing with sensitive arugments as password and tokens it is now possible to configure the job to not put the sensitive argument in the logs. Closes #34438.
-
- 07 11月, 2019 8 次提交
-
-
由 Ryuta Kamizono 提交于
Append missing 's' to #silence_warning call
-
由 Eileen M. Uchitelle 提交于
Add an intermediary called RoleManager to manage connections
-
由 utilum 提交于
-
由 Takayuki Nakata 提交于
-
由 eileencodes 提交于
This commit renames `RoleManager` -> `PoolManager` and `Role` -> `PoolConfig`. Once we introduced the previous commit, and looking at the existing code, it's clearer that `Role` and `RoleManager` are not the right names for these. Since this PR moves away from swapping the connection handler concepts around and the role concept will continue existing on the handler level, we need to rename this. A `PoolConfig` holds a `connection_specification_name` (we may rename this down the road), a `db_config`, a `schema_cache`, and a `pool`. It does feel like `pool` could eventually hold all of these things instead of having a `PoolConfig` object. This would remove one level of the object graph and reduce complexity. For now I'm leaving this object to keep the change churn low and will revisit later. Co-authored-by: NJohn Crepezzi <seejohnrun@github.com>
-
由 George Claghorn 提交于
-
由 George Claghorn 提交于
-
由 Xavier Noria 提交于
Co-authored-by: NAllen Hsu <allen.hsusp@gmail.com>
-
- 06 11月, 2019 6 次提交
-
-
由 Kasper Timm Hansen 提交于
Remove needless `require "pp"`
-
由 Tatsuya Hoshino 提交于
In Ruby 2.5 and later, `Kernel#pp` is automatically loaded. https://bugs.ruby-lang.org/issues/14123 This changes remove the needless `require "pp"`.
-
由 Ryuta Kamizono 提交于
Address `no implicit conversion of Arel::Attributes::Attribute into String`
-
由 Yasuo Honda 提交于
https://github.com/rails/rails/commit/4a9ef5e1202cdab1882989eb561b0dc854c9891b triggers this failure, then restored the original code for `activerecord/lib/arel/visitors/oracle.rb` . ``` $ bundle exec rspec ./spec/active_record/connection_adapters/oracle_enhanced/context_index_spec.rb:92 ==> Loading config from ENV or use default ==> Running specs with MRI version 2.6.5 ==> Effective ActiveRecord version 6.1.0.alpha ... snip ... Run options: include {:locations=>{"./spec/active_record/connection_adapters/oracle_enhanced/context_index_spec.rb"=>[92]}} F Failures: 1) OracleEnhancedAdapter context index on single table should create single VARCHAR2 column index Failure/Error: expect(Post.contains(:title, word).to_a).to eq([@post2, @post1]) TypeError: no implicit conversion of Arel::Attributes::Attribute into String # /home/yahonda/git/rails/activerecord/lib/arel/visitors/oracle.rb:107:in `match?' # /home/yahonda/git/rails/activerecord/lib/arel/visitors/oracle.rb:107:in `block (2 levels) in order_hacks' # /home/yahonda/git/rails/activerecord/lib/arel/visitors/oracle.rb:106:in `any?' # /home/yahonda/git/rails/activerecord/lib/arel/visitors/oracle.rb:106:in `block in order_hacks' # /home/yahonda/git/rails/activerecord/lib/arel/visitors/oracle.rb:105:in `any?' # /home/yahonda/git/rails/activerecord/lib/arel/visitors/oracle.rb:105:in `order_hacks' # /home/yahonda/git/rails/activerecord/lib/arel/visitors/oracle.rb:8:in `visit_Arel_Nodes_SelectStatement' # /home/yahonda/git/rails/activerecord/lib/arel/visitors/visitor.rb:30:in `visit' # /home/yahonda/git/rails/activerecord/lib/arel/visitors/visitor.rb:11:in `accept' # /home/yahonda/git/rails/activerecord/lib/active_record/connection_adapters/determine_if_preparable_visitor.rb:10:in `accept' # /home/yahonda/git/rails/activerecord/lib/arel/visitors/to_sql.rb:18:in `compile' # /home/yahonda/git/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:25:in `to_sql_and_binds' # /home/yahonda/git/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:63:in `select_all' # /home/yahonda/git/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:107:in `select_all' # /home/yahonda/git/rails/activerecord/lib/active_record/querying.rb:46:in `find_by_sql' # /home/yahonda/git/rails/activerecord/lib/active_record/relation.rb:826:in `block in exec_queries' # /home/yahonda/git/rails/activerecord/lib/active_record/relation.rb:844:in `skip_query_cache_if_necessary' # /home/yahonda/git/rails/activerecord/lib/active_record/relation.rb:811:in `exec_queries' # /home/yahonda/git/rails/activerecord/lib/active_record/relation.rb:629:in `load' # /home/yahonda/git/rails/activerecord/lib/active_record/relation.rb:250:in `records' # /home/yahonda/git/rails/activerecord/lib/active_record/relation.rb:245:in `to_ary' # ./spec/active_record/connection_adapters/oracle_enhanced/context_index_spec.rb:95:in `block (4 levels) in <top (required)>' ... snip ... ```
-
由 eileencodes 提交于
This PR is an alternate solution to #37388. While there are benefits to merging #37388 it changes the public API and swaps around existing concepts for how connection management works. The changes are backwards-incompatible and pretty major. This will have a negative impact on gems and applications relying on how conn management currently works. **Background:** Shopify and other applications need sharding but Rails has made it impossible to do this because a handler can only hold one connection pool per class. Sharded apps need to hold multiple connections per handler per class. This PR aims to solve only that problem. **What this PR does:** In this PR we've added a `RoleManager` class that can hold multiple `Roles`. Each `Role` holds the `db_config`, `connection_specification_name`, `schema_cache` and `pool`. By default the `RoleManager` holds a single reference from a `default` key to the `Role` instance. A sharded/multi-tenant app can pass an optional second argument to `remove_connection`, `retrieve_connection_pool`, `establish_connection` and `connected?` on the handler, thus allowing for multiple connections belonging to the same class/handler without breaking backwards compatibility. By using the `RoleManager` we can avoid altering the public API, moving around handler/role concepts, and achieve the internal needs for establishing multiple connections per handler per class. **A note about why we opened this PR:** We very much appreciate the work that went into #37388 and in no way mean to diminish that work. However, it breaks the following public APIs: * `#retrieve_connection`, `#connected?`, and `#remove_connection` are public methods on handler and can't be changed from taking a spec to a role. * The knowledge that the handler keys are symbols relating to a role (`:writing`/`:reading`) is public - changing how handlers are accessed will break apps/libraries. In addition it doesn't solve the problem of mapping a single connection to a single class since it has a 1:1 mapping of `class (handler) -> role (writing) -> db_config`. Multiple pools in a writing role can't exist in that implementation. The new PR solves this by using the `RoleManager` to hold multiple connection objects for the same class. This lets a handler hold a role manager which can hold as many roles for that writer as the app needs. **Regarding the `Role` name:** When I originally designed the API for multiple databases, it wasn't accidental that handler and role are the same concept. Handler is the internal concept (since that's what was there already) and Role was the public external concept. Meaning, role and handler were meant to be the same thing. The concept here means that when you switch a handler/role, Rails automatically can pick up the connection on the other role by knowing the specification name. Changing this would mean not just that we need to rework how GitHub and many many gems work, but also means retraining users of Rails 6.0 that all these concepts changed. Since this PR doesn't move around the concepts in connection management and instead creates an intermediary between `handler` and `role` to manage the connection data (`db_config`, `schema_cache`, `pool`, and `connection_specification`) we think that `Role` and `RoleManager` are the wrong name. We didn't change it yet in this PR because we wanted to keep change churn low for initial review. We also haven't come up with a better name yet.
😄 **What this PR does not solve:** Our PR here solves a small portion of the problem - it allows models to have multiple connections on a class. It doesn't aim to solve any other problems than that. Going forward we'll need to still solve the following problems: * `DatabaseConfig` doesn't support a sharding configuration * `connects_to`/`connected_to` still needs a way to switch connections for shards * Automatic switching of shards * `connection_specification_name` still exists **The End** Thanks for reading this far. These problems aren't easy to solve. John and I spent a lot of time trying different things and so I hope that this doesn't come across as if we think we know better. I would have commented on the other PR what changes to make but we needed to try out different solutions in order to get here. Ultimately we're aiming to change as little as the API as possible. Even if the handler/role -> manager -> db_config/pool/etc isn't how we'd design connection management if we could start over, we also don't want to break public APIs. It's important that we make things better while maintaining compatibility. The `RoleManager` class makes it possible for us to fix the underlying problem while maintaining all the backwards compatibility in the public API. We all have the same goal; to add sharding support to Rails. Let me know your thoughts on this change in lieu of #37388 and if you have questions. Co-authored-by: NJohn Crepezzi <seejohnrun@github.com> -
由 Gannon McGibbon 提交于
Ensure public-read ACL for S3 service with public mode.
-
- 05 11月, 2019 6 次提交
-
-
由 Carlos Antonio da Silva 提交于
Use singular, `instance`, in deprecation warning.
-
由 George Claghorn 提交于
-
由 Artin Boghosian 提交于
-
由 Rafael Mendonça França 提交于
-
由 Rafael França 提交于
TypeError Regexp#match?(nil) in Ruby Head
-
由 Henrik Nyh 提交于
It is not intended to be limited to only Rails 3 and 4, and currently runs specs against Rails 4.2 to to 5.2: https://github.com/barsoom/traco/blob/master/.travis.yml
-
- 04 11月, 2019 3 次提交
-
-
由 George Claghorn 提交于
-
由 George Claghorn 提交于
-
由 yuuji.yaginuma 提交于
-
- 03 11月, 2019 2 次提交
-
-
由 utilum 提交于
Aa of ruby/ruby@2a22a6b2d8465934e75520a7fdcf522d50890caf calling `Regexp#match?(nil)` raises an exception. [utilum, eregon, eugeneius]
-
由 Ryuta Kamizono 提交于
-
- 02 11月, 2019 4 次提交
-
-
由 Gannon McGibbon 提交于
Run inline jobs in separate threads
-
由 Gannon McGibbon 提交于
-
由 eileencodes 提交于
Rubocop wants double quoted strings, not single. I missed this when I merged #37601
-
由 Eileen M. Uchitelle 提交于
Reestablish connection to previous database after migrating:
-
- 01 11月, 2019 2 次提交
-
-
由 y-yagi 提交于
Cache gems for GitHub Actions
-
由 Yasuo Honda 提交于
Follows up #37582 GitHub Actions cache requires `path:` parameter to configure which directory to be cached. It looks there is no easy way to retrieve path information using bundler command then workaround implemented to use `vendor/bundle`. Thanks to https://github.com/actions/cache/pull/4
-
- 31 10月, 2019 8 次提交
-
-
由 Kasper Timm Hansen 提交于
The `AJ_ADAPTER` env needs to be set to run activejob integration test
-
由 Kasper Timm Hansen 提交于
Merge pull request #37608 from bogdanvlviv/fix-assertions-for-mail-with-legacy-parameterized-delivery-job Fix ActionMailer assertions don't work for parameterized mail with legacy delivery job
-
由 Kasper Timm Hansen 提交于
Enabled GitHub Actions to run the latest RuboCop 0.76.0
-
由 Yasuo Honda 提交于
Updated the default Ruby workflow: * Trigger this action for pull request and push * Install requried OS packages for Active Record connection adapters * Removing `gem install bundler` because Ruby 2.6 already installs it * Run RuboCop in parallel by `bundle exec rubocop --parallel` * Rename `ruby.yml` to `rubocop.yml` to represent the workflow Bump RuboCop to 0.76.0 and rename `Style/UnneededPercentQ` to `Style/RedundantPercentQ` ```ruby $ bundle exec rubocop Error: The `Style/UnneededPercentQ` cop has been renamed to `Style/RedundantPercentQ`. (obsolete configuration found in .rubocop.yml ``` Removed `.codeclimate.yml`
-
由 bogdanvlviv 提交于
We should backport this to `6-0-stable`. Fixes https://github.com/rails/rails/issues/37605
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
Correctly deprecate where.not working as NOR for relations:
-