Fix FK violation when merging users with signup_ranked_choices#11216
Merged
Fix FK violation when merging users with signup_ranked_choices#11216
Conversation
Add SignupRankedChoice to both RECORD_KEEPING_FIELDS (updated_by_id) and USER_CON_PROFILE_REFERENCES (user_con_profile_id) so ranked choices are reassigned to the winning user/profile rather than causing a FK violation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When two user_con_profiles in the same convention are merged, transfer ranked choices by appending them after the winning profile's existing choices per state, rather than using update_all which would violate the unique constraint on (user_con_profile_id, state, priority). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…files upload-artifact@v5 preserves directory structure, so downloaded artifacts land at e.g. minitest-coverage/coverage/coverage.xml, not minitest-coverage/coverage.xml. Also change the rescue from StandardError (which silently swallowed missing file errors) to only catch REXML::ParseException, and add an explicit abort for missing files. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…paths actions/checkout@v5 cleans the workspace, which was deleting the downloaded artifacts before the merge step could use them. Move checkout to first so it runs before the downloads. Also revert the coverage/ path prefix added in the previous commit — upload-artifact@v5 strips the common directory prefix from globs, so files land directly in the download directory, not nested under coverage/. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Code Coverage Report: Only Changed Files listed
Minimum allowed coverage is |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SignupRankedChoicetoRECORD_KEEPING_FIELDSsoupdated_by_idis reassigned to the winning user before the losing user is destroyed (fixes the FK violation from the Sentry error)SignupRankedChoicetoUSER_CON_PROFILE_REFERENCESso ranked choices are transferred to the winning profile rather than being deleted when a losing profile is destroyedFixes #11215
Test plan
MergeUsersServiceTestverifiesupdated_by_idis reassigned to the winning user🤖 Generated with Claude Code