sailuh / kaiaulu

An R package for mining software repositories
http://itm0.shidler.hawaii.edu/kaiaulu
Mozilla Public License 2.0
18 stars 12 forks source link

make_jira_issue creates incorrect but working format #258

Closed carlosparadis closed 7 months ago

carlosparadis commented 9 months ago

The original jira_sample_log() may have had some formatting issues in regards to list inside lists.

E.g. whereas the original jirAgileR will add a value inside position 0:value, our jira_make_issue will add it inside the position 0:0:value.

This unfortunately makes the make_jira_issue_tracker highly complex, as it accesses positions by index, when all it should need is access the base_info_cell and ext_info_cell and combine in a new list.

Considering we want to eventually move away from JirAgileR, and the JIRA API does not add these base_info_cell and ext_info_cell elements, maybe it is best to only address this when adding the new function once we have a built-in JIRA issue crawler.

carlosparadis commented 7 months ago

@anthonyjlau, Could you link the comment on your current issue that addresses this here and briefly elaborate on how you are addressing this with auto-box? I would like to close this issue once your PR is accepted.

anthonyjlau commented 7 months ago

In my comment about the 0 indexing problem, I discussed that the reason that values were put inside of value a list was due to the way that jsonlite maps R data to JSON. There is a website I found that shows that jsonlite puts vectors of length 1 into arrays of length 1. In order to solve this issue, when I call write_json, I set the auto_unbox parameter to TRUE.

For example: jsonlite::write_json(rtn_json_issues, save_filepath, auto_unbox = TRUE)

auto_unbox automatically "unboxes" all atomic vectors of length 1 and makes it a key-value pair. This way, the written JSON file will have the exact same format as a JSON file from an API call.

carlosparadis commented 7 months ago

Thank you @anthonyjlau. Since the issue is now being addressed and resolved in the new Fake Jira issue, I am closing this issue!