AO3-4930 Remove Invited collection participant role - #6007
Open
pmonfort wants to merge 1 commit into
Open
Conversation
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.
Pull Request Checklist
AO3-1234 Fix thing)Issue
https://otwarchive.atlassian.net/browse/AO3-4930
Purpose
Removes the "Invited" collection participant role, which had no real purpose.
The only code path that acted on it was
CollectionParticipantsController#joina participant with theInvitedrole who clicked "Join" was promoted toMember. In practice this almost never happened, because nothing in the codebase ever assigns theInvitedrole, adding someone from the participants page already creates them directly as aMember. The only way to reach the flow was for a maintainer to add a user and then manually change their role to "Invited" in the dropdown.Changes:
CollectionParticipant: remove theINVITEDconstant, the "Invited" option from the role dropdown, andis_invited?.Collection#invitedandUser#invited_collections: reCollectionParticipantsController#join: remove the branch that accepted invitations. Joining a collection you already participate in now always shows "You have already joined (or applied to) this collection."After:remove_invited_collection_participant_roletask to convert any existingInvitedrows toNone("applied to join")."Invited"no longer being a valid role.After Deploy Steps
Run the after task before deploying the code:
bundle exec rake After:remove_invited_collection_partiIt converts any remaining
Invitedcollection participants toNoneand prints the number of rows updated. It is idempotent and safe to re-run.Ordering matters: once the new code is live,
Invitedis no longer an allowedparticipant_role. Any leftover row would fail validation ("That is not a valid participant role.") when a maintainer edits that participant, and the role dropdown on the participants page would have no selected option for them.No schema change, no index change, no reindex needed. Safe to include in a regular release.
Rollback: revert the code only. Converted rows stay as
None, which is a valid role in both versions.Testing Instructions
Credit
Pablo Monfort (he/him)