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

CCOL-2039: Global consumer configurations for replace_association & bulk_id_generation #205

Merged
merged 3 commits into from
Dec 4, 2023

Conversation

lionelpereira
Copy link
Collaborator

Pull Request Template

Description

  1. Allow global and individual consumer batch id generator procs to be passed in for use in bulk imports
  2. Allow global and individual consumer replace_associations configuration for use in bulk imports

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added a line in the CHANGELOG describing this change, under the UNRELEASED heading
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@lionelpereira lionelpereira changed the title CCOL-2039: All Global consumer configuration for replace_association & bulk_id_generation CCOL-2039: Global consumer configurations for replace_association & bulk_id_generation Nov 30, 2023
Copy link
Member

@dorner dorner left a comment

Choose a reason for hiding this comment

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

One comment - also, please add a line to the CHANGELOG!


default = MyConfigConsumer2.config
expect(default[:replace_associations]).to eq(true)
expect(default[:bulk_import_id_generator].call).to eq('global')
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't actually test that the generator is called when expected (i.e. during the batch updates). Ideally you'd make this change in e.g. the mass updater spec.

context 'with a class defined bulk_import_id_generator' do

before(:each) do
consumer_class.config[:bulk_import_id_generator] = proc { 'custom' }
Copy link
Member

Choose a reason for hiding this comment

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

You should still define the global one here - this should override the global.

@dorner
Copy link
Member

dorner commented Dec 4, 2023

Looks good!

@dorner dorner merged commit 767eeb3 into master Dec 4, 2023
5 checks passed
@dorner dorner deleted the CCOL-2039-configuration branch December 4, 2023 14:47
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.

2 participants