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

Add option to drop datastore if there is an error on post_import #4311

Merged
merged 8 commits into from
Nov 1, 2024

Conversation

janette
Copy link
Member

@janette janette commented Oct 8, 2024

RE: 22023

Describe your changes

Adds a config option to drop the datastore table if the post_import queue reports an error

QA Steps

  • See Jira

Checklist before requesting review

If any of these are left unchecked, please provide an explanation

  • I have updated or added tests to cover my code
  • I have updated or added documentation

@janette janette marked this pull request as ready for review October 8, 2024 23:10
@chri5tia chri5tia force-pushed the stop-on-import-error branch from 2ba45ca to b3d2f80 Compare October 25, 2024 04:06
@chri5tia
Copy link

Test drop logic on post-import error.

  1. Verify that datastoreService->drop() is called when a post-import error occurs, and drop_config is enabled.
    Test log messages on success.

  2. Verify that a notice is logged when the datastore is successfully dropped.
    Test exception handling.

  3. Verify that errors are logged if datastoreService->drop() throws an exception.
    Test no drop when drop_config is disabled.

  4. Verify that the drop() method is not called when drop_config is disabled, even if there's a post-import error.

@janette I had to change the way 'datastore.settings' is retrieved so that it comes from the config factory so it can be stored as a config object for the test. Let me know if this is wrong and/or messes anything up.

@chri5tia chri5tia force-pushed the stop-on-import-error branch from bc363eb to 65ef768 Compare October 25, 2024 06:26
@chri5tia chri5tia force-pushed the stop-on-import-error branch from 65ef768 to ac007ed Compare October 25, 2024 06:36
@rovcase rovcase self-requested a review October 31, 2024 18:50
Copy link
Contributor

@rovcase rovcase left a comment

Choose a reason for hiding this comment

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

Hello wowee good stuff (very helpful to look into the test files too). Just one minor possibly redundant question as well as one piece of code cleanup. Thanks!

@rovcase rovcase self-requested a review October 31, 2024 20:16
Copy link
Contributor

@rovcase rovcase left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@rovcase rovcase merged commit 373a734 into 2.x Nov 1, 2024
11 checks passed
@rovcase rovcase deleted the stop-on-import-error branch November 1, 2024 13:07
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.

4 participants