Skip to content

Add RegistrationMigration: convert Join Involvement registrations to Registration Form - #12

Open
jkrrv wants to merge 2 commits into
masterfrom
registration-migration
Open

jkrrv wants to merge 2 commits into
masterfrom
registration-migration

Conversation

@jkrrv

@jkrrv jkrrv commented Oct 8, 2026

Copy link
Copy Markdown
Member

What

Adds RegistrationMigration/: a preview/apply script and an SQL validator for converting an Involvement from the old Join Involvement registration to the new Registration Form, preserving registration history.

  • RegistrationMigration.py -- run with ?orgid=N to preview, &apply=1 to write.
  • ValidateRegistrationMigration.sql -- 14 checks to run against the involvement afterward.

What it converts

  • Settings (nested RegSettingXml groups): fees and extra-fee date, max fee, deposit, discount codes, timeout, submission/sign-in/membership rules, shell, closed/full state, confirmation and staff-notification emails, account code.
  • Questions: every ask type, with required flags, option limits, and sub-group / extra-value behavior; a person-info question built from the old show/required flags; the donation request as a donation question. The passport question is migrated, never its answers.
  • History: each past enrollment becomes its own dated Registration with its answers and payment, recovered from OnlineOPRRegQA first, falling back to OnlineRegData / RegistrationData XML. Payments are re-linked, never altered.

Design points for review

  • History only. Nothing is written to people, sub-groups or extra values for past registrants -- the script only writes registration records (plus the involvement's own settings/questions). Each registration's person-info answer holds the details entered at the time and is never copied to the profile.
  • Every difference from the old behavior is printed in a "Differences from the old registration" section on each run (preview and apply), including settings dropped for lack of an equivalent.
  • Plain-text answers. model.AddRegAnswer takes plain text/list/dict and does the JSON encoding.
  • Not idempotent yet: it should only be run once per involvement (a re-run guard is planned).

Depends on

bvcms #5241 (python-reg), which adds the PythonModel registration methods this script calls. It will not run until that is deployed.

Testing

Not yet run against a database. Pure logic was exercised offline (settings translation, answer preparation, person-info mapping, edge cases). Next step is a pilot on a copy of production data: preview a spread of involvements, apply one, run the validator, and diff before/after snapshots to confirm no current state changed.

Several field mappings (member-only status code, membership-ID sign convention, notification replacement codes) came from reading the code and should be confirmed first in the pilot.

🤖 Generated with Claude Code

jkrrv and others added 2 commits October 7, 2026 23:07
A preview/apply script that converts an Involvement's settings, questions,
registrants, answers and payments from the old Join Involvement registration to
the new Registration Form, preserving history and not touching anyone's current
sub-groups, extra values or profile. Includes ValidateRegistrationMigration.sql
to check the result. Requires the PythonModel registration methods in bvcms
(python-reg branch).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Read settings from their real (nested) XML groups; previously nothing
  outside AskItems was found. Look up the account code by Id first.
- Create the person-info question from the old show/required flags, and
  record each registration's own person details as its answer (never written
  to the person record).
- Convert fees, submission rules, sign-in/membership rules, timeout, prospect,
  shell, closed/full state, discount codes, confirmation and staff
  notification emails, and the donation request; warn about old settings with
  no equivalent.
- Recover answer history from OnlineOPRRegQA first, falling back to the XML
  sources; send plain-text answers (model.AddRegAnswer does the JSON).
- Carry over Required flags, option limits and sub-group/extra-value behavior;
  skip passport answers; never touch sub-groups, extra values or profiles of
  past registrants.
- Print a "differences from the old registration" section in every run.
- Validator: check for one person-info question and for settings the new
  screen would reject.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 8, 2026 13:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

It is a large, explicitly-untested data-migration script whose correctness hinges on model.* methods from an external, inaccessible dependency PR and on several author-acknowledged field-mapping assumptions, so it needs human review and a database pilot.

1 open finding
What changed in this PR

Adds a new RegistrationMigration/ tool that converts a TouchPoint Involvement from the legacy "Join Involvement" registration to the new "Registration Form", preserving settings, questions, and historical registrants/answers/payments. It is a preview-first admin PyScript (?orgid=N, &apply=1) plus a companion SQL checklist to validate the result afterward. The script is history-preserving only (it never mutates people, sub-groups, or extra values for past registrants) and prints a "Differences from the old registration" report on every run. It depends on registration helper methods added in an external (currently inaccessible) bvcms/bvcms PR, and per the description has not yet been run against a database.

Changes:

  • Add RegistrationMigration.py: translates legacy RegSettingXml settings and AskItems questions into the new schema, builds a person-info/donation question, and reconstructs each past enrollment as its own dated Registration (primary source OnlineOPRRegQA, falling back to RegistrationData/OnlineRegData XML) with re-linked payments.
  • Add ValidateRegistrationMigration.sql: a 14-point post-migration checklist (PASS/FAIL/INFO) covering registration type, questions, people/roster counts, answer/JSON validity, dollar reconciliation, and rejected settings combinations.
File Description
RegistrationMigration/​RegistrationMigration.py Core preview/apply migration logic for settings, questions, historical registrations, answers, and payment links.
RegistrationMigration/​ValidateRegistrationMigration.sql Informal post-migration validation checklist run against the converted involvement.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment on lines +1173 to +1177
rows = q.QuerySql("""
select Id as DatumId, Stamp, Data
from RegistrationData
where OrganizationId = %d and Completed = 1 and Id <> %d
""" % (org_id, exclude_datum_id or 0))
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.

2 participants