Skip to content

Update activerecord-import Gem - #47703

Merged
Hamms merged 1 commit into
stagingfrom
activerecord-import-1.0.8
Sep 6, 2022
Merged

Update activerecord-import Gem#47703
Hamms merged 1 commit into
stagingfrom
activerecord-import-1.0.8

Conversation

@Hamms

@Hamms Hamms commented Aug 17, 2022

Copy link
Copy Markdown
Contributor

To pick up support for Rails 6.1, which was added in 1.0.3

The only breaking change listed between these versions is a change to make on_duplicate_key_update no longer enabled by default in MySQL. We're using MySQL so this change could impact us, but as far as I've been able to find we are usually consistent about setting this value explicitly:

LevelsScriptLevel.import! levels_script_levels_to_import, on_duplicate_key_update: get_columns(LevelsScriptLevel)

Script.import! [script_to_import], on_duplicate_key_update: get_columns(Script)

LevelConceptDifficulty.import! changed_lcds, on_duplicate_key_update: lcd_update_columns

But there are some situations in which we don't:

Level.import! new_level_names.map {|name| {name: name}}

User.import! students

Video.import! videos

In those situations, the old behavior would be that any entries with duplicate unique identifiers would be combined. The new behavior is that an error will be raised.

My expectation is that if there is anywhere that we are relying on old behavior, that will be revealed by our continuous integration system.

Links

Testing story

Relying on existing tests to verify that this does not result in any change in behavior.

PR Checklist:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@Hamms Hamms added the Rails Upgrade All work related to upgrading the version of Ruby on Rails we use. label Aug 17, 2022
@Hamms
Hamms marked this pull request as ready for review August 29, 2022 19:36
@Hamms
Hamms requested review from a team August 29, 2022 19:36

@bethanyaconnor bethanyaconnor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This seems reasonable but I'd also recommend watching Honeybadger closely after this change is deployed. We should see any issues that aren't caught by CI pretty quickly there

@Hamms
Hamms merged commit 3d8bc15 into staging Sep 6, 2022
@Hamms
Hamms deleted the activerecord-import-1.0.8 branch September 6, 2022 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Rails Upgrade All work related to upgrading the version of Ruby on Rails we use.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants