gavinr / github-csv-tools

Import and export GitHub issues via CSV
https://npmjs.com/github-csv-tools
MIT License
661 stars 118 forks source link

Import fails when there are multiple tag values #58

Closed brianburnette closed 3 years ago

brianburnette commented 3 years ago

I was hitting various HTTP when trying to import a large csv of issues. Using the test csv files and some trial and error, it seems that the failure occurs as soon as it encounters the first instance of multiple tags.

So in this example, Test 1 is successfully created as an issue, but then fails.

title,body,labels
Test 1, This is the test1 desc, bug
Test 2, This is the test2 desc, "question, bug"

Here is was is returned

RequestError [HttpError]: Validation Failed: {"value":"bug","resource":"Label","field":"name","code":"invalid"}
    at C:\Users\...\github-csv-tools\node_modules\@octokit\request\dist-node\index.js:86:21
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Job.doExecute (C:\Users\...\github-csv-tools\node_modules\bottleneck\light.js:405:18) {
  name: 'HttpError',
  status: 422,
  response: {
    url: 'https://github.enterprise/api/v3/repos/org/repo/issues',
    status: 422,

data: {
      message: 'Validation Failed',
      errors: [Array],
      documentation_url: 'https://developer.github.com/enterprise/2.21/v3/issues/#create-an-issue'
    }

 request: {
    method: 'POST',
    url: 'https://github.enterprise/api/v3/repos/org/repo/issues',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'github-csv-tools octokit-rest.js/18.9.0 octokit-core.js/3.5.1 Node.js/12.13.0 (win32; x64)',
      authorization: 'token [REDACTED]',
      'content-type': 'application/json; charset=utf-8'
    },
    body: '{"title":"Test 2","body":"This is the test2 desc","labels":["question"," bug"]}',
    request: { hook: [Function: bound bound register] }
  }
brianburnette commented 3 years ago

my fault, there was a space after the comma within the quotations.