Fix import of issues without body message by ssinhaleite · Pull Request #115 · gavinr/github-csv-tools · GitHub
Skip to content

Fix import of issues without body message#115

Open
ssinhaleite wants to merge 2 commits into
gavinr:masterfrom
ssinhaleite:ssinhaleite-empty-body-field
Open

Fix import of issues without body message#115
ssinhaleite wants to merge 2 commits into
gavinr:masterfrom
ssinhaleite:ssinhaleite-empty-body-field

Conversation

@ssinhaleite

Copy link
Copy Markdown

The CSV import threw an error when an issue didn't have a body defined. Since it is a good practice to have a body defined, in the case of importing issues, we duplicate the title into the body. While this doesn't clarify the issue, it highlights the problem and still imports the issue.

Another option would be to remove the verification that the body is empty whatsoever, and if a body column exists, just add it the way it is, even if empty.

The CSV import threw an error when an issue didn't have a body defined.
Since it is a good practice to have a body defined, in the case of importing issues, we duplicate the title into the body. While this doesn't clarify the issue, it highlights the problem and still imports the issue.
@gavinr

gavinr commented Dec 5, 2023

Copy link
Copy Markdown
Owner

@ssinhaleite

Copy link
Copy Markdown
Author

Hi @gavinr! I've just added a CSV example file that would raise an error.

It generates the following error message:

Error
RequestError [HttpError]: Validation Failed: {"resource":"Issue","code":"missing_field","field":"body"}
    at /home/vleite/.nvm/versions/node/v20.10.0/lib/node_modules/github-csv-tools/node_modules/@octokit/request/dist-node/index.js:122:21
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  
  ...

@gavinr

gavinr commented Dec 5, 2023

Copy link
Copy Markdown
Owner

Thanks for providing the example.

As a user, if I'm trying to import your example:
image

I would NOT expect the issue title to be in the body of the first issue... I would actually expect the body to be empty.

In the GitHub web UI, you CAN create an issue with an empty body.

So I think we need to do some research to figure out how to create an issue with an empty body in these cases.

If you'd like to update your PR to do that, please do. Otherwise we could close this and open an issue for discussion.

@ssinhaleite

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants