Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
1dd467b4
Commit
1dd467b4
authored
Jun 29, 2020
by
Jarka Košanová
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add gitlab username and name to the mutation response
- this is needed from the frontend
parent
22b2258d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
72 additions
and
11 deletions
+72
-11
app/graphql/types/jira_user_type.rb
app/graphql/types/jira_user_type.rb
+5
-1
app/services/jira_import/users_mapper.rb
app/services/jira_import/users_mapper.rb
+3
-4
changelogs/unreleased/225212-add-fields-to-jira-mutation.yml
changelogs/unreleased/225212-add-fields-to-jira-mutation.yml
+5
-0
doc/api/graphql/reference/gitlab_schema.graphql
doc/api/graphql/reference/gitlab_schema.graphql
+11
-1
doc/api/graphql/reference/gitlab_schema.json
doc/api/graphql/reference/gitlab_schema.json
+29
-1
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+3
-1
spec/graphql/types/jira_user_type_spec.rb
spec/graphql/types/jira_user_type_spec.rb
+13
-0
spec/services/jira_import/users_mapper_spec.rb
spec/services/jira_import/users_mapper_spec.rb
+3
-3
No files found.
app/graphql/types/jira_user_type.rb
View file @
1dd467b4
...
...
@@ -13,7 +13,11 @@ module Types
field
:jira_email
,
GraphQL
::
STRING_TYPE
,
null:
true
,
description:
'Email of the Jira user, returned only for users with public emails'
field
:gitlab_id
,
GraphQL
::
INT_TYPE
,
null:
true
,
description:
'Id of the matched GitLab user'
description:
'ID of the matched GitLab user'
field
:gitlab_username
,
GraphQL
::
STRING_TYPE
,
null:
true
,
description:
'Username of the matched GitLab user'
field
:gitlab_name
,
GraphQL
::
STRING_TYPE
,
null:
true
,
description:
'Name of the matched GitLab user'
end
# rubocop: enable Graphql/AuthorizeTypes
end
app/services/jira_import/users_mapper.rb
View file @
1dd467b4
...
...
@@ -14,9 +14,8 @@ module JiraImport
{
jira_account_id:
jira_user
[
'accountId'
],
jira_display_name:
jira_user
[
'displayName'
],
jira_email:
jira_user
[
'emailAddress'
],
gitlab_id:
match_user
(
jira_user
)
}
jira_email:
jira_user
[
'emailAddress'
]
}.
merge
(
match_user
(
jira_user
))
end
end
...
...
@@ -25,7 +24,7 @@ module JiraImport
# TODO: Matching user by email and displayName will be done as the part
# of follow-up issue: https://gitlab.com/gitlab-org/gitlab/-/issues/219023
def
match_user
(
jira_user
)
nil
{
gitlab_id:
nil
,
gitlab_username:
nil
,
gitlab_name:
nil
}
end
end
end
changelogs/unreleased/225212-add-fields-to-jira-mutation.yml
0 → 100644
View file @
1dd467b4
---
title
:
Add GitLab username and name to the import users from Jira mutation response
merge_request
:
35542
author
:
type
:
changed
doc/api/graphql/reference/gitlab_schema.graphql
View file @
1dd467b4
...
...
@@ -6526,10 +6526,20 @@ type JiraService implements Service {
type
JiraUser
{
"""
I
d
of
the
matched
GitLab
user
I
D
of
the
matched
GitLab
user
"""
gitlabId
:
Int
"""
Name
of
the
matched
GitLab
user
"""
gitlabName
:
String
"""
Username
of
the
matched
GitLab
user
"""
gitlabUsername
:
String
"""
Account
id
of
the
Jira
user
"""
...
...
doc/api/graphql/reference/gitlab_schema.json
View file @
1dd467b4
...
...
@@ -18097,7 +18097,7 @@
"fields": [
{
"name": "gitlabId",
"description": "I
d
of the matched GitLab user",
"description": "I
D
of the matched GitLab user",
"args": [
],
...
...
@@ -18109,6 +18109,34 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "gitlabName",
"description": "Name of the matched GitLab user",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "gitlabUsername",
"description": "Username of the matched GitLab user",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "jiraAccountId",
"description": "Account id of the Jira user",
doc/api/graphql/reference/index.md
View file @
1dd467b4
...
...
@@ -992,7 +992,9 @@ Autogenerated return type of JiraImportUsers
| Name | Type | Description |
| --- | ---- | ---------- |
|
`gitlabId`
| Int | Id of the matched GitLab user |
|
`gitlabId`
| Int | ID of the matched GitLab user |
|
`gitlabName`
| String | Name of the matched GitLab user |
|
`gitlabUsername`
| String | Username of the matched GitLab user |
|
`jiraAccountId`
| String! | Account id of the Jira user |
|
`jiraDisplayName`
| String! | Display name of the Jira user |
|
`jiraEmail`
| String | Email of the Jira user, returned only for users with public emails |
...
...
spec/graphql/types/jira_user_type_spec.rb
0 → 100644
View file @
1dd467b4
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
GitlabSchema
.
types
[
'JiraUser'
]
do
specify
{
expect
(
described_class
.
graphql_name
).
to
eq
(
'JiraUser'
)
}
it
'has the expected fields'
do
expect
(
described_class
).
to
have_graphql_fields
(
:jira_account_id
,
:jira_display_name
,
:jira_email
,
:gitlab_id
,
:gitlab_username
,
:gitlab_name
)
end
end
spec/services/jira_import/users_mapper_spec.rb
View file @
1dd467b4
...
...
@@ -29,9 +29,9 @@ RSpec.describe JiraImport::UsersMapper do
# mapping is tracked in https://gitlab.com/gitlab-org/gitlab/-/issues/219023
let
(
:mapped_users
)
do
[
{
jira_account_id:
'abcd'
,
jira_display_name:
'user1'
,
jira_email:
nil
,
gitlab_id:
nil
},
{
jira_account_id:
'efg'
,
jira_display_name:
nil
,
jira_email:
nil
,
gitlab_id:
nil
},
{
jira_account_id:
'hij'
,
jira_display_name:
'user3'
,
jira_email:
'user3@example.com'
,
gitlab_id:
nil
}
{
jira_account_id:
'abcd'
,
jira_display_name:
'user1'
,
jira_email:
nil
,
gitlab_id:
nil
,
gitlab_username:
nil
,
gitlab_name:
nil
},
{
jira_account_id:
'efg'
,
jira_display_name:
nil
,
jira_email:
nil
,
gitlab_id:
nil
,
gitlab_username:
nil
,
gitlab_name:
nil
},
{
jira_account_id:
'hij'
,
jira_display_name:
'user3'
,
jira_email:
'user3@example.com'
,
gitlab_id:
nil
,
gitlab_username:
nil
,
gitlab_name:
nil
}
]
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment