gitlab-org--gitlab-foss/lib/gitlab/phabricator_import/representation/user.rb
Bob Van Landuyt 32184839c3 Fetch users from Phabricator to link to issues
We fetch the users from Phabricator based on their Phabricator ID. If
a user with the same username exists and is a member of the project,
we set them as assignee or author.

When a user is applicable, we also cache it in Redis so we don't have
to perform the request again for the same phid.
2019-07-10 17:15:43 +02:00

25 lines
385 B
Ruby

# frozen_string_literal: true
module Gitlab
module PhabricatorImport
module Representation
class User
def initialize(json)
@json = json
end
def phabricator_id
json['phid']
end
def username
json['fields']['username']
end
private
attr_reader :json
end
end
end
end