GraphQL mutation to retry failed reassigments

What does this MR do and why?

This adds a GraphQL mutation to allow users to retry failed placeholder reassignments via the API using a new service implemented in !227954 (merged).

Reassigning placeholder records is an expensive operation, the retry reassignment service prevents users from repeatedly retrying a source user that continues to fail by tracking the number of retry attempts in redis on each successful retry. Users are allowed to retry a failed source user up to 3 times within 16 hours before receiving an error containing the time time they must wait before trying again.

References

How to set up and validate locally

Follow the validation steps in !227954 (merged) to create a source user and make it fail, but use the new mutation to retry the failed reassignment instead of the console:

mutation {
  importSourceUserRetryFailedReassignment(input: { id: "gid://gitlab/Import::SourceUser/<SOURCE_USER_ID>" }) {
    importSourceUser {
      id
      status
      reassignToUser {
        id
        username
      }
    }
    errors
  }
}

Validate:

  • A source user can be successfully retried
  • A source user that fails on retry can only be retried 3 times in 16 hours (RETRY_COOLDOWN can be lowered from 16 hours to a few minutes for testing)

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #589777

Edited by Sam Word

Merge request reports

Loading