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

Bump rails from 7.1.3.4 to 7.2.0 #4445

Merged
merged 14 commits into from
Sep 4, 2024
Merged

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Aug 14, 2024

Bumps rails from 7.1.3.4 to 7.2.0.

Release notes

Sourced from rails's releases.

7.2.0

Active Support

  • Fix delegate_missing_to allow_nil: true when called with implict self

    class Person
      delegate_missing_to :address, allow_nil: true
    def address
    nil
    end
    def berliner?
    city == "Berlin"
    end
    end
    Person.new.city # => nil
    Person.new.berliner? # undefined local variable or method `city' for an instance of Person (NameError)

    Jean Boussier

  • Add logger as a dependency since it is a bundled gem candidate for Ruby 3.5

    Earlopain

  • Define Digest::UUID.nil_uuid, which returns the so-called nil UUID.

    Xavier Noria

  • Support duration type in ActiveSupport::XmlMini.

    heka1024

  • Remove deprecated ActiveSupport::Notifications::Event#children and ActiveSupport::Notifications::Event#parent_of?.

    Rafael Mendonça França

  • Remove deprecated support to call the following methods without passing a deprecator:

    • deprecate
    • deprecate_constant
    • ActiveSupport::Deprecation::DeprecatedObjectProxy.new
    • ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.new
    • ActiveSupport::Deprecation::DeprecatedConstantProxy.new
    • assert_deprecated
    • assert_not_deprecated

... (truncated)

Commits
  • fb6c430 Preparing for 7.2.0 release
  • c9a5cfd Merge pull request #52540 from mattbrictson/fix-brakeman-ci-desc
  • ac2035a Merge pull request #52555 from rails/rm-fix-system-test
  • 7ae1ec1 Remove WEB_CONCURRENCY "auto" from tuning_performance_for_deployment (#52545)
  • 0461267 Merge pull request #52554 from erados/patch-1
  • c2e0f6f Remove redundant Puma configuration settings from fresh config/puma.rb files
  • ecf787c Puma 5+ now pulls WEB_CONCURRENCY directly from ENV, so we cannot/should not ...
  • 573d4bd Merge pull request #52533 from denys-chaikovskyi/mod/auto-puma-workers
  • 0b3404e Merge pull request #52531 from n-studio/allow-bots
  • 6ffa94c Merge pull request #52524 from rubys/rm-redundant-comment
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot bot added dependencies Pull requests that update a dependency file ruby Pull requests that update Ruby code labels Aug 14, 2024
@inulty-dfe
Copy link
Contributor

Build failing with this error:

#32 12.50 NoMethodError: undefined method `migration_context' for #<ActiveRecord::ConnectionAdapters::PostgreSQLAdapter:0x0000000000c620 env_name="development" role=:writing> (NoMethodError)
#32 12.50 
#32 12.50       raise ActiveRecord::PendingMigrationError if ActiveRecord::Base.connection.migration_context.needs_migration?
#32 12.50                                                                                 ^^^^^^^^^^^^^^^^^^
#32 12.50 /usr/local/bundle/bundler/gems/dfe-analytics-d92d0b91b68e/lib/dfe/analytics.rb:111:in `initialize!'
#32 12.50 /usr/local/bundle/bundler/gems/dfe-analytics-d92d0b91b68e/lib/dfe/analytics/railtie.rb:41:in `block in <class:Railtie>'
#32 12.50 /usr/local/bundle/gems/activesupport-7.2.0/lib/active_support/lazy_load_hooks.rb:94:in `block in execute_hook'
#32 12.50 /usr/local/bundle/gems/activesupport-7.2.0/lib/active_support/lazy_load_hooks.rb:87:in `with_execution_control'

@dependabot dependabot bot force-pushed the dependabot/bundler/rails-7.2.0 branch 5 times, most recently from 9b32e73 to 13057a2 Compare August 15, 2024 09:32
@avinhurry avinhurry self-assigned this Aug 15, 2024
avinhurry added a commit to DFE-Digital/dfe-analytics that referenced this pull request Aug 15, 2024
When upgrading our apps to rails version 7.2:

Publish: DFE-Digital/publish-teacher-training#4445

Apply: DFE-Digital/apply-for-teacher-training#9692

Register: DFE-Digital/register-trainee-teachers#4562

We are getting the following error:

NoMethodError: undefined method `migration_context' for #<ActiveRecord::ConnectionAdapters::PostgreSQLAdapter:0x0000000000c620

raise ActiveRecord::PendingMigrationError if ActiveRecord::Base.connection.migration_context.needs_migration?

This is because of breaking changes and deprecation in rails 7.2:

ActiveRecord::Base.connection was changed to with_connection:

- https://blog.saeloun.com/2024/07/01/rails-adds-activerecord-base-with-connection/

This deprecation meant that rspec had to be upgraded:
- rspec/rspec-rails#2661

Set functional versions of the rspec-rails and rails gems depending on what version of rails you are using.
Copy link
Collaborator

@avinhurry avinhurry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm looking into this.

The current issue lies with the DfE analytics gem. I've opened a PR to help with a fix: DFE-Digital/dfe-analytics#162

@dependabot dependabot bot force-pushed the dependabot/bundler/rails-7.2.0 branch 3 times, most recently from d1b073b to 4af1065 Compare August 20, 2024 08:29
@avinhurry avinhurry force-pushed the dependabot/bundler/rails-7.2.0 branch 4 times, most recently from 4d2d4f1 to b50ba66 Compare August 27, 2024 13:50
@avinhurry avinhurry force-pushed the dependabot/bundler/rails-7.2.0 branch 2 times, most recently from 5cc291f to 9902011 Compare September 2, 2024 08:59
@avinhurry avinhurry marked this pull request as draft September 2, 2024 10:44
@avinhurry avinhurry force-pushed the dependabot/bundler/rails-7.2.0 branch 2 times, most recently from b6a12d9 to 2677ac3 Compare September 2, 2024 16:24
@avinhurry avinhurry force-pushed the dependabot/bundler/rails-7.2.0 branch 2 times, most recently from c894c22 to 8bd1959 Compare September 2, 2024 17:37
@avinhurry avinhurry closed this Sep 2, 2024
Copy link
Contributor Author

dependabot bot commented on behalf of github Sep 2, 2024

OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting @dependabot ignore this major version or @dependabot ignore this minor version. You can also ignore all major, minor, or patch releases for a dependency by adding an ignore condition with the desired update_types to your config file.

If you change your mind, just re-open this PR and I'll resolve any conflicts on it.

@avinhurry avinhurry reopened this Sep 3, 2024
dependabot bot and others added 11 commits September 3, 2024 14:12
Bumps [rails](https://github.com/rails/rails) from 7.1.3.4 to 7.2.0.
- [Release notes](https://github.com/rails/rails/releases)
- [Commits](rails/rails@v7.1.3.4...v7.2.0)

---
updated-dependencies:
- dependency-name: rails
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Was previously getting the following error:

An error occurred in a `before(:suite)` hook.
Failure/Error: DatabaseCleaner.clean_with(:truncation)

NoMethodError:
  undefined method `schema_migration' for #<ActiveRecord::ConnectionAdapters::PostgreSQLAdapter:0x0000000000dc00 env_name="test" role=:writing>
# ./spec/rails_helper.rb:64:in `block (2 levels) in <top (required)>'
This wil give us the validates method.

This was previously failing with:

An error occurred while loading ./spec/validators/phone_validator_spec.rb.
Failure/Error: validates :phone_number, phone: true
This looks the config.x was work around from a while ago. The automated generator has removed it.
@avinhurry avinhurry force-pushed the dependabot/bundler/rails-7.2.0 branch from 252fff8 to 577efe4 Compare September 3, 2024 13:12
@avinhurry avinhurry force-pushed the dependabot/bundler/rails-7.2.0 branch from 577efe4 to 726e097 Compare September 3, 2024 13:14
@avinhurry avinhurry marked this pull request as draft September 3, 2024 13:54
@avinhurry avinhurry closed this Sep 3, 2024
@avinhurry avinhurry reopened this Sep 3, 2024
@avinhurry avinhurry marked this pull request as ready for review September 3, 2024 15:11
Copy link
Contributor

@dcyoung-dev dcyoung-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about some of the lines that have been removed 🤷‍♂️

config/environments/production.rb Show resolved Hide resolved
config/environments/test.rb Show resolved Hide resolved
config/environments/test.rb Show resolved Hide resolved
@dcyoung-dev dcyoung-dev self-requested a review September 3, 2024 15:17
Copy link
Contributor

@dcyoung-dev dcyoung-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥳🥳🥳🥳🥳

@avinhurry
Copy link
Collaborator

Upgrade to rails 7.2

@avinhurry avinhurry merged commit fd9c647 into main Sep 4, 2024
19 checks passed
@avinhurry avinhurry deleted the dependabot/bundler/rails-7.2.0 branch September 4, 2024 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file ruby Pull requests that update Ruby code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants