feat: preserve OwnerComment during migration as a note about the contact#436
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds functionality to preserve the legacy OwnerComment field during contact migration by storing it as a note associated with the first contact.
Changes:
- Added logic to create a note from
OwnerCommentwhen migrating the first contact - Refactored
_add_first_contactand_add_second_contactto return contact objects and accept pre-computed organization - Added type hints to helper functions for improved type safety
- Added "OwnerComment" as a new note type in the lexicon
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| transfers/contact_transfer.py | Modified contact transfer logic to capture OwnerComment as a note on the first contact; refactored functions to return contacts and accept organization parameter; added type hints |
| core/lexicon.json | Added "OwnerComment" note type definition to support storing legacy owner comments |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 080a9c7d0b
ℹ️ 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".
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| if ( | ||
| tag == "first" | ||
| and contact |
There was a problem hiding this comment.
The note creation logic for OwnerComment lacks test coverage for error handling. Consider adding a test case that verifies behavior when contact.add_note() raises an exception.
Why
This PR addresses the following problem / context:
How
Implementation summary - the following was changed / added / removed:
Notes
Any special considerations, workarounds, or follow-up work to note?