From a1f2cf6ba2a08933bbcce257db4245b4f44979cf Mon Sep 17 00:00:00 2001 From: hrflow-semantic-release Date: Mon, 12 Feb 2024 09:49:18 +0000 Subject: [PATCH 1/6] 4.6.1 Automatically generated by python-semantic-release --- CHANGELOG.md | 173 ++++++++++++++++++++++++++------------------------- 1 file changed, 87 insertions(+), 86 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b20cbe4c0..c90dacfcd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,57 +22,58 @@ * feat: consider info if exists rather than the parsed info (#221) -* feat: consider info if exists rather than the parsed info - -* fix: add case urls in info of profile json - -* fix: after jamal review - -* fix: remplace cv url by cv binary (#220) - -* fix:add some error handling for jobology connector - -* fix:jobology flake8 connector - -* fix:some type - -* fix:regarding jamal review - -* fix: remplace cv url by cv binary - -* docs: update docs - -* fix: flake8 outputs - -* fix: jobology catch profile - -* docs: update docs - -* fix: regarding jamal review - -* fix: handle possible error binasciii - -* fix: flake8 and docs - -* fix: some flake8 output - -* fix: correct update date for Jobology connector (#222) - -Co-authored-by: the-forest-tree <the-forest-tree@hrflow.ai> - -* 4.6.1 - -Automatically generated by python-semantic-release - -* fix: regarding jamal review location=value - ---------- - -Co-authored-by: the-forest-tree <65894619+the-forest-tree@users.noreply.github.com> -Co-authored-by: the-forest-tree <the-forest-tree@hrflow.ai> +* feat: consider info if exists rather than the parsed info + +* fix: add case urls in info of profile json + +* fix: after jamal review + +* fix: remplace cv url by cv binary (#220) + +* fix:add some error handling for jobology connector + +* fix:jobology flake8 connector + +* fix:some type + +* fix:regarding jamal review + +* fix: remplace cv url by cv binary + +* docs: update docs + +* fix: flake8 outputs + +* fix: jobology catch profile + +* docs: update docs + +* fix: regarding jamal review + +* fix: handle possible error binasciii + +* fix: flake8 and docs + +* fix: some flake8 output + +* fix: correct update date for Jobology connector (#222) + +Co-authored-by: the-forest-tree <the-forest-tree@hrflow.ai> + +* 4.6.1 + +Automatically generated by python-semantic-release + +* fix: regarding jamal review location=value + +--------- + +Co-authored-by: the-forest-tree <65894619+the-forest-tree@users.noreply.github.com> +Co-authored-by: the-forest-tree <the-forest-tree@hrflow.ai> Co-authored-by: hrflow-semantic-release <hrflow-semantic-release> ([`5b7997b`](https://github.com/Riminder/hrflow-connectors/commit/5b7997b5080b31de96d074b001369150ac95f596)) + ## v4.6.1 (2024-02-12) ### Fix @@ -83,30 +84,30 @@ Co-authored-by: the-forest-tree <the-forest-tree@hrflow.ai> ([`852c6aa`](h * fix: remplace cv url by cv binary (#220) -* fix:add some error handling for jobology connector - -* fix:jobology flake8 connector - -* fix:some type - -* fix:regarding jamal review - -* fix: remplace cv url by cv binary - -* docs: update docs - -* fix: flake8 outputs - -* fix: jobology catch profile - -* docs: update docs - -* fix: regarding jamal review - -* fix: handle possible error binasciii - -* fix: flake8 and docs - +* fix:add some error handling for jobology connector + +* fix:jobology flake8 connector + +* fix:some type + +* fix:regarding jamal review + +* fix: remplace cv url by cv binary + +* docs: update docs + +* fix: flake8 outputs + +* fix: jobology catch profile + +* docs: update docs + +* fix: regarding jamal review + +* fix: handle possible error binasciii + +* fix: flake8 and docs + * fix: some flake8 output ([`b41676e`](https://github.com/Riminder/hrflow-connectors/commit/b41676ebab149f4dd1170b34f7baf3641792981a)) @@ -289,20 +290,20 @@ rule of releasing depending on commit messages ([`16844d9`](https://github.com/R * Adding new actions 'pull_application_list' and 'push_score_list'. (#184) -* Adding new actions 'pull_application_list' and 'push_score_list'. They will be used to sync applications (profiles, jobs, statuses) and synchronize scores from HrFlow.ai to a target warehouse - -* style: apply black formatting - -* test: add new pull_application_list to coherence tests - -* fix: use random key for backend test to avoid failure in ci -It seems that when running multiple ci run in the same time -race condition can occur and one test can find the result of another -running in the same time - ---------- - -Co-authored-by: thomas <thomas.zhu@hrflow.ai> +* Adding new actions 'pull_application_list' and 'push_score_list'. They will be used to sync applications (profiles, jobs, statuses) and synchronize scores from HrFlow.ai to a target warehouse + +* style: apply black formatting + +* test: add new pull_application_list to coherence tests + +* fix: use random key for backend test to avoid failure in ci +It seems that when running multiple ci run in the same time +race condition can occur and one test can find the result of another +running in the same time + +--------- + +Co-authored-by: thomas <thomas.zhu@hrflow.ai> Co-authored-by: the-forest-tree <the-forest-tree@hrflow.ai> ([`df7d387`](https://github.com/Riminder/hrflow-connectors/commit/df7d3874bee3bf9d991f2d45b991330684ff6c0f)) From 22ff24f4bf71c7d720a53706fad4c3e556b8abd5 Mon Sep 17 00:00:00 2001 From: Abdellahitech Date: Wed, 14 Feb 2024 23:30:34 +0100 Subject: [PATCH 2/6] feat: add fields string --- src/hrflow_connectors/connectors/hrflow/warehouse/profile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hrflow_connectors/connectors/hrflow/warehouse/profile.py b/src/hrflow_connectors/connectors/hrflow/warehouse/profile.py index a6ff6a405..471ef38b0 100644 --- a/src/hrflow_connectors/connectors/hrflow/warehouse/profile.py +++ b/src/hrflow_connectors/connectors/hrflow/warehouse/profile.py @@ -263,6 +263,7 @@ def write_parsing( profile.get("educations_duration") if profile.get("educations_duration") is not None else profile_result.get("educations_duration") + ) edit_response = hrflow_client.profile.indexing.edit( From 4cc32fdb4d6b8a3d7e8b417d2568973299685471 Mon Sep 17 00:00:00 2001 From: Abdellahitech Date: Wed, 14 Feb 2024 23:43:54 +0100 Subject: [PATCH 3/6] fix: changelog --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c90dacfcd..8397f219c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -73,7 +73,6 @@ Co-authored-by: the-forest-tree <the-forest-tree@hrflow.ai> Co-authored-by: hrflow-semantic-release <hrflow-semantic-release> ([`5b7997b`](https://github.com/Riminder/hrflow-connectors/commit/5b7997b5080b31de96d074b001369150ac95f596)) - ## v4.6.1 (2024-02-12) ### Fix From 3c37c243aab9ccfd1668611fb66f96c0e8e0492f Mon Sep 17 00:00:00 2001 From: Abdellahitech Date: Thu, 15 Feb 2024 10:58:03 +0100 Subject: [PATCH 4/6] fix: as for jamal review --- src/hrflow_connectors/connectors/hrflow/warehouse/profile.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/hrflow_connectors/connectors/hrflow/warehouse/profile.py b/src/hrflow_connectors/connectors/hrflow/warehouse/profile.py index 471ef38b0..a6ff6a405 100644 --- a/src/hrflow_connectors/connectors/hrflow/warehouse/profile.py +++ b/src/hrflow_connectors/connectors/hrflow/warehouse/profile.py @@ -263,7 +263,6 @@ def write_parsing( profile.get("educations_duration") if profile.get("educations_duration") is not None else profile_result.get("educations_duration") - ) edit_response = hrflow_client.profile.indexing.edit( From 3f0542443169b2b9ba5f27c0c529c947376c3084 Mon Sep 17 00:00:00 2001 From: Abdellahitech Date: Fri, 16 Feb 2024 10:03:58 +0100 Subject: [PATCH 5/6] fix: handle thomas input --- .../connectors/hrflow/warehouse/profile.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/hrflow_connectors/connectors/hrflow/warehouse/profile.py b/src/hrflow_connectors/connectors/hrflow/warehouse/profile.py index a6ff6a405..e8f7f8a75 100644 --- a/src/hrflow_connectors/connectors/hrflow/warehouse/profile.py +++ b/src/hrflow_connectors/connectors/hrflow/warehouse/profile.py @@ -207,6 +207,9 @@ def write_parsing( hrflow_client = Hrflow( api_secret=parameters.api_secret, api_user=parameters.api_user ) + + source_response = hrflow_client.source.get(key=parameters.source_key) + for profile in profiles: profile_info = profile.get("info", {}) @@ -236,9 +239,8 @@ def write_parsing( ) failed.append(profile) continue - source_response = hrflow_client.source.get( - key=parameters.source_key - ) # Get source to check if sync_parsing is enabled + + # check if sync_parsing is enabled if source_response["code"] != 200: adapter.warning( "Failed to get source with key={} response={}, won't be able to update" From 34e38961cec134d11c035bb814c90edae5f97cbd Mon Sep 17 00:00:00 2001 From: Abdellahitech Date: Mon, 26 Feb 2024 12:52:35 +0100 Subject: [PATCH 6/6] feat: parsing warehouse V2 --- .../connectors/hrflow/warehouse/profile.py | 72 ++++++++++++++----- 1 file changed, 54 insertions(+), 18 deletions(-) diff --git a/src/hrflow_connectors/connectors/hrflow/warehouse/profile.py b/src/hrflow_connectors/connectors/hrflow/warehouse/profile.py index e8f7f8a75..d6baaba46 100644 --- a/src/hrflow_connectors/connectors/hrflow/warehouse/profile.py +++ b/src/hrflow_connectors/connectors/hrflow/warehouse/profile.py @@ -198,6 +198,46 @@ def merge_info(base: dict, info: dict) -> dict: return base +def merge_item(base: dict, profile: dict, item: str) -> dict: + if not profile.get(item): + return base + + base[item] = profile[item] + return base + + +def hydrate_profile(profile_parsed: dict, profile_json: dict) -> dict: + profile_info = profile_json.get("info", {}) + profile_enriched = merge_info(profile_parsed, profile_info) + + items_to_merge = [ + "experiences", + "educations", + "skills", + "languages", + "certifications", + "interests", + ] + for item in items_to_merge: + profile_enriched = merge_item(profile_enriched, profile_json, item) + + profile_enriched["text"] = profile_json.get("text") or profile_enriched.get("text") + profile_enriched["text_language"] = profile_json.get( + "text_language" + ) or profile_enriched.get("text_language") + profile_enriched["experiences_duration"] = ( + profile_json.get("experiences_duration") + if profile_json.get("experiences_duration") is not None + else profile_enriched.get("experiences_duration") + ) + profile_enriched["educations_duration"] = ( + profile_json.get("educations_duration") + if profile_json.get("educations_duration") is not None + else profile_enriched.get("educations_duration") + ) + return profile_enriched + + def write_parsing( adapter: LoggerAdapter, parameters: WriteProfileParsingParameters, @@ -211,8 +251,6 @@ def write_parsing( source_response = hrflow_client.source.get(key=parameters.source_key) for profile in profiles: - profile_info = profile.get("info", {}) - if parameters.only_insert and hrflow_client.profile.indexing.get( source_key=parameters.source_key, reference=profile["reference"] ).get("data"): @@ -222,6 +260,19 @@ def write_parsing( ) continue + if profile.get("resume") is None: + indexing_response = hrflow_client.profile.indexing.add_json( + source_key=parameters.source_key, profile_json=profile + ) + if indexing_response["code"] != 201: + adapter.error( + "Failed to index profile with reference={} response={}".format( + profile["reference"], indexing_response + ) + ) + failed.append(profile) + continue + parsing_response = hrflow_client.profile.parsing.add_file( source_key=parameters.source_key, profile_file=profile["resume"]["raw"], @@ -250,22 +301,7 @@ def write_parsing( ) elif source_response["data"]["sync_parsing"] is True: current_profile = parsing_response["data"]["profile"] - profile_result = merge_info(current_profile, profile_info) - - profile_result["text"] = profile.get("text") or profile_result.get("text") - profile_result["text_language"] = profile.get( - "text_language" - ) or profile_result.get("text_language") - profile_result["experiences_duration"] = ( - profile.get("experiences_duration") - if profile.get("experiences_duration") is not None - else profile_result.get("experiences_duration") - ) - profile_result["educations_duration"] = ( - profile.get("educations_duration") - if profile.get("educations_duration") is not None - else profile_result.get("educations_duration") - ) + profile_result = hydrate_profile(current_profile, profile) edit_response = hrflow_client.profile.indexing.edit( source_key=parameters.source_key,