Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load rails 7.0 defaults #4388

Merged
merged 3 commits into from
Mar 12, 2024
Merged

Load rails 7.0 defaults #4388

merged 3 commits into from
Mar 12, 2024

Conversation

segiddins
Copy link
Member

No description provided.

Copy link

codecov bot commented Jan 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.15%. Comparing base (be15c54) to head (ffc0674).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4388      +/-   ##
==========================================
- Coverage   97.15%   97.15%   -0.01%     
==========================================
  Files         391      391              
  Lines        8258     8257       -1     
==========================================
- Hits         8023     8022       -1     
  Misses        235      235              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Base automatically changed from segiddins/update-hash_digest_class-to-sha256 to master January 24, 2024 20:15
@segiddins segiddins force-pushed the segiddins/load-rails-7.0-defaults branch from 2568392 to 3495714 Compare January 24, 2024 20:16
@segiddins segiddins marked this pull request as ready for review January 24, 2024 20:16
@segiddins
Copy link
Member Author

0 clue why this would cause test failures, it should be no functional change

@martinemde
Copy link
Member

martinemde commented Jan 28, 2024

That's strange. Could it be that other gems are relying on the old api? For example, what's with the deprecation all the sudden?

DEPRECATION WARNING: `Rails.application.secrets` is deprecated in favor of `Rails.application.credentials` and will be removed in Rails 7.2. (called from call at /home/runner/work/rubygems.org/rubygems.org/lib/clearance_backdoor.rb:9)

Either I'm crazy or that code doesn't have a reference to secrets (when I look again maybe it is the call to clearance).

@segiddins
Copy link
Member Author

I believe the warnings are unrelated

@segiddins segiddins force-pushed the segiddins/load-rails-7.0-defaults branch from 3495714 to e2ee570 Compare January 30, 2024 06:27
@segiddins segiddins force-pushed the segiddins/load-rails-7.0-defaults branch from e2ee570 to 668c49e Compare February 9, 2024 16:52
@segiddins segiddins force-pushed the segiddins/load-rails-7.0-defaults branch from 668c49e to ad986b1 Compare February 20, 2024 19:10
@simi simi force-pushed the segiddins/load-rails-7.0-defaults branch from ad986b1 to 8f35b6d Compare February 22, 2024 00:42
@segiddins segiddins force-pushed the segiddins/load-rails-7.0-defaults branch from 8f35b6d to bf08a09 Compare March 11, 2024 17:15
@simi simi force-pushed the segiddins/load-rails-7.0-defaults branch from bf08a09 to de0e397 Compare March 11, 2024 19:31
simi added 2 commits March 12, 2024 02:52
… with UPDATE sql.

- find_by_sql calls could be cached and are not meant to be used for data modifications
- this changes returned value, but it seems it is used only in testing
…DATE sql.

- find_by_sql calls could be cached and are not meant to be used for data modifications
@simi
Copy link
Member

simi commented Mar 12, 2024

@segiddins @martinemde something in this list https://github.com/rails/rails/blob/4d3e2910c680baad7c14d2797a53a6b72405149b/railties/lib/rails/application/configuration.rb#L219-L268 causes find_by_sql calls to be cached and sadly there is code calling UPDATE clauses with find_by_sql which are not executed sometimes due to this change.

There were 2 places using find_by_sql, I have refactored them to use update_all or update_column. See each individual commit message for more details.

@segiddins segiddins merged commit 4ce2e86 into master Mar 12, 2024
17 checks passed
@segiddins segiddins deleted the segiddins/load-rails-7.0-defaults branch March 12, 2024 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants