<commit_before>import Promise from 'bluebird'
import extend from 'xtend'
import * as gitlabClient from './gitlabClient'

// MRのユーザを表示します。
export default function(objectKind, body) {
  if (objectKind === 'merge_request' || objectKind === 'issue') {
    let objectAttributes = body.object_attributes,
      projectId = objectKind === 'merge_request' ? objectAttributes.target_project_id : objectAttributes.project_id,
      project = gitlabClient.project({
        id: projectId
      }),
      author = gitlabClient.user({
        user_id: objectAttributes.author_id
      }),
      assignee = objectAttributes.assignee_id ? gitlabClient.user({
        user_id: objectAttributes.assignee_id
      }) : Promise.resolve({
        name: ''
      })

    return Promise.all([project, author, assignee])
      .then((results) => {
        // ディープコピー
        let newBody = extend(body, {
          objectAttributes: extend(objectAttributes)
        })

        // URLを追加します。
        // URLに指定するIDはプロジェクト毎のiidです。
        newBody.objectAttributes.url = results[0].web_url + '/' + objectKind + 's/' + objectAttributes.iid

        // authorを追加します。
        newBody.objectAttributes.author_name = results[1].name

        // assigneeを追加します。
        newBody.objectAttributes.assignee_name = results[2].name

        return Promise.resolve(newBody)
      })
  } else {
    return Promise.resolve(body)
  }
}
<commit_msg>Bugfix: lack of assignee name.<commit_after>import Promise from 'bluebird'
import extend from 'xtend'
import * as gitlabClient from './gitlabClient'

// MergeRequestとissueのユーザを表示します。
export default function(objectKind, body) {
  if (objectKind === 'merge_request' || objectKind === 'issue') {
    let objectAttributes = body.object_attributes,
      projectId = objectKind === 'merge_request' ? objectAttributes.target_project_id : objectAttributes.project_id,
      project = gitlabClient.project({
        id: projectId
      }),
      author = gitlabClient.user({
        user_id: objectAttributes.author_id
      }),
      assignee = objectAttributes.assignee_id ? gitlabClient.user({
        user_id: objectAttributes.assignee_id
      }) : Promise.resolve({
        name: ''
      })

    return Promise.all([project, author, assignee])
      .then((results) => {
        // ディープコピー
        let newBody = extend(body, {
          objectAttributes: extend(objectAttributes)
        })

        // URLを追加します。
        // URLに指定するIDはプロジェクト毎のiidです。
        newBody.object_attributes.url = results[0].web_url + '/' + objectKind + 's/' + objectAttributes.iid

        // authorを追加します。
        newBody.object_attributes.author_name = results[1].name

        // assigneeを追加します。
        newBody.object_attributes.assignee_name = results[2].name

        return Promise.resolve(newBody)
      })
  } else {
    return Promise.resolve(body)
  }
}

{'fraction_non_alphanumeric': 0.11446629213483146, 'fraction_numerical': 0.002106741573033708, 'mean_word_length': 2.7785145888594163, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2236160', 'n_tokens_mistral': 909, 'n_tokens_neox': 874, 'n_words': 154}