andygrunwald / go-jira

Go client library for Atlassian Jira
https://pkg.go.dev/github.com/andygrunwald/go-jira?tab=doc
MIT License
1.47k stars 469 forks source link

Fix for GetList Unmarshalling Issue #630

Open anwalsh opened 1 year ago

anwalsh commented 1 year ago

Currently the GetList() function for IssueLinkTypes in OnPremise and Cloud fails to return the JSON document from the API. This is because it expects a top level array of subdocuments and not a top level document containing an array of subdocuments. I have corrected this behavior and revised the tests to ensure the behavior is correct. I have also tested this behavior against my own Jira OnPremise and Cloud instances.

What type of PR is this?

What this PR does / why we need it:

As currently implemented GetList() does not return the expected list of IssueLinkTypes. Instead, the function call returns an empty list and an error if probed deeply enough. All tests pass against the unit tests which further cause confusion. However, directly calling the endpoint and verifying the output we can discern that the function expects a different JSON document shape than that which is returned (see the test mock of the output). This PR addresses the above behavior for tests, onpremise, and Cloud. It also hopes to verify the v2 push for each of these functions - but I'd like feedback on that from a Maintainer before I call it "good".

Which issue(s) this PR fixes:

NA - I didn't file an issue - apologies if that is incorrect, I'll be sure to redress that if we prefer that method.

Fixes # OnPremise and Cloud unmarshalling for IssueLinkTypes array.

Special notes for your reviewer:

I'd like to be more involved with the project if I may. However, I'd likely need some guidance especially around the goals/nongoals specifically to do with the push for v2 and vision. I was wondering if there might be any mentorship ability or a channel/communication medium for one to leverage for ad hoc questions to assist in ramping/working on the project?

Additional documentation e.g., usage docs, etc.:

I had a previous PR up but I did something odd with git while trying to clean up my commits - apologies for that error.

Thank you!

andygrunwald commented 1 year ago

Thanks @anwalsh for this pr. I am currently short on time for open-source contributions due to other/private obligations. This means the review of this PR can take a bit. Thanks for contributing to open source and thanks for understanding.

anwalsh commented 1 year ago

@andygrunwald no worries! I have something to fix it appears as the checks failed so I will take a look and see what I've messed up and get that sorted!

anwalsh commented 1 year ago

It seems to be a label only which isn't something I am not comfortable assigning - don't want to muddy the project inadvertently.