Skip to content

fix: enhance name generation logic to use OwnerKey as fallback#534

Merged
marissafichera merged 2 commits intostagingfrom
BDMS-565-enhance-name-generation-logic-to-use-OwnerKey-as-fallback
Feb 18, 2026
Merged

fix: enhance name generation logic to use OwnerKey as fallback#534
marissafichera merged 2 commits intostagingfrom
BDMS-565-enhance-name-generation-logic-to-use-OwnerKey-as-fallback

Conversation

@jirhiker
Copy link
Copy Markdown
Member

@jirhiker jirhiker commented Feb 17, 2026

Summary

This PR updates contact transfer behavior to improve name generation robustness and transfer performance.

Changes

  • Updated contact name generation logic to use OwnerKey as a fallback when primary name fields are unavailable.
  • Updated transfer execution path to run eligible work in parallel.
  • Added/updated tests for multiple-well contact transfer behavior:
    • /Users/jross/Programming/DIG/OcotilloAPI/tests/transfers/test_contact_with_multiple_wells.py
  • Implementation changes:
    • /Users/jross/Programming/DIG/OcotilloAPI/transfers/contact_transfer.py

Why

  • Some records do not have complete name fields; using OwnerKey fallback prevents dropped/empty contact names.

Validation

  • Focused tests in tests/transfers/test_contact_with_multiple_wells.py pass:
    • test_multiple_wells
    • test_owner_comment_creates_notes_for_primary_only
    • test_owner_comment_absent_skips_notes

Risk / Impact

  • Low-to-moderate: behavior changes are isolated to contact transfer logic.
  • Primary risk is name normalization differences for edge-case records; covered by updated tests.

Copilot AI review requested due to automatic review settings February 17, 2026 20:42
@jirhiker jirhiker changed the title fix: enhance name generation logic to use OwnerKey as fallback and update transfer method to parallel execution fix: enhance name generation logic to use OwnerKey as fallback Feb 17, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the contact transfer to generate a fallback contact name using OwnerKey when both first/last name and organization are missing, and adjusts an integration test to run well transfers via the parallel execution path.

Changes:

  • Use _safe_make_name(...) in _add_first_contact to fall back to OwnerKey for missing name/org.
  • Add _safe_make_name helper with warning logging for missing identifiers.
  • Update the multi-well contact transfer test to call WellTransferer.transfer_parallel().

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
transfers/contact_transfer.py Adds OwnerKey-based fallback naming via _safe_make_name and uses it for primary contact creation.
tests/transfers/test_contact_with_multiple_wells.py Switches the well transfer step in the test helper to run via transfer_parallel().

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b5f84ad246

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Contributor

@marissafichera marissafichera left a comment

Choose a reason for hiding this comment

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

bueno

@marissafichera marissafichera merged commit 596f37f into staging Feb 18, 2026
8 checks passed
@TylerAdamMartinez TylerAdamMartinez deleted the BDMS-565-enhance-name-generation-logic-to-use-OwnerKey-as-fallback branch February 26, 2026 18:25
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.

3 participants