Skip to content

Fix revoked achievements returned from achievements field

What does this MR do and why?

Revoked achievements are currently returned from the Achievements.userAchievements field because it doesn't use the resolve.

This MR fixes that issue.

&9429

How to set up and validate locally

  • Seed some achievements (if you don't already have some in your database): FILTER=achievements rake db:seed_fu
  • Find a namespace with a revoked achievement (from the rails console): Achievements::UserAchievement.where.not(revoked_by_user_id: nil).first.achievement.namespace.full_path
  • Grab userAchievements for the namespace
    query getAchievements {
    namespace(fullPath: "gitlab-org") {
      achievements {
        nodes {
          name
          userAchievements{
            nodes {
              id
              revokedByUser {
                username
              }
            }
          }
        }
      }
    }
    }
  • You will see the revoked achievement in master branch, but not this one 🎉

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Lee Tickett

Merge request reports

Loading