<commit_before>-module(mover_phase_2_migration_callback).

-export([
         migration_start_worker_args/2,
         migration_action/2,
         migration_type/0,
         supervisor/0,
         error_halts_migration/0,
         reconfigure_object/2
         ]).

-include("mover.hrl").
-include_lib("moser/include/moser.hrl").

migration_start_worker_args(Object, AcctInfo) ->
    [Object, AcctInfo].

migration_action(OrgName, AcctInfo) ->
    OrgInfo = moser_acct_processor:expand_org_info(#org_info{org_name = OrgName, account_info = AcctInfo}),
    moser_utils:load_process_org(OrgInfo,
                     fun moser_group_converter:insert/1,
                     fun moser_chef_processor:cleanup_org_info/1,
                     "READ"),
    [{ok, done}].

migration_type() ->
    <<"phase_2_migration">>.

supervisor() ->
    mover_org_migrator_sup.

error_halts_migration() ->
    true.

reconfigure_object(ObjectId, _AcctInfo) ->
    mover_org_darklaunch:org_to_sql(ObjectId, ?PHASE_2_MIGRATION_COMPONENTS).<commit_msg>Remove [{ok, done}] so we catch crash on moser_utils:load_process_org.<commit_after>-module(mover_phase_2_migration_callback).

-export([
         migration_start_worker_args/2,
         migration_action/2,
         migration_type/0,
         supervisor/0,
         error_halts_migration/0,
         reconfigure_object/2
         ]).

-include("mover.hrl").
-include_lib("moser/include/moser.hrl").

migration_start_worker_args(Object, AcctInfo) ->
    [Object, AcctInfo].

migration_action(OrgName, AcctInfo) ->
    OrgInfo = moser_acct_processor:expand_org_info(#org_info{org_name = OrgName, account_info = AcctInfo}),
    moser_utils:load_process_org(OrgInfo,
                     fun moser_group_converter:insert/1,
                     fun moser_chef_processor:cleanup_org_info/1,
                     "READ").

migration_type() ->
    <<"phase_2_migration">>.

supervisor() ->
    mover_org_migrator_sup.

error_halts_migration() ->
    true.

reconfigure_object(ObjectId, _AcctInfo) ->
    mover_org_darklaunch:org_to_sql(ObjectId, ?PHASE_2_MIGRATION_COMPONENTS).
{'fraction_non_alphanumeric': 0.11089957163255593, 'fraction_numerical': 0.010471204188481676, 'mean_word_length': 3.2379032258064515, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2259746', 'n_tokens_mistral': 755, 'n_tokens_neox': 740, 'n_words': 83}